编程爱好者

编程爱好者

 

2008年8月18日

想写一个本地进程和远程进程通讯的机制.但是总是出现Permission denied

摘要: #include #include #include #include #define NSTRS 3 /* no. of strings */ #define ADDRESS "\\\\192.168.123.203\\mysocket" /* addr to connect */ /* * Strings we send to the cli... 阅读全文

posted @ 2008-08-18 17:20 new_man 阅读(702) 评论(0) 推荐(0) 编辑

linux下线程调用sleep,进程挂起

摘要: 在linux下调用sleep是用时钟的,一个进程的时钟系统是有限制的.如果每个线程使用sleep,到了最大的数量,最终会进程会挂起.最好是用select取代 void select_sleep(int i) { struct timeval timeout; timeout.tv_sec = i; timeout.tv_usec = 0; select( 0, NULL, NULL... 阅读全文

posted @ 2008-08-18 14:31 new_man 阅读(5407) 评论(0) 推荐(0) 编辑

在线程里面等待用户输入

摘要: fd_set rset; tv.tv_sec=0; tv.tc_usec=0; or 1 FD_ZERO(&rset); FD_SET((int)stdin,&rset);) select((int)stdin),&rset,NULL,NULL,&tv); 阅读全文

posted @ 2008-08-18 12:27 new_man 阅读(221) 评论(0) 推荐(0) 编辑

导航