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

LinuxÏÂgetsockopt/setsockopt º¯Êý˵Ã÷

¹¦ÄÜÃèÊö£º
        »ñÈ¡»òÕßÉèÖÃÓëij¸öÌ×½Ó×Ö¹ØÁªµÄÑ¡ ÏѡÏî¿ÉÄÜ´æÔÚÓÚ¶à²ãЭÒéÖУ¬ËüÃÇ×Ü»á³öÏÖÔÚ×îÉÏÃæµÄÌ×½Ó×ֲ㡣µ±²Ù×÷Ì×½Ó×ÖÑ¡Ïîʱ£¬Ñ¡ÏîλÓڵIJãºÍÑ¡ÏîµÄÃû³Æ±ØÐë¸ø³ö¡£ÎªÁ˲Ù×÷Ì×½Ó×Ö²ãµÄÑ¡ÏӦ¸Ã ½«²ãµÄÖµÖ¸¶¨ÎªSOL_SOCKET¡£ÎªÁ˲Ù×÷ÆäËü²ãµÄÑ¡Ï¿ØÖÆÑ¡ÏîµÄºÏÊÊЭÒéºÅ±ØÐë¸ø³ö¡£ÀýÈ磬ΪÁ˱íʾһ¸öÑ¡ÏîÓÉTCPЭÒé½âÎö£¬²ãÓ¦¸ÃÉ趨ΪЭÒé ºÅTCP¡£
Ó÷¨£º
#include <sys/types.h>
#include <sys/socket.h>
int getsockopt(int sock, int level, int optname, void *optval, socklen_t *optlen);
int setsockopt(int sock, int level, int optname, const void *optval, socklen_t optlen);
²ÎÊý£º  
sock£º½«Òª±»ÉèÖûòÕß»ñÈ¡Ñ¡ÏîµÄÌ×½Ó×Ö¡£
level£ºÑ¡ÏîËùÔÚµÄЭÒé²ã¡£
optname£ºÐèÒª·ÃÎʵÄÑ¡ÏîÃû¡£
optval£º¶ÔÓÚgetsockopt()£¬Ö¸Ïò·µ»ØÑ¡ÏîÖµµÄ»º³å¡£¶ÔÓÚsetsockopt()£¬Ö¸Ïò°üº¬ÐÂÑ¡ÏîÖµµÄ»º³å¡£
optlen£º¶ÔÓÚgetsockopt()£¬×÷ΪÈë¿Ú²ÎÊýʱ£¬Ñ¡ÏîÖµµÄ×î´ó³¤¶È¡£×÷Ϊ³ö¿Ú²ÎÊýʱ£¬Ñ¡ÏîÖµµÄʵ¼Ê³¤¶È¡£¶ÔÓÚsetsockopt()£¬ÏÖÑ¡ÏîµÄ³¤¶È¡£
·µ»Ø˵Ã÷£º  
³É¹¦Ö´ÐÐʱ£¬·µ»Ø0¡£Ê§°Ü·µ»Ø-1£¬errno±»ÉèΪÒÔϵÄij¸öÖµ  
EBADF£ºsock²»ÊÇÓÐЧµÄÎļþÃèÊö´Ê
EFAULT£ºoptvalÖ¸ÏòµÄÄÚ´æ²¢·ÇÓÐЧµÄ½ø³Ì¿Õ¼ä
EINVAL£ºÔÚµ÷ÓÃsetsockopt()ʱ£¬optlenÎÞЧ
ENOPROTOOPT£ºÖ¸¶¨µÄЭÒé²ã²»ÄÜʶ±ðÑ¡Ïî
ENOTSOCK£ºsockÃèÊöµÄ²»ÊÇÌ×½Ó×Ö
²ÎÊýÏêϸ˵Ã÷£º
levelÖ¸¶¨¿ØÖÆÌ×½Ó×ֵIJã´Î.¿ÉÒÔÈ¡ÈýÖÖÖµ:
1)SOL_SOCKET:ͨÓÃÌ×½Ó×ÖÑ¡Ïî.
2)IPPROTO_IP:IPÑ¡Ïî.
3)IPPROTO_TCP:TCPÑ¡Ïî.¡¡
optnameÖ¸¶¨¿ØÖƵķ½Ê½(Ñ¡ÏîµÄÃû³Æ),ÎÒÃÇÏÂÃæÏêϸ½âÊÍ¡¡
optval»ñµÃ»òÕßÊÇÉèÖÃÌ×½Ó×ÖÑ¡Ïî.¸ù¾ÝÑ¡ÏîÃû³ÆµÄÊý¾ÝÀàÐͽøÐÐת»»¡¡
Ñ¡ÏîÃû³Æ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ËµÃ÷¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Êý¾ÝÀàÐÍ
========================================================================
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡SOL_SOCKET
------------------------------------------------------------------------
SO_BROADCAST¡¡¡¡¡¡¡¡¡¡¡¡ÔÊÐí·¢Ë͹㲥Êý¾Ý¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡int
SO_DEBUG¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ÔÊÐíµ÷ÊÔ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡int
SO_DONTROUTE¡¡¡¡¡¡¡¡¡¡¡¡²»²éÕÒ·ÓÉ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡int
SO_ERROR¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡»ñµÃÌ×½Ó×Ö´íÎó¡¡¡¡¡¡¡¡¡


Ïà¹ØÎĵµ£º

Windows/linux˫ϵͳµÄʱ¼äÐÞ¸ÄÎÊÌâ

    ÓÉÓÚÁ½¸öϵͳÉ趨ʱ¼äʱÒÔÖ÷°åCMOSÄÚµÄʱ¼äΪÒÀ¾Ý£¬µ«È´Óв»Í¬µÄʱ¼ä¼ÆËã±ê×¼¡£ËùÒÔµ¼ÖÂÁËϵͳʱ¼äµÄ¾À·×ÎÊÌâ¡£
    LinuxºÍÆ»¹û²Ù×÷ϵͳÒÔµ±Ç°Ö÷°åCMOSÄÚʱ¼ä×öΪ¸ñÁÖÍþÖαê׼ʱ¼ä£¬ÔÙ¸ù¾ÝϵͳÉèÖõÄʱÇøÀ´×îÖÕÈ·¶¨µ±Ç°ÏµÍ³Ê±¼ä£¨ÈçʱÇøÉèÖÃΪGMT+08:00±±¾©Ê±¼äʱÒÔ¼°µ±Ç°CMOSʱ¼äΪ03 ......

redhat linux AS4.0(U5ÆóÒµ°æ4.0£©ÏÂÔصØÖ·£¨5ÕÅÅÌ£©

×î½üÒ»Ö±Ïë×°linux  U5,һֱûÕÒµ½£¬½ñÌìÕÒµ½ÁË£¬·ÖÏí¸ø´ó¼Ò£¡£¡£¡
ftp://openware.byr.edu.cn/pub/os-images/Redhat/RHEL4u5/i386/RHEL4-U5-i386-AS-disc1.iso
 
ftp://openware.byr.edu.cn/pub/os-images/Redhat/RHEL4u5/i386/RHEL4-U5-i386-AS-disc2.iso
 
ftp://openware.byr.edu.cn/pub/os-images ......

ÒÆÖ²½»»»Ð¾Æ¬SDKµ½Linuxϵͳ






ÐèÇó
£º
°Ñ88E6131½»»»Ð¾Æ¬µÄ
sdkÒÆÖ²µ½ÏÖÓÐǶÈëʽ
linuxϵͳÖУ¬Ê¹µÃÒÔºóÄÜͨ¹ýÉϲ㺯ÊýÔÚ¶Ô½»»»Ð¾Æ¬½øÐÐÅäÖòÙ×÷£¨Èç
lanÅäÖã©¡£
 




ÒÑÖªÌõ¼þ£º
*Óн»»»Ð¾Æ¬µÄÎĵµ
,sdkÔ´Âë
,Àý×Ó
,ÎÞÕë¶ÔÏÖÓÐϵͳµÄÖ±½Ó½â¾ö·½°¸
.
 








ʵÏÖ·½·¨¸ÅÊö£º
* ±àÒë ......

VirtualBox Windows ºÍLinux ¹²ÏíÎļþ

1.Windows Ï´ò¿ªvirtualBox £¬Æô¶¯ÐéÄâ»ú¡£ÔÚÐéÄâ»ú´°¿ÚÉÏÑ¡Ôñ É豸 ->·ÖÅäÊý¾Ý¿Õ¼ä
2.Ñ¡ÔñWindowsÏÂÄãÏëÒª¹²ÏíµÄÎļþ¼Ð ÈçH:share , Ìí¼Ó¹Ì¶¨Êý¾Ý·ÖÅä¿Õ¼ä ,·ÖÅä¸÷Ãû×ÖÈ磺VMshare
3.ÔÚÐéÄâ»úlinuxÖն˹ÒÆð¸Õ·ÖÅäµÄÊý¾Ý¿Õ¼ä£¬
   sudo monut -t vboxsf VMshare /home/plus/share #ÆäÖÐ/home/plus/shareÊÇ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ