·¢ÏÖselect×öÑÓʱwindowsûЧ¹û£¬LinuxÕý³£
ÔÚÍêÉÆÎҵĿçƽ̨µÄ·¢ÓʼþÀà¿âʱ£¬select×öÑÓʱwindowsûЧ¹û£¬LinuxÕý³££¬»¹ÒÔΪÎÒ´úÂëд´íÁËÄØ£»ÔÚÍøÉÏËÑËØÏÂҲû·¢ÏÖÀàËÆ˵·¨£¬ÓÚÊÇÎÒ¾ÍдÁ˶ÎС²âÁË£¬¹ûÈ»selectÑÓʱÔÚwindowsÉÏËõË®ÁË
#include <iostream>
#include <time.h>
#ifdef WIN32
#include <winsock2.h>
#pragma comment(lib,"ws2_32.lib")
#else
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#endif
using namespace std;
int main()
{
struct timeval timeWait;
timeWait.tv_sec = 0;
timeWait.tv_usec = 10000;
int liRecvCnt = 0;
time_t t1, t2;
time(&t1);
while(liRecvCnt < 10)
{
timeWait.tv_sec = 0;
timeWait.tv_usec = 500000;
liRecvCnt++;
select(0, NULL, NULL, NULL, &timeWait);
}
time(&t2);
cout<<t2-t1<<endl;
return 0;
}
ÔÚVS2005ÉÏÊä³öÊÇ 0
ÔÚLinuxÉÏÊä³öÊÇ 5 S
ÄãÓÐʲôÏë·¨£¬¾´ÇëÁôÑÔ
QQ:16645709
Ïà¹ØÎĵµ£º
ÔÍÄðÐí¾ÃµÄÊÖ¼ÇÖÕÓÚÃæÊÀÁË£¬Ï£Íû¸ßÊÖ¶à¶àÖ¸µã¡£´Ó7Ôµ½ÏÖÔÚ£¬ÎÒ²ÎÓëµÄ²úÆ·µÄÑз¢£¬Ò²Ëã¸æÒ»¶ÎÂ䣬Ã÷Ìì¾ÍÊdzɶ¼µÄÒ½²©»áÁË£¬Õ⼸¸öÔÂÂýÂý¿Ð³öÀ´µÄ¶«Î÷£¬ÒªºÃºÃµÄ×ܽáһϣ¬´óѧµÄʱºò£¬ÍæµÄÊǵ¥Æ¬»ú£¬armÂã»ú£¬¶ÔÓÚϵͳÓÐËùÁ˽⣬×ö¹ýһЩСʵÑ飬µ«ÊÇûÓÐϵͳµÄѧϰ£¬Èç½ñ×öµÄÊÂÇ飬ÈÃÎÒ¶ÔǶÈëʽlinuxµÄÈÏʶҲ¸üÕýÁËÐ ......
ѧϰlinuxÒ»Äê¶àÁË£¬»ù±¾¾ÍÊÇÒ»¸ö“ϹÕû££>³öÎÊÌ⣣>°Ù¶È/Google££>½â¾öÎÊÌ⣣>¼ÌÐøϹÕû"µÄÑ»·¡£ºÜ¸ÐлÍøÉÏÄÇô¶àÈ˶¼ÄÜ°Ñ×Ô¼ºµÄ¾Àú¡¢¾Ñé¸ú´ó¼Ò·ÖÏí£¬ËùÒÔÒ»Ö±¶¼ÓаÑ×Ô¼ºÅöµ½µÄÎÊÌâ¼°½â¾ö°ì·¨¸ú´ó¼Ò·ÖÏí£¬Ï£Íû¶Ô´ó¼ÒÄÜÓÐËù°ïÖú¡£
ºÃ£¬²»¶à·Ï»°ÁË¡ ......
²Ù×÷ϵͳÖУ¬Ç°Ì¨½ø³ÌºÍºǫ́½ø³ÌÓÐʲôÇø±ð£¿ÌØÕ÷ÊÇʲô£¿
ºǫ́³ÌÐò»ù±¾Éϲ»ºÍÓû§½»»¥£¬ÓÅÏȼ¶±ðÉÔ΢µÍÒ»µã
ǰ̨µÄ³ÌÐòºÍÓû§½»»¥£¬ÐèÒª½Ï¸ßµÄÏìÓ¦Ëٶȣ¬ÓÅÏȼ¶±ðÉÔ΢¸ßÒ»µã
Ö±½Ó´Óºǫ́ÊÖ¹¤Æô¶¯Ò»¸ö½ø³ÌÓõñȽÏÉÙһЩ£¬³ý·ÇÊǸýø³ÌÉõΪºÄʱ£¬ÇÒÓû§Ò²²»¼±×ÅÐèÒª½á¹ûµÄʱºò¡£¼ÙÉèÓû§ÒªÆô¶¯Ò»¸öÐèÒª³¤Ê±¼äÔËÐÐ ......
Õ⼸Ìì×°ÁËUbuntu²Å·¢ÏÖ£¬XmarkÔç¾Í±»ºÓзǯÁË¡£ÄѹÖ֮ǰÊéÇ©Ò»Ö±´«²»ÉÏÈ¥¡£¡£ÐÒºÃwin7»¹Ã»É¾£¬²»È»ÎÒÕû¸öÔµÄÊéÇ©¶¼Ã»ÁË¡£
Ôڴ˼ǼһÏÂÆÆǽµÄ·½·¨£º
sudo emacs /etc/hosts
Ìí¼Ó
64.147.188.86 www.xmark.com
64.147.188.92 api.xmarks.com
64.147.188.89 login.xmarks.com
64.147.188.87 sync.xmarks.com
......
ÍøÉÏ¿´µ½µÄÕâƪ¹ØÓÚLinuxÏÂCÓïÑÔǶÈë»ã±àµÄÎÄÕÂдµÄ·Ç³£È«£¬×ªÔعýÀ´¡£
Using Assembly Language in Linux.
IntelºÍAT&T»ã±àÓï·¨²îÒ죺
1¡£Ç°×º£º
Intel»ã±à¼Ä´æÆ÷ºÍÁ¢¼´ÊýÎÞÐèǰ׺¡£ºóÕ߼ĴæÆ÷ǰ׺Ϊ%£¬Á¢¼´Êýǰ׺Ϊ$¡£
eg£º
Intex Syntax
mov eax,1
mov ebx,0f ......