0
void* thread(void* sockArg)
{
   TCPSocket* s = (TCPSocket*)sockArg;
   s->showUser();
  return sockArg;
}

int main()
{
  ServerSocket serversocket(4543);

  try {
      while(1)
      {
          TCPSocket* socket = serversocket.accept();
          pthread_t pid;
          pthread_create(&pid, NULL, &thread, socket);
          pthread_join(pid, NULL);
      }
  }catch(Error& err) {
      err.what();
  }
}

Why doesnt my s->showUser(); gets called ?

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by mike_2000_17
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.