//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[0]);
//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[0]);