//1. thtread main
void *listen_thread(void *data)
{
int socket = (int)data;
size_t len;
char byte;
len = 1;
(void) recv(socket,&byte,&len,-1);
exit(1);
}
//2。pthread call
pthread_create(&tid, NULL, listen_thread, (void*)sockpair[1])
//1. thtread main
void *listen_thread(void *data)
{
int socket = (int)data;
size_t len;
char byte;
len = 1;
(void) recv(socket,&byte,&len,-1);
exit(1);
}
//2。pthread call
pthread_create(&tid, NULL, listen_thread, (void*)sockpair[1])
转载于:https://www.cnblogs.com/gaoyang302/archive/2012/11/06/2756918.html