Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

·¢ÏÖ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


Ïà¹ØÎĵµ£º

ʵսLinux Bluetooth±à³Ì(Áù) L2CAP±à³ÌʵÀý

ÀýÒ»£º·¢ËÍSignaling Packet£º
Signaling CommandÊÇ2¸öBluetoothʵÌåÖ®¼äµÄL2CAP²ãÃüÁî´«Êä¡£ËùÒÔµÃSignaling CommandʹÓÃCID 0x0001.
¶à¸öCommand¿ÉÒÔÔÚÒ»¸öC-frame£¨control frame£©Öз¢ËÍ¡£
 Èç¹ûÒªÖ±½Ó·¢ËÍSignaling Command.ÐèÒª½¨Á¢SOCK_RAWÀàÐ͵ÄL2CAPÁ¬½ÓSocket¡£ÕâÑù²ÅÓлú»á×Ô¼ºÌî³äCommand Code£¬Identi ......

ʵսLinux Bluetooth±à³Ì (Æß) SDPЭÒé

Service Discovery Protocol(SDP)ÌṩһÖÖÄÜÁ¦£¬ÈÃÓ¦ÓóÌÐòÓз½·¨·¢ÏÖÄÄÖÖ·þÎñ¿ÉÓÃÒÔ¼°ÕâÖÖ·þÎñµÄÌØÐÔ¡£
·þÎñ·¢ÏÖЭÒé(SDP»òBluetooth SDP)ÔÚÀ¶ÑÀЭÒéÕ»ÖжÔÀ¶ÑÀ»·¾³ÖеÄÓ¦ÓóÌÐòÓÐÌØÊâµÄº¬Ò⣬·¢ÏÖÄĸö·þÎñÊÇ¿ÉÓõĺÍÈ·¶¨ÕâЩ¿ÉÓ÷þÎñµÄÌØÕ÷¡£SDP¶¨ÒåÁËbluetooth client·¢ÏÖ¿ÉÓÃbluetooth server·þÎñºÍËüÃǵÄÌØÕ÷µÄ·½·¨¡£ ......

linuxÍøÇÅģʽvlantrunk͸´«

 linuxÍøÇÅģʽvlantrunk͸´«
2007-12-27 08:30
Ê×ÏÈʹÓÃvconfig´´½¨vlanÐéÄâ½Ó¿Ú£¬²¢·Ö±ðÔÚÁ½¸ö½Ó¿ÚÉÏÔö¼Óvlan100\vlan200\vlan300
vconfig add eth0 100
vconfig add eth0 100 
vconfig add eth0 300
vconfig add eth1 100
vconfig add eth1 200
vconfig add eth1 300
ÆôÓÃvlan¶Ë¿Ú
ifconfig eth0.10 ......

linuxÏÂc±àÒëϵͳ(ת)

 
±àÒë¹ý³Ì¸ÅÊö
Á˽âһЩ±àÒë֪ʶµÄ¶ÁÕß¶¼ÖªµÀ£¬Ëùν±àÒ룬¾ÍÊÇÔÚ±àÒë³ÌÐò¶ÁȡԴ³ÌÐò£¨×Ö·ûÁ÷£©£¬¶ÔÖ®½øÐдʷ¨ºÍÓï·¨µÄ·ÖÎö£¬½«¸ß¼¶ÓïÑÔÖ¸Áîת»»Îª¹¦ÄܵÈЧµÄ»ã±à´úÂ룬ÔÙÓÉ»ã±à³ÌÐòת»»Îª»úÆ÷ÓïÑÔ£¬²¢ÇÒ°´ÕÕ²Ù×÷ϵͳ¶Ô¿ÉÖ´ÐÐÎļþ¸Ðл¸ñʽµÄÒªÇóÁ´½ÓÉú³É¿ÉÖ´ÐгÌÐò¡£
UNIX»·¾³ÏµÄC±àÒëϵͳËù×ñÑ­µÄÒ²ÊÇÕâôһ¸öÒ»° ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ