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

linuxÏÂtcp·þÎñÆ÷Ô´ÂëʾÀý

#include <errno.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <stdlib.h>
#include <string.h>
#include <netinet/in.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
struct _NSS_HEADER
{
unsigned short ProtocolVersion; /* ЭÒé°æ±¾ÐÅÏ¢ */
unsigned short MsgType; /* ÏûÏ¢ÀàÐÍ */
unsigned short TransactionNo; /* ´«Êä±àºÅ */
unsigned short PacketLength; /* Êý¾Ý°ü³¤¶È,°üÀ¨Header */
}NSS_HEADER;
void str_echo(int sockfd)
{
ssize_t readLen;
ssize_t writeLen;
char buf[8];
while ( true )
{
readLen = read(sockfd, buf, 8);
if (readLen < 0 && errno == EINTR)
{
continue;
}
else if ( readLen <= 0 )
{
perror( "read:");
return ;
}
printf( "recv data successed. data len: %d\n", readLen );
int nWriteLen = 0;
while ( true )
{
writeLen == write(sockfd, &buf[nWriteLen], readLen-nWriteLen);
if (writeLen < 0 && errno == EINTR)
{
continue;
}
else if ( writeLen < 0 )
{
perror ( "write:" );
return;
}
nWriteLen += writeLen;
// ÒÑдÍֱ꣬½Ó·µ»Ø
if (nWriteLen >= readLen )
{
break;
}
}
printf( "send data successed. data len: %d\n", readLen );
}
}
int main(int argc, char **argv)
{
printf( "server ip: %s\n", argv[1] );
printf( "server port: %s\n", argv[2] );
printf( "\nservice starting ... \n\n" );
int listenfd, connfd;
pid_t childpid;
socklen_t clilen;
struct sockadd


Ïà¹ØÎĵµ£º

ʵս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 Bluetooth±à³Ì (Æß) SDPЭÒé

Service Discovery Protocol(SDP)ÌṩһÖÖÄÜÁ¦£¬ÈÃÓ¦ÓóÌÐòÓз½·¨·¢ÏÖÄÄÖÖ·þÎñ¿ÉÓÃÒÔ¼°ÕâÖÖ·þÎñµÄÌØÐÔ¡£
·þÎñ·¢ÏÖЭÒé(SDP»òBluetooth SDP)ÔÚÀ¶ÑÀЭÒéÕ»ÖжÔÀ¶ÑÀ»·¾³ÖеÄÓ¦ÓóÌÐòÓÐÌØÊâµÄº¬Ò⣬·¢ÏÖÄĸö·þÎñÊÇ¿ÉÓõĺÍÈ·¶¨ÕâЩ¿ÉÓ÷þÎñµÄÌØÕ÷¡£SDP¶¨ÒåÁËbluetooth client·¢ÏÖ¿ÉÓÃbluetooth server·þÎñºÍËüÃǵÄÌØÕ÷µÄ·½·¨¡£ ......

LinuxÏÂÅäÖð²×°NFS

LinuxÏÂÅäÖð²×°NFS
http://blog.chinaunix.net/u1/34252/showart_264236.html
1.1NFS¸ÅÊö
NFS(Network File System)ÊÇÒ»ÖÖ·Ö²¼Ê½Îļþϵͳ£¬ÔÊÐíÍøÂçÖеݲװ²»Í¬²Ù×÷ϵͳµÄ¼ÆËã»ú¼ä¹²ÏíÎļþºÍÍâÉ裬ËùÒÔËüµÄͨѶЭ¶¨Éè¼ÆÓëÖ÷»ú¼°×÷ҵϵͳÎÞ¹Ø. ËüÊÇÓÉSUN¹«Ë¾ÓÚ1984ÄêÍÆ³ö£¬Ê¹µÃ¿ÉÒÔ±¾µØ»úÒ»ÑùµÄʹÓÃÁíһ̨ÁªÍø¼ÆËã»úµÄÎ ......

linuxÈí¼þ¿ª·¢¹¤³Ìʦ½Ì³Ì

»áÔ±ÏÂÔØ£º­
­
http://vipdown.3800hk.com/jiaocheng/linux/linux/@LinkGate@12403487266409x1196776239x12403488007143-5740071909166dc778c8b9deb5c6b4cc@LK@/01.rar­
­
http://vipdown.3800hk.com/jiaocheng/linux/linux/@LinkGate@12403487266409x1196776239x12403488007143-177072d80fd416c4134c7 ......

Linux²é¿´Îļþ¼Ð´óСµÄÃüÁî

[root@ns1 opt]#  du -h -s /* | sort
12K     /mnt
13M     /sbin
16K     /lost+found
1.8G    /usr
194M    /root
22G     /opt
24K     /tmp
4.0K&n ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ