send函数用错了,MSG_OOB标志是用于带外数据,你应该使用0。
接受直接用recv
接受直接用recv
解决方案 »
- 什么垃圾MFC 去他妈的吧
- Settimer,两个事件会同时触发吗?
- 控制台程序,StartDoc,StartPage的HDC参数应该从哪里得来?
- 急!!!!!!!!OCX控件释放
- 问题
- 我用atl写了一个exe,一旦在CExeModule类中加一个CComPtr<IMyInterface>成员变量,Win32 Release MinSize版本就不能生成,我知道需要去掉_
- 如何实现象vb中的对对象的属性进行操作?
- 我声明一个变量 "MMRESULT m_rstTimerID;" 为何总提示错误?
- 50分一个小问题:编译程序出现如下错误,怎么办?
- 急急急!!!MFC编辑框无法擦除!所有方法都试过了!
- 有没有类似VB中FormatNumber的函数?
- 求救:CTime能否得到毫秒数???
{
send(pSock,"aaaaaaaaa",20,MSG_OOB); //怎么这句话不行啊??
...........
谢谢
还有:DECnet supports the sending and receiving of out-of-band data via the MSG_OOB flag for recv and send. If a send with the MSG_OOB flag is sent, the recv must be posted with MSG_OOB in order to read the data. To check for the presence of out-of-band data, use select with exceptfds set, or a WSAAsyncSelect with FD_OOB set.
而且简单的程序,没必要用MSG_OOB
我也是这样做的亚
void CSocket_ServerDlg::OnAccept(SOCKET pSock)
{
send(pSock,"Sadfsadfasdf",20,0);
sockets.AddTail(pSock);
int len = sizeof(sockaddr);
sockaddr_in clientaddr;
SOCKET clientSocket = accept(serverSocket,(struct sockaddr*) lientaddr, &len);
send(clientSocket,"Sadfsadfasdf",20,0);
}
sockets.AddTail(pSock);
int len = sizeof(sockaddr);
什么意思