Socket Send Receive 问题
CSocket Send代码:
UpdateData();//从编辑框获取数据m_str
int ilen = m_str.GetLength();
int nLen = m_socketCon.Send(m_strMsg,iLen);
if(nLen != SOCKET_ERROR)
{
//Do some UI Work
}
CSocket Receive代码
TCHAR buff[4096];
int nRead;
nRead = m_socketCon.Receive(buff, 4096);
if(nRead != SOCKET_ERROR)
{
buff[nRead] = NULL; //terminate the string
CString strTemp(buff);
// DO SOME UI Work
}
想问为什么环境在Use Multi-Byte Character Set下就能正确接收,但是在Use Unicode Character Set下会出现接收不正确情况。想问下此时应该怎么接收