Linux Socketѧϰ±Ê¼Ç£¨2£© SocketµÄ½éÉÜ
Socket ¾ÍÊÇÌ×½Ó×Ö¡£
Socket ¿ÉÒԺͱ¾µØĿ¼°ó¶¨£¬Ò²¿ÉÒÔºÍÒ»¸öIPµØÖ·°ó¶¨¡£
int socketpair(sa_family, socket_type, protocal, int sz[2]);
sa_family: AF_LOCAL( ºÍ AF_UNIXÒ»Ñù) ±íʾ±¾µØµÄsocket Á¬½Ó
AF_INET ±íʾInternet µÄsocket Á¬½Ó
ÉÏÊöº¯Êý´´½¨ÁËÒ»¶Ôsocket £¬·Ö±ð·ÅÔÚ sz[0], sz[1] ÀïÃ棬ÕâÁ½¸ö¶¼ÊÇsocket µÄ file unit number£¬ ºÍ´ò¿ªÎļþÊÇÒ»ÑùµÄ¡£
Ïà¹ØÎĵµ£º
Ò»¡¢ÒýÑÔ£º
±¾ÎĵµµÄÄÚÈݴ󲿷ÝÄÚÈݶ¼ÊÇ´ÓÍøÉÏÊÕ¼¯¶øÀ´£¬È»ºóÅäºÏһЩеĽØͼ£¨Äں˰汾£ºV2.4.19£©¡£ÔÚÿһÅäÖÃÏîºó»áÓÐÒ»¸öÑ¡ÔñÖ¸ÄϵIJ¿·Ý£¬ÓÃÀ´Ö¸µ¼´ó¼ÒÔõôÑù¸ù¾Ý×Ô¼ºµÄÇé¿öÀ´×öÏàÓ¦µÄÑ¡Ôñ£»»¹ÓÐÔÚÿһ¸ö´óÏîºÍÎĵµµÄ×îºó»áÓÐÒ»¸ö¾Ñé̸£¬ËüÊÇһЩ¸ßÊÖÃÇÔÚÓ¦¶ÔÎÊÌâºÍ´¦ÀíÌØÓÐÓ²¼þʱµÄһЩ¾Ñ飨Õâ¸ö»¹µ ......
±¾½ÚºÍ´ó¼ÒÒ»ÆðѧϰһÏÂÔÚlinuxÏÂʹÓÃapache+svn+sslÅäÖð²È«°æ±¾¿ØÖÆƽ̨ÎÊÌ⣬¿´Íê±¾ÎÄÄã¿Ï¶¨Óв»ÉÙÊÕ»ñ£¬Ï£Íû±¾ÎÄÄ̻ܽáÄã¸ü¶à¶«Î÷¡£Ê×ÏȽéÉÜÒ»ÏÂlinuxÏÂapache+svn+sslÅäÖõĻ·¾³¡£
»·¾³£º
centos5.4_x64
apache2.2.14
subversion-1.4.2(µ£ÐÄ°ü¹ØÁªÐÔÎÊÌ⣬¾ÍûÓп¼ÂÇ×îа汾£©
°²×°¹ý³Ì£º
1£¬apache°²×°
#./co ......
UbuntuµÄÐí¶à²Ù×÷ÊÇÔÚÖÕ¶ËÖнøÐеģ¬Í¨¹ýsudoÃüÁîÖÎÀíµÄÎļþÊÇÓÉroot
³ÖÓÐȨÏÞ£¨Ä¬ÈÏÓû§Ã»ÓÐȨÏÞÔËÐкÍÐ޸ģ©µÄ£¬Ò»°ãÓû§ÊÇÎÞ·¨¸Ä±äµÄ¡£ÔÚͼÐνçÃæÉÏ£¬ÎÒÃÇ¿ÉÒÔͨ¹ýÊôÐÔÖеÄȨÏÞÑ¡Ïî¼Ð½øÐвÙ×÷¡£µ«ÊÇÒ»µ©ÎļþµÄÊôÐÔÏÔʾµ±Ç°
Óû§Ã»ÓжÁдȨÁ¦Ê±£¬ÎÞ·¨ÔÚͼÐνçÃæÉÏÐÞ¸ÄȨÏÞ¡£
³£Ó÷½·¨ÈçÏ£º
£¨Æô¶¯Ò»¸öshell£¬¼üÈëÃü ......
linuxµÄÍø¿¨IPµØÖ·ÊÇ´æ·ÅÔÚÎĵµÖеģ¬Õâ¸öÅäÖÃÎĵµÔÚ/etc/sysconfig/network-scriptsÏ£¬Ãû³Æ·Ö±ðΪifcfg-eth0,ifcfg-eth1....¼ÙÈçÄúÓÐÒ»¿éÍø¿¨£¬¾ÍÖ»ÓÐifcfg-eth0Ò»¸öÎĵµ£¬¼ÙÈçÄúÓÐÁ½¿é»òÁ½¿éÒÔÉϵÄÍø¿¨£¬¾Í»áÓÐifcfg-eth1¡¢ifcfg-eth2µÈÎĵµµÄ³öÏÖ¡£
Îĵµ½á¹¹£º
DEVICE=eth0 &n ......
ÔÚQTÖпÉÒÔÖ±½ÓʹÓÃQTextCodecÀ´×ª»»×Ö·û´®µÄ±àÂë¡£
ÀýÈ磬ÎÒÃÇÏëÔÚ³ÌÐòÖÐʹÓÃÖÐÎÄ£¬ÀàËÆtr£¨“飬ÄãºÃÂ𣿔£©¡£ÎÒÃÇÒªÔÚmainº¯ÊýÖÐÔö¼ÓÒÔϼ¸ÌõÓï¾ä£¬ÖØÐÂÉèÖÃÒ»ÏÂĬÈϵıàÂëÆ÷¡£
Ïȵ÷ÓÃÏÂÃæÁ½¸öº¯ÊýÖ®Ò»
QTextCodec *codec=QTextCodec::codecForName(”gbk”);
QTextCodec *codec=QTextCodec ......