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

linuxÏÂIP v6 tcp¿Í»§¶ËÔ´ÂëʾÀý

/***********************************
*
*client.c
*
**********************************/

#include<stdio.h>
#include<stdlib.h>
#include<errno.h>
#include<string.h>
#include<sys/types.h>
#include<netinet/in.h>
#include<sys/socket.h>
#include<sys/wait.h>
#include<unistd.h>
#include<arpa/inet.h>
#include<resolv.h>

#define MAXSIZE 1024
//**************main()**************
int main(int argc,char *argv[])
{
int sockfd;
int n;
char recv_buf[MAXSIZE+1];
char send_buf[MAXSIZE+1];
struct timeval tv;
fd_set readfd;

// ²ÎÊýÅжÏ
if ( argc != 3 )
{
printf("USAGE: %s [serv_address][serv_port]\n", argv[0]);
exit(1);
}

// ´´½¨IPV6Ð͵Äsocket
if ( (sockfd = socket(PF_INET6, SOCK_STREAM, 0)) < 0 )
{
perror("socket");
exit(1);
}

// ת»»·þÎñÆ÷IPµØÖ·
struct sockaddr_in6 serv_addr;
bzero(&serv_addr,sizeof(serv_addr));
serv_addr.sin6_family = AF_INET6;
serv_addr.sin6_port = htons( atoi(argv[2]) );
if ( inet_pton(AF_INET6, argv[1], &serv_addr.sin6_addr ) < 0 )
{
perror(argv[1]);
exit(1);
}

// Óë·þÎñÆ÷½¨Á¢Á¬½Ó
if ( connect(sockfd,(struct sockaddr *)&serv_addr,sizeof(serv_addr) ) < 0 )
{
perror("connect");
exit(1);
}
printf("Connected to server\n");
while (1)
{
//----------set last time---------
tv.tv_sec=600;
tv.tv_usec=0;

FD_ZERO(&readfd);
// ½«±ê×¼ÊäÈëºÍÓë·þÎñÁ¬½ÓµÄÎļþ¾ä±ú¶Áʼþ¼ÓÈëSET
FD_SET(0,&readfd);
FD_SET(sockfd,&readfd);

// ¼ì²éÊÇ·ñÓÐ


Ïà¹ØÎĵµ£º

ʵս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 Ï ½«PDFÎļþÖеÄÎı¾£¬Í¼Æ¬µ¼³öµÄ·½·¨¡£


PDF¸ñʽÎļþÖеÄÎı¾ÊÇ¿ÉÒÔµ¼³öÀ´ÔÙÐ޸ĵġ£
ͬÑù£¬PDFÀïÃæµÄ²åͼҲÊÇ¿ÉÒÔÌáÈ¡³öÀ´µÄ¡£
PDFת´¿Îı¾£º
pdftotext -enc GBK godson2e-data.Sheet.pdf text.GBK.txt
-enc (encoding)
Òª²ÎÕÕ/etc/xpdf/xpdfrc ÀïÃæÌáµ½µÄ±àÂë¸ñʽ¡£¶ÔÓÚÖÐÎÄ£¬ÓÃGBK
¾Í¿ÉÒÔÁË¡£
ÌáÈ¡²åͼ£º
pdfimages godson2e-data.Sheet.pdf img
¸Ã ......

Linux ÄÚºËÖÐµÄ GCC ÌØÐÔ(ת£©


Linux ÄÚºËÖÐµÄ GCC ÌØÐÔ(ת£©
Á˽âÓÃÓÚ C ÓïÑ﵀ GCC À©Õ¹
ÎĵµÑ¡Ïî
<tr
valign="top"><td width="8"><img alt="" height="1" width="8"
src="//www.ibm.com/i/c.gif"/></td><td width="16"><img alt=&qu ......

ÐÞ¸ÄlinuxÆô¶¯²ÎÊýÍì»Ø/etc/inittabÎļþ

×î½ü×ölinuxϵͳ²Ã¼ô£¬ÐÞ¸ÄǶÈëʽϵͳµÄinittabÎļþʱÎ󽫱¾»úinittabÎļþÐ޸ġ£
rebootºó³öÏÖ
INIT: /etc/inittab[2]: missing id field
INIT: /etc/inittab[3]: missing id field.
Enterrunlevel:
ÊäÈë3,»ò1£¬»òsinggleºó³öÏÖ
INIT: no more processess left in this runlevel
ϵͳֹͣ¡£
google£¬baiduµ½Ò»ÆªÒý ......

½éÉÜLinuxϾ­µäµÄÎļþ´«Ê乤¾ß: lrzsz


¹«Ë¾ÓиöÓÃARM940T×öµÄÊÖ³Öʽ²úÆ·£¬ÎÒÃÇÒÆÖ²ÁËÒ»¸öuClinuxÉÏÈ¥£¬ÏµÍ³»¹ÊÇÔËÐв»´íµÄ¡£
ÒòΪûÓдøÍø¿Ú£¬Ö»ÓÐUSBת´®¿Ú¿ÉÒÔʹÓã¬ËùÒÔÏëÑ°ÕÒÒ»¸öÎȶ¨µÄ´«Êä;¾¶£¬ÔÚhostºÍdeviceÖ®¼ä½»»»Îļþ¡£ÎÊÁ˺ܶàÈ˶¼²»Çå³þ£¬»¹ÊÇÒª¿¿×Ô¼ºÕÒ½â¾ö·½·¨¡£
ÔÚgoogleÉÏÕÒÁË°ëÌ죬ÖÕÓÚÕÒµ½ÁËÒ»¸ö¿ÉÒÔͨ¹ý´®¿Ú´«ËÍÎļþµÄÈí¼þ£¬Õâ¾ÍÊǹŶ­¼ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ