Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void SSL_Server::SSLS_connecting(bool enable) {
- if (enable) {
- if (ssls_connectLoop == NULL) {
- pthread_create(&ssls_connectLoop, NULL, &SSL_Server::SSLS_connectLoop, static_cast<void*>(this));
- }
- } else {
- if (ssls_connectLoop != NULL) {
- pthread_cancel(ssls_connectLoop);
- ssls_connectLoop = NULL;
- }
- }
- }
- void* SSL_Server::SSLS_connectLoop(void* data) {
- SSL_Server* p_this = static_cast<SSL_Server*>(data);
- vector<void*> csdata;
- void* test = p_this;
- csdata.push_back(test);
- csdata.push_back(&cs);
- pthread_create(&cs.thread, NULL, &SSL_Server::SSLS_reciveLoop, static_cast<void*>(&csdata));
- }
- void* SSL_Server::SSLS_reciveLoop(void* raw_data) {
- vector<void*>* data_p = static_cast<vector<void*>*>(raw_data);
- vector<void*> data = static_cast<vector<void*>>(*data_p);
- void* test = data[0];
- SSL_Server* p_this = static_cast<SSL_Server*>(test);
- ssls_cs* cs = (ssls_cs*)data[1];
- printf("->%i\n", p_this->ssls_port);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement