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

linuxÏÂʹÓÃTCP´æ»î(keepalive)¶¨Ê±Æ÷

2008-05-22 14:34
/*ÓÉ
hi.baidu.com/zhihui3409
ÊÕ¼¯ÕûÀí£¬×ªÔØʱÇ븽´ø
´ËÐÐ*/
Ò»¡¢Ê²Ã´ÊÇkeepalive¶¨Ê±Æ÷£¿[
1]
ÔÚÒ»
¸ö¿ÕÏеģ¨
idle
£©
TCP
Á¬½ÓÉÏ£¬Ã»ÓÐÈÎ
ºÎµÄÊý¾ÝÁ÷£¬Ðí¶à
TCP/IP
µÄ³õѧÕ߶¼¶Ô´Ë¸Ðµ½¾ªÆæ¡£Ò²¾ÍÊÇ˵£¬Èç¹û
TCP
Á¬
½ÓÁ½¶ËûÓÐÈκÎÒ»¸ö½ø³ÌÔÚÏò¶Ô·½·¢ËÍÊý¾Ý£¬ÄÇôÔÚÕâÁ½¸ö
TCP
Ä£¿éÖ®¼äûÓÐÈκεÄÊý¾Ý½»»»¡£Äã¿ÉÄÜ
ÔÚÆäËüµÄÍøÂçЭÒéÖз¢ÏÖÓÐÂÖѯ£¨
polling
£©£¬µ«ÔÚ
TCP
ÖÐ
Ëü²»´æÔÚ¡£ÑÔÍâÖ®Òâ¾ÍÊÇÎÒÃÇÖ»ÒªÆô¶¯Ò»¸ö¿Í»§¶Ë½ø³Ì£¬Í¬·þÎñÆ÷½¨Á¢ÁË
TCP
Á¬½Ó£¬²»¹ÜÄãÀ뿪¼¸Ð¡
ʱ£¬¼¸Ì죬¼¸ÐÇÆÚ»òÊǼ¸¸öÔ£¬Á¬½ÓÒÀ¾É´æÔÚ¡£ÖмäµÄ·ÓÉÆ÷¿ÉÄܱÀÀ£»òÕßÖØÆô£¬µç»°Ïß¿ÉÄÜ
go down
»ò
Õß
back up
£¬Ö»ÒªÁ¬½ÓÁ½¶ËµÄÖ÷»úûÓÐÖØÆô£¬Á¬½ÓÒÀ¾É±£³Ö½¨Á¢¡£
Õâ¾Í
¿ÉÒÔÈÏΪ²»¹ÜÊÇ¿Í»§¶ËµÄ»¹ÊÇ·þÎñÆ÷¶ËµÄÓ¦ÓóÌÐò¶¼Ã»ÓÐÓ¦ÓóÌÐò¼¶£¨
application-level
£©
µÄ¶¨Ê±Æ÷À´Ì½²âÁ¬½ÓµÄ²»»î¶¯×´Ì¬£¨
inactivity
£©£¬´Ó¶øÒýÆðÈκÎÒ»¸öÓ¦ÓóÌÐòµÄÖÕÖ¹¡£
È»
¶øÓеÄʱºò£¬·þÎñÆ÷ÐèÒªÖªµÀ¿Í»§¶ËÖ÷»úÊÇ·ñÒѱÀÀ£²¢Çҹرգ¬»òÕß±ÀÀ£µ«ÖØÆô¡£Ðí¶àʵÏÖÌṩÁË´æ»î¶¨Ê±Æ÷À´Íê³ÉÕâ¸öÈÎÎñ¡£
´æ»î
¶¨Ê±Æ÷ÊÇÒ»¸ö°üº¬ÕùÒéµÄÌØÕ÷¡£Ðí¶àÈËÈÏΪ£¬¼´Ê¹ÐèÒªÕâ¸öÌØÕ÷£¬ÕâÖÖ¶Ô¶Ô·½µÄÂÖѯҲӦ¸ÃÓÉÓ¦ÓóÌÐòÀ´Íê³É£¬¶ø²»ÊÇÓÉ
TCP
ÖÐ
ʵÏÖ¡£´ËÍ⣬
Èç¹ûÁ½¸öÖÕ¶Ëϵͳ֮¼äµÄij¸öÖмäÍøÂçÉÏÓÐÁ¬½ÓµÄÔÝʱÖжϣ¬ÄÇô´æ»îÑ¡Ï
option
£©
¾ÍÄܹ»ÒýÆðÁ½¸ö½ø³Ì¼äÒ»¸öÁ¼ºÃÁ¬½ÓµÄÖÕÖ¹¡£ÀýÈ磬Èç¹ûÕýºÃÔÚij¸öÖмä·ÓÉÆ÷±ÀÀ£¡¢ÖØÆôµÄʱºò·¢ËÍ´æ»î̽²â£¬
TCP
¾Í
½«»áÈÏΪ¿Í»§¶ËÖ÷»úÒѾ­±ÀÀ££¬µ«ÊÂʵ²¢·ÇÈç´Ë¡£
´æ»î
£¨
keepalive
£©²¢²»ÊÇ
TCP
¹æ·¶µÄ
Ò»²¿·Ö¡£ÔÚ
Host Requirements RFC
ÂÞÁÐÓв»Ê¹ÓÃËüµÄÈý¸öÀíÓÉ£º£¨
1
£©
ÔÚ¶ÌÔݵĹÊÕÏÆڼ䣬ËüÃÇ¿ÉÄÜÒýÆðÒ»¸öÁ¼ºÃÁ¬½Ó£¨
good connection
£©±»ÊÍ·Å£¨
dropped
£©£¬
£¨
2
£©ËüÃÇÏû·ÑÁ˲»±ØÒªµÄ¿í´ø£¬£¨
3
£©ÔÚÒÔ
Êý¾Ý°ü¼Æ·ÑµÄ»¥ÁªÍøÉÏËüÃÇ£¨¶îÍ⣩»¨·Ñ½ðÇ®¡£È»¶ø£¬ÔÚÐí¶àµÄʵÏÖÖÐÌṩÁË´æ»î¶¨Ê±Æ÷¡£
һЩ
·þÎñÆ÷Ó¦ÓóÌÐò¿ÉÄÜ´ú±í¿Í»§¶ËÕ¼ÓÃ×ÊÔ´£¬ËüÃÇÐèÒªÖªµÀ¿Í»§¶ËÖ÷»úÊÇ·ñ±ÀÀ£¡£´æ»î¶¨Ê±Æ÷¿ÉÒÔΪÕâЩӦÓóÌÐòÌṩ̽²â·þÎñ¡£
Telnet
·þ
ÎñÆ÷ºÍ
Rlogin
·þÎñÆ÷µÄÐí¶à°æ±¾¶¼Ä¬ÈÏÌṩ´æ»îÑ¡Ïî¡£
¸öÈË
¼ÆËã»úÓû§Ê¹ÓÃ
TCP/IP
ЭÒéͨ¹ý
Telnet
µÇ
¼һ̨Ö÷»ú£¬ÕâÊÇÄܹ»ËµÃ÷ÐèҪʹÓôæ»î¶¨Ê±Æ÷µÄÒ»¸ö³£ÓÃÀý×Ó¡£Èç¹ûij¸öÓû§ÔÚʹÓýáÊøʱֻÊǹصôÁ˵çÔ´£¬¶øûÓÐ×¢


Ïà¹ØÎĵµ£º

Linux/UnixÏÂODBCµÄ°²×°¡¢ÅäÖÃÓë±à³Ì

±¾ÎÄÖ÷ÒªÄÚÈÝÊǽéÉÜODBCµÄ¼òµ¥Ô­Àí£¬ÒÔ¼°ÈçºÎÔÚLinux/UnixϽøÐÐODBCµÄ°²×°¡¢ÅäÖÃÓë±à³Ì¡£
ODBCÔ­Àí
ODBC
ÊÇOpen Database Connect ¼´¿ª·ÅÊý¾Ý¿â»¥Á¬µÄ¼ò³Æ£¬ËüÊÇÓÉMicrosoft ¹«Ë¾ÓÚ1991
ÄêÌá³öµÄÒ»¸öÓÃÓÚ·ÃÎÊÊý¾Ý¿âµÄͳһ½çÃæ±ê×¼£¬ÊÇÓ¦ÓóÌÐòºÍÊý¾Ý¿âϵͳ֮¼äµÄÖмä¼þ¡£Ëüͨ¹ýʹÓÃÏàÓ¦Ó¦ÓÃƽ̨ÉϺÍËùÐèÊý¾Ý¿â¶ÔÓ¦µÄÇý ......

Linuxѧϰ£¨¶þ£© ¹²Ïí¿âµÄ°²×°

°²×°³ÌÐòËùÐèÒªµÄ¹²Ïí¿âʱÐèҪעÒâµÄÎÊÌâ¡£
ÆðÒò£º°²×°libsqlite3.so.0 ºó£¬Ê¹ÓÃldd test ʱ£¬È´ÕÒ²»µ½¸Ã¿âÎļþ¡£
        ÔÚʹÓÃcpptest¶ÔÔ­³ÌÐòÔËÐе¥Ôª²âÊÔʱ£¬·¢ÏÖ´íÎ󣬼´ÕÒ²»µ½¿âÎļþ¡£
°²×°Íêlibsqlite3.so.0ºó£¬ÆäÊÇ´æ´¢ÔÚusr/local/libµÄ¡£ËùÒÔÎÊÌâÔÚÓÚ£¬linuxϵÄ×°ÔسÌÐò ......

Linuxѧϰ£¨¶þ).1(ת)

1. Íù/libºÍ/usr/libÀïÃæ¼Ó¶«Î÷£¬ÊDz»ÓÃÐÞ¸Ä/etc/ld.so.confµÄ£¬µ«ÊÇÍêÁËÖ®ºóÒªµ÷Ò»ÏÂldconfig£¬²»È»Õâ¸ölibrary»áÕÒ²»µ½
2. ÏëÍùÉÏÃæÁ½¸öĿ¼ÒÔÍâ¼Ó¶«Î÷µÄʱºò£¬Ò»¶¨ÒªÐÞ¸Ä/etc/ld.so.conf£¬È»ºóÔÙµ÷ÓÃldconfig£¬²»È»Ò²»áÕÒ²»µ½
±ÈÈç°²×°ÁËÒ»¸ömysqlµ½/usr/local/mysql£¬mysqlÓÐÒ»´ó¶ÑlibraryÔÚ/usr/local/mysql/libÏÂÃæ ......

ÔÚLinuxÏÂÈçºÎʹÓÃ×Ô¼ºµÄ¿âº¯Êý

Ò»

ʹÓÿâ±ØÒªÐÔ
  
Ìá¸ß´úÂëÖØÓÃÐÔ¡£
¶þ
 
¿âµÄÖÖÀࣺ
  
1
¾²Ì¬¿â
    
Ò»°ãÒÔ
*.a
ÃüÃû¡£
    
³ÌÐò±àÒëʱ±»¼ÓÔØ£¬´Ëºó£¬Ö»Òª³ÌÐò²»±»ÖØбàÒ룬¾²Ì¬¿â¾ÍûÓÐ×÷ÓÃÁË£¨¿ÉÒÔɾµô£©¡£
ÓÉ
ÓÚ¾²Ì¬¿âµÄ´úÂëÔÚ±àÒë¹ý³ÌÖÐÒѾ­±»ÔØÈ ......

LinuxijЩÈí¼þÎÞ·¨Ð¶ÔØÎÊÌâ

Ç°¼¸Ìì¸üÐÂubuntuµÄʱºò£¬Í»È»Ê§°Ü£¬×Ðϸһ¿´£¬ÊÇжÔØÀÏ°æ±¾µÄgzipʱºò³öÁËÎÊÌâ¡£´íÎóÐÅÏ¢£º
install-info: No dir file specified; try --help for more information.
ÊÔÁ˶à¸ö³£ÓõÄÊÖ¶¯Ð¶ÔØ·½·¨¶¼Ã»·¨¸ã¶¨£¬ÓÚÊÇÇóÖúgoogle£¬ºÜ¿ìÕÒµ½´ð°¸¡£ÊÇGNU°æµÄinstall-info´úÌæÁËdebian°æµÄinstall-infoÔì³ÉµÄÎÊÌ⣬¸²¸Ç»ØÀ´¾ÍOK ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ