[ create a new paste ] login | about

Link: http://codepad.org/4ZmoP4K5    [ raw code | fork ]

C++, pasted on Jun 17:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Inc::STATS CConnection::_RecvData(sockaddr* addr, std::string &strData)
{
	int ret, len, fromlen;		//return code / length of the data / sizeof(sockaddr)
	char *buffer;		//will hold the data
	char c;

	//recv length of the message
	fromlen = sizeof(sockaddr);
	ret = recvfrom(m_InSock, &c, 1, 0, addr, &fromlen);
	if(ret != 1)
	{
#ifdef __MYDEBUG__
		std::stringstream ss;
		ss << WSAGetLastError();
		MessageBox(NULL, ss.str().c_str(), "", MB_ICONERROR | MB_OK);
#endif
		return Inc::ERECV;
	}


Create a new paste based on this one


Comments: