当前位置:首页
开发技术指南» 文章正文
    引言:
 

 

 ·大家看看这道assertion题    »显示摘要«
    摘要: which fragment is an example of inappropriate use of assertions? a. assert (!(map.contains(x))); map.add(x); b. if (x > 0) { } else { assert (x==0); } c. public void amethod(int x) { assert (x ......
    摘要: 下面的程序,我试图返回一个带有参数的url地址: string url=application["rootfolder"].tostring(); url+="/include/webdialog/common/createuserlist.aspx?tbl="+_tablename; url+="&fld="+_fiel......


socket select()能否取得剩余时间

比如,  
  tv.tv_sec   =   10;  
  tv.tv_usec   =   0;  
  那么在第7秒的时间发生了一个读事件,我能否得到已经过去的时间或剩余的时间如3或7呢

NO.1   作者: fierygnu

On   Linux,   the   function   select   modifies   timeout   to   reflect   the   amount   of   time   not   slept;   most   other   implementations   do   not   do   this.   This   causes   problems   both   when   Linux   code   which   reads   timeout   is   ported   to   other   operating   systems,   and   when   code   is   ported   to   Linux   that   reuses   a   struct   timeval   for   multiple   selects   in   a   loop   without   reinitializing   it.   Consider   timeout   to   be   undefined   after   select   returns.  
  建议不要使用timeout返回值。可以在select之前和之后取系统时间来计算。


    摘要: 为什么我的主机,比如192.168.1.1,在拔掉网线的时候就自己ping自己不通了??而我的另一台是可以地??? 也就是各位在配置好自己的服务器后,调试jsp程序时,在本机上,在ie中输入地址: http://localhost:8080/index.jsp是可以的,输入 http://192.168.1.1/index.jsp也是可以的。 在断开网络后,在本机上,应该输地址http:/......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE