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

Linux UDP¼òµ¥·â×°


//CUdp.h
#ifndef MY_CUDP
#define MY_CUDP
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <unistd.h>
class CUdp{
public:
CUdp(const char* destIP, unsigned short localPort, unsigned short destPort);
CUdp(unsigned int destIP, unsigned short localPort, unsigned short destPort);
int sendData(void *data, unsigned int length);
int recvData(void *data, unsigned int length,unsigned int &inIP,unsigned short& inPort);
~CUdp(){close(sock_fd);}
private:
int sock_fd;
struct sockaddr_in local_addr;
struct sockaddr_in dest_addr;
};
#endif
//CUdp.cpp
#include "CUdp.h"
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <errno.h>
#include <assert.h>
#include <arpa/inet.h>

CUdp::CUdp(unsigned int destIP,unsigned short localPort, unsigned short destPort)
{
memset(&local_addr,0,sizeof(local_addr));
local_addr.sin_family = AF_INET;
local_addr.sin_addr.s_addr = htonl(INADDR_ANY);
local_addr.sin_port = htons(localPort);

memset(&dest_addr, 0, sizeof(dest_addr));
/* ЭÒéµØÖ·×é°ü */
dest_addr.sin_family = AF_INET; /* ЭÒéÃû */
dest_addr.sin_addr.s_addr = htonl(destIP); /* ×Ô¶¯·ÖÅäµØÖ· */
dest_addr.sin_port = htons(destPort); /* ¶Ë¿ÚºÅ */
/* ×éװϵͳµ÷ÓÃsocketºÍbind */

if((sock_fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0)
{
perror(strerror(errno));
exit(0);
}
/* ´´½¨UDPÌ×½Ó×ÖÃèÊö·û */
if(bind(sock_fd, (struct sockaddr *)&local_addr, sizeof(local_addr)) < 0 ) /* ÃüÃûÌ×½Ó×Ö */
{
perror(strerror(errno));
exit(0);
} // return 0; /* ×¼±¸³É¹¦£¬ÕýÈ··µ»Ø */
//assert(close(*pnSock) == 0); /* ×¼±¸Ê§°Ü£¬¹Ø±ÕÌ×½Ó×ÖÃèÊö·û */
//return 1;
}

CUdp::CUdp(const char* destIP, unsigned short localPort, unsigned short destPort)
{
memset(&local_addr,0,sizeof(local_addr));
local_addr.sin_fami


Ïà¹ØÎĵµ£º

ʵս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 ......

µÚ3Õ Linux»ù±¾ÅäÖÃ

µÚ3Õ  Linux»ù±¾ÅäÖÃ
°²×°Íê²Ù×÷ϵͳºó£¬³£³£ÐèÒª×öһЩ»ù±¾ÅäÖã¬ÒÔÂú×ã×Ô¼ºµÄÐèÇó¡£Ëæ×ÅLinux×ÀÃæµÄÈÕÇ÷³ÉÊìºÍÈËÐÔ»¯£¬ÕâÖÖËùνµÄ“»ù±¾ÅäÖÔÒѾ­Ô½À´Ô½ÉÙÁË¡£±¾ÕÂÑ¡ÔñÁËÈëÃÅÓû§×î³£Îʵ½µÄһЩÎÊÌ⣬ÒÔ±ã¶ÁÕßÄܹ»¾¡¿ìÉÏÊÖ¡£ ......

Linux ѧϰ²½Öè

1.ÊÖÍ·ÓÐÒ»±¾ºÃµÄÈëÃŽ̲Ä
  ÂòÄÇЩһ¿ªÊ¼¾Í´Óϵͳ»ù±¾»ú¹¹»ù±¾ÃüÁʼ½²½âµÄÊé¼®£¬Ò»¿ªÊ¼ÄãҪѡ¶¨Ò»±¾ÈëÃŽ̲Ä,µ«ÊDz»ÄÜÖ»¿´Ò»±¾,ÒòΪÓÐЩÊéÉϽ²µÄ,¿ÉÄÜÊÇÁíÍâµÄÊéÉÏûÓеÄ.Òò´Ë,ÖصãÑ¡Ò»±¾½Ì²Ä¿´Íê.È»ºóÔÙ¿´Á½Èý±¾ÈëÃŽ̲Ää¯ÀÀÒ»ÏÂ.×÷Ϊ¶ÔµÚÒ»±¾ÊéµÄ֪ʶµÄÀ©³äºÍ¹®¹Ì¡£
 
2.¿´Íêϵͳ×Ô´øµÄÎĵµ
  ¾ø´ ......

linux framebuffer ѧϰ±Ê¼Ç¶þ£¨³ÌÐòÓÃÀý£©

1 ³ÌÐòÁ÷³Ìͼ¡£
2  sampleÀý×Ó
HI_S32 TDE_DrawGraphicSample()
{
    HI_U32 u32Size;
    HI_S32 s32Fd;
    HI_U32 u32Times;
    HI_U8* pu8Screen;
    HI_U32 u32PhyAddr;
    HI_S32 s32Ret = -1;
  ......

linux ÏÂ mysql °²×°

linux
mysql
°²×°½éÉÜ:
linux
·þÎñÆ÷ RedHat 5.0.server.
MySQL
°æ±¾:
ÏÂÔصØÖ·Á´½Ó:http://dev.mysql
.com/downloads/mysql
/5.1.html 
MySQL
·þÎñ¶Ë:MySQL
-server-community-5.1.38-0.rhel5.i386.rpm
MySQL
¿Í»§¶Ë:MySQL
-client-community-5.1.38-0.rhel5.i386.rpm
1 °²×°²½ÖèÊ×ÏȼÓÔعâÇý ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ