在做一个聊天小程序,有客户端和服务器端,要求使用多线程的,请问一下,多线程要用在什么地方比较适当,能大大提高效率?还有,就是看了WSASend()之类的2.0的新函数,其中很多是有一个参数,像WSASend()的第二个参数,允许有多个buffer指针,不过我看不大懂如何用,一个参数如何使用多个buffer指针?
解决方案 »
- MFC 对话框 滚动条
- 如何利用IHTMLDocument2获取<object classid=...>***</object>中的数据?
- 高分请教: 怎样通过modem播放语音文件
- 重金酬谢 为什么不行!!!!!!!!!!!
- 给CSDN管理者的一个建议.
- 怎么在接口间传递事件
- 获取process的Path Name的问题
- 像IE或者OFFICE WORD/EXCEL等程序是怎么做到自动化的?
- MSDN的VC部分有没有中文版啊?
- InstallShield中怎么把可执行文件加到开始菜单上?如果回答正确80分全部奉上!
- 如何在windows下获得我的电脑的序列号?
- MSCOMM32.OCX的运行环境?
char SendBuf[1024] = "Test data to send.";
int BufLen = 1024;...DataBuf.len = BufLen;
DataBuf.buf = SendBuf;...WSASend(SendSocket,
&DataBuf,
1,
&BytesSent,
Flags,
(SOCKADDR*) &RecvAddr,
RecvAddrSize,
&Overlapped,
NULL);
MSDN的描述如下:
lpBuffers
[in] Pointer to an array of WSABUF structures. Each WSABUF structure contains a pointer to a buffer and the length of the buffer, in bytes. This array must remain valid for the duration of the send operation.此处的Each不是指的允许有多个buffer指针.