相信自己,只有不想做的,没有做不到的。
发布时间:2013-10-27 11:56:46
server.c--------------------->服务器端//./server ip portint main(int argc, const char *argv[]){ int sockfd; int n; char buf[1024]; struct sockaddr_in server_addr,peer_addr; int addr_len = sizeof(struct sockaddr); sockfd = socket(AF_INET,SOCK_DGRAM,0); if(sockfd < 0){ perror("Fail to soc.........【阅读全文】
发布时间:2013-10-27 10:35:25
client.c--------------->客户端//./client server_ip server_port int main(int argc, const char *argv[]){int connect_fd;struct sockaddr_in server_addr;struct sockaddr_in client_addr;//创建流式套接字if((connect_fd = socket(AF_INET,SOCK_STREAM,0)) < 0){perror("Fail to socket ");exi.........【阅读全文】
发布时间:2013-10-27 10:08:02
main.c------------------->//创建多线程int main(int argc, char **argv){#if 1Create_table (); //创建环境表#endifsetLimit (1, 50, 5, 50, 10, 500, 10);setLimit (2, 50, 5, 50, 10, 500, 10);pthread_mutex_init (&mutex_slinklist, NULL);pthread_mutex_init (&mutex_sqlite, NULL);pthread_mutex.........【阅读全文】