搜索资源列表
一个判断远程主机存活程序代码
- 一个判断远程主机存活程序代码(ping) #include #include #include #include #include "winsock.h" #pragma comment(lib,"Ws2_32"); #define SEND_SIZE 32 #define PACKET_SIZE 4096 #define ICMP_ECHO 8 #define ICMP_ECHOREPLY 0 struct icmp {
gateway
- 用c++编写的网络通信框架,适用于多客户端的网络通信 client: 模拟客户端程序 server: 模拟服务端程序 gateway:网关程序 启动:client.exe server.exe gateway.exe程序,client程序会网关gateway.exe发送消息 消息内容为字符:00004XXXX XXXX为字符,是使用 04d打印到BUF中的, gateway.exe收到client.exe发送的消息,此时从系统路由表中取到:B_HOST的信息,并把
socket
- tcp udp 网络编程源码 //创建套接字 sHost = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP) if(INVALID_SOCKET == sHost) { printf("socket failed!\n") WSACleanup() //释放套接字资源 return -1 } //设置服务器地址 servAddr.sin_family =AF_INET servA
daima
- client创建udp原始套接字,将数据存入buf中,进行网络的捕包,从中过滤识别出80端口的包,打印出五元组的信息。server端开启守护进程,接受前端发送的信息,并将其保存到文件中。-create udp raw socket client, the data stored in buf, make the network packet capture, filter identified 80 ports from which the package, print out the five
linux-c-data-trans-on-web
- Linux网络编程用户数据报发送~sockfd,buf,len的意义和read,write一样,分别表示套接字描述符,发送或接收的缓冲区及大小. recvfrom负责从 sockfd接收数据,如果from不是NULL,那么在from里面存储了信息来源的情况,如果对信息的来源不感兴趣, 可以将from和fromlen 设置为NULL.sendto负责向to发送信息.此时在to里面存储了收信息方的详细资料. ~-Data transfering on web
80
- 最简单的 http服务 int Send(SOCKET s,const char *buf,int len) { _ASSERTE(len > 0) int tmp_len int total_send=0 do { tmp_len = send(s,buf,len,0) if(tmp_len == -1) break len -= tmp_len buf += tmp_len
Linux_yonghu_shuju_fasong
- Linux网络编程用户数据报发送,sockfd,buf,len的意义和read,write一样,分别表示套接字描述符,发送或接收的缓冲区及大小. recvfrom负责从 sockfd接收数据,如果from不是NULL,那么在from里面存储了信息来源的情况,如果对信息的来源不感兴趣, 可以将from和fromlen 设置为NULL.sendto负责向to发送信息.此时在to里面存储了收信息方的详细资料. -Linux network programming user datagra
16-UdpSendBuf
- UDP发送BUF的完整程序,自己一直在用,适合新手学习用。-UDP BUF to send the complete program, he has been in use, suitable for novice learning to use.
work1.tar
- 实现一个简易的printf函数,系统调用write的调用格式为size_t write (int fd,const void * buf,size_t count),将读取buf中字长为count的数据进入到文件描述符为fd的文件中-Achieve a simple printf function, call the system call write format size_t write (int fd, const void* buf, size_t count), will read t
ftp-source
- or (int i = 0 i < len && partCount <= 6 i++) { char ch = Char.Parse(ipData.Substring(i,1)) if (Char.IsDigit(ch)) buf+=ch else if (ch != , ) { throw new IOException("Malformed PASV strReply: " + strReply) } if (c
3_read
- #include shm.h int main(int argc,char *argv[]) { key_t key int shm_id char *buf //鑾峰緱key if((key = ftok( ./ ,0xa)) < 0){ perror( ftok ) exit(1) } //鑾峰緱鍏变韩鍐呭瓨 if((shm_id = shmget(key,SHM_SIZE,IP
uart_print
- void uart_init():uart初始化配置,配置相应IO口状态、奇偶校验选择以及波特率等参数。 unsigned char uart_max_data_get(unsigned char *buf) :通过协议计算等获取串口通讯的最大数据长度,用于判断这一帧数据接收完全 unsigned char uart_recive(unsigned char *buf):串口接收函数,接收到的数据存储在buf中。