linuxÍøÂç±à³Ì±Ê¼Ç
Ò» ÈýÖÖÀàÐ͵ÄÌ×½Ó×Ö£º
1.Á÷ʽÌ×½Ó×Ö£¨SOCKET_STREAM)
Ìá¹©ÃæÏòÁ¬½ÓµÄ¿É¿¿µÄÊý¾Ý´«Êä·þÎñ¡£Êý¾Ý±»¿´×÷ÊÇ×Ö½ÚÁ÷£¬ÎÞ³¤¶ÈÏÞÖÆ¡£ÀýÈçFTPÐÒé¾Í²ÉÓÃÕâÖÖ¡£
2.Êý¾Ý±¨Ê½Ì×½Ó×Ö£¨SOCKET_DGRAM£©
ÌṩÎÞÁ¬½ÓµÄÊý¾Ý´«Êä·þÎñ£¬²»±£Ö¤¿É¿¿ÐÔ¡£
3.ÔʼʽÌ×½Ó×Ö£¨SOCKET_RAW£©
¸Ã½Ó¿ÚÔÊÐí¶Ô½ÏµÍ²ã´ÎÐÒ飬ÈçIP£¬ICMPÖ±½Ó·ÃÎÊ¡£
¶þ »ù±¾Ì×½Ó×Öϵͳµ÷ÓÐÓÐÈçÏÂһЩ£º
´´½¨Ì×½Ó×Ö£º socket£¨£©
°ó¶¨±¾»ú¶Ë¿Ú£º bind£¨£©
½¨Á¢Á¬½Ó£º connect£¨£©£¬accept£¨£©
ÕìÌý¶Ë¿Ú£º listen£¨£©
Êý¾Ý´«Ê䣺 send£¨£©£¬ recv£¨£©
ÊäÈë/Êä³ö¶à·¸´Ó㺠select£¨£©
¹Ø±ÕÌ×½ÓÖ»£º closesocket£¨£©
Èý Êý¾ÝÀàÐÍ
struct sockaddr
{
unsigned short sa_family; //µØÖ·×壬 Ò»°ãΪAF_INET
char sa_data[14]; //14×Ö½ÚµÄÐÒ鵨ַ
}
struct sockaddr_in
{
short int sin_family; //µØÖ·×å
unsigned short int sin_port; //¶Ë¿ÚºÅ
struct in_addr in_addr; //ipµØÖ·
unsigned char sin_zero[8]; //Ìî³ä
}
ËÄ ³£Óú¯Êý
1 socket()
Í·Îļþ£º
#include <sys/types.h>
#include <sys/socket.h>
Ïà¹ØÎĵµ£º
´´½¨×ÀÃæÍ¼±ê
Ŀǰ½«ÍøÂçÓ¦ÓÃÀ©Õ¹µ½×ÀÃæÊÇÒ»¸öÇ÷ÊÆ£¬´æÔÚןܶà½â¾ö·½°¸£¬±¾ÎÄÒÔ Mozilla Prism ΪÀý£¬ÀàËÆµÄ·½·¨Í¬ÑùÊÊÓÃÓÚ Google Chrome ¡£
1. µ½ Mozilla Prism µÄÍøÕ¾ÉÏÏÂÔØ Prism£¬µã»÷ Download Now Ö®ºó»áÌáʾÓÐÁ½ÖÖ£¬Ò»ÖÖÊÇÒÔ Mozilla Firefox À©Õ¹µÄ·½Ê½£¬ÊʺÏÒѾ°²×°ÓÐ Firefox µÄÅóÓÑ£»Ò»Ö ......
±ê×¼ÐźÅÓëʵʱÐźÅ
0-31 Õâ 32 ¸öÐźųÆÎª±ê×¼Ðźš£
´Ó 32 µ½ 63 Ö®¼äµÄ 32 ¸öÐźųÆÎªÊµÊ±Ðźš£
¿ÉÒÔͨ¹ý man 7
signal ²é¿´¶Ô“±ê×¼ÐźŔºÍ“ʵʱÐźŔÏêϸµÄÃèÊö¡£
ÐźÅÅŶÓ
ÿ¸ö½ø³ÌÓµÓÐÒ»¸öÐźŵȴý¶ÓÁС£ÔÚ task_struct ÖÐÓÐÒ»¸ö struct sigpending pending Óò£¬
¾ÍÊǽø³ÌµÄÐźŠ......
statº¯Êý½²½â£¨×ª£©
±íÍ·Îļþ: #include <sys/stat.h>
#include <unistd.h>
¶¨Ò庯Êý: int stat(const char *file_name, struct stat *buf);
º¯Êý˵Ã÷: ͨ¹ýÎļþÃûfilename»ñÈ¡ÎļþÐÅÏ¢ ......
linux¹²Ïí¿âλÖÃÅäÖÃ(LD_LIBRARY_PATH»·¾³±äÁ¿ »òÕß ¸ü¸Ä/etc/ld.so.conf »òÕß Ê¹ÓÃ-RÑ¡Ïî)
2009-11-06
°æÈ¨ÉùÃ÷£º×ªÔØÊ±ÇëÒÔ³¬Á´½ÓÐÎʽ±êÃ÷ÎÄÕÂÔʼ³ö´¦ºÍ×÷ÕßÐÅÏ¢¼°±¾ÉùÃ÷
http://skatings.blogbus.com/logs/50437681.html
linux¹²Ïí¿âλÖÃÅäÖÃ(LD_LIBRARY_PATH»·¾³±äÁ¿ »òÕß ¸ü¸Ä/etc/ld.so.conf »òÕß Ê¹ÓÃ-RÑ¡Ïî) ......
µ±Á½Ì¨LINUXÖ÷»úÖ®¼äÒª»¥´«Îļþʱ¿ÉʹÓÃSCPÃüÁîÀ´ÊµÏÖ
¸´ÖÆÎļþ£º
£¨1£©½«±¾µØÎļþ¿½±´µ½Ô¶³Ì
scp ÎļþÃû --Óû§Ãû@¼ÆËã»úIP»òÕß¼ÆËã»úÃû³Æ:Ô¶³Ì·¾¶
£¨2£©´ÓÔ¶³Ì½«Îļþ¿½»Ø±¾µØ
scp --Óû§Ãû@¼ÆËã»úIP»òÕß¼ÆËã»úÃû³Æ:ÎļþÃû ±¾µØÂ·¾¶
¸´ÖÆÄ¿Â¼£º
£¨1£©½«±¾µØÄ¿Â¼¿½±´µ½Ô¶³Ì
scp -r Ŀ¼Ãû Óû§Ãû@¼Æ ......