自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(4)
  • 收藏
  • 关注

原创 非阻塞套接字和epoll

要求:1、从配置文件中读取数据;2、编写可滚动的日志文件;3、实现非阻塞套接字,应用epoll;4、实现心跳检测(心跳包);5、分线程处理 client.c    客户机程序#include "head.h"#include "config.h"#include "heart_client.h"#define BUFFER_SIZE 40int main(i

2016-07-22 17:56:01 1245 1

原创 socket实现通讯a+b(包的完整性检测)

把数据放到一个字符串中,然后将字符串传到server,server端通过检测判断字符串,看其是否包含有两个数字,若没有关闭client,否则输出两个数的和server.c#include#include#include#include#include#include#includeint main(){ int server_sockfd,client_sockfd;

2016-07-22 17:31:53 1320

原创 通过域名获得主机ip

通过域名获得主机IP地址:#include #include #include #include #include #include int main(int argc,char **argv){ struct hostent *hent; int i; hent = gethostbyname("baidu.com"); printf("host

2016-07-22 14:57:10 365

原创 利用socket实现通讯

利用套接字(socket)实现通讯,client发送两个数,server接收并返回这两个数的和server.c#include#include#include#include#include#includeint main(){ int server_sockfd,client_sockfd; int server_len,client_len; struct sock

2016-07-22 14:24:23 379

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除