save send
来源:互联网 发布:php微信扫码登录源码 编辑:程序博客网 时间:2024/05/16 18:51
int DataSend(SOCKET s, char *DataBuf, int DataLen)
{
if (DataLen <= 0 || DataBuf == NULL)
{
printf("Sending data must not be null!\n");
return 0;
}
int nBytesLeft = DataLen;
int nBytesSent = 0;
int ret;
//set socket to blocking mode
//int iMode = 0;
//ioctlsocket(s, FIONBIO, (u_long FAR*) &iMode);
int iFlags;
int iRtn;
iFlags = fcntl(s, F_GETFL);
iFlags &= ~O_NONBLOCK;
fcntl(s, F_SETFL, iFlags);
while(nBytesLeft > 0)
{
ret = send(s, DataBuf + nBytesSent, nBytesLeft, 0);
if(ret <= 0)
{
printf("Sending data failed!\n");
break;
}
nBytesSent += ret;
nBytesLeft -= ret;
}
return nBytesSent;
}
- save send
- save
- Save
- save
- save
- save+
- save
- save
- save
- save
- save
- save
- save
- save
- save
- save
- Save an XML File to Database and Send an Email using XSLT
- send
- Oracle AWR 介绍
- mac下怎么锁屏
- 模拟RFT录制功能,生成自定义脚本
- 操作系统习题解答
- Oracle中使用fetch bulk collect into批量效率的读取
- save send
- 程序员面试题精选100题(12)-从上往下遍历二元树
- Oracle 表空间基本操作
- 通用对话框
- js返回页面的代码
- Windows Oracle 10G手工创建数据库
- 文件夹选择
- memcpy与memmove区别
- 购物网第二阶段总结笔记4:用户登陆跳转