Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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±à³Ì (Æß) SDPЭÒé

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

Linux ImageMagick ת»»Í¼Æ¬¸ñʽ¹¤¾ß¼°ÃüÁî


    Ç°ÃæÔÚÒ»¸öÏîÄ¿¿ª·¢ÖÐÓõ½ÁËImageMagick£¬ÎÒÃÇ×Ô¼ºµÄ²âÊÔ»·¾³¶¼Õý³££¬È»ºó¾Í°´ÕÕÎÒÃÇ¿ª·¢»·¾³µÄ°²×°·½·¨°²×°Á˿ͻ§µÄ²âÊÔ»·¾³£¬µ«ÔÚ´¦ÀíjpegÀàÐÍͼƬµÄʱºò±¨´íÁË¡£»ØÍ·Ò»¿´ÅäÖÃlog£¬¾ÓÈ»²»Ö§³Öjpeg¡£
    ImageMagick ÊDZ任ͼƬµÄ¿âȺ£¬Ö§³Öperl£¬C++£¬JAVAµÈµÈÓïÑÔ¡£¿ÉÒ ......

linux³ÌÐòÔ±ÃæÊÔÌâÄ¿


Ò»£®Ìî¿ÕÌ⣺
1. ÔÚLinuxϵͳÖУ¬ÒÔÎļþ·½Ê½·ÃÎÊÉ豸 ¡£
2. LinuxÄÚºËÒýµ¼Ê±£¬´ÓÎļþ/etc/fstabÖжÁȡҪ¼ÓÔØµÄÎļþϵͳ¡£
3. LinuxÎļþϵͳÖÐÿ¸öÎļþÓÃi½ÚµãÀ´±êʶ¡£
4. È«²¿´ÅÅÌ¿éÓÉËĸö²¿·Ö×é³É£¬·Ö±ðΪÒýµ¼¿é ¡¢×¨ÓÃ¿é ¡¢ i½Úµã±í¿é ºÍ´æ´¢¿éÊý¾Ý¡£
5. Á´½Ó·ÖΪ£ºÓ²Á´½Ó ºÍ ·ûºÅÁ´½Ó¡£
6. ³¬¼¶¿é°üº¬ÁËi½Úµã±í ......

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µ½Ò»ÆªÒý ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ