Hey...
I am staritng winsock and creating a udp socket the usual way and anythig is finde (sendto works fine, too)...
But when trying to recvfrom(), I get the WSAEINVAL (10022) error and donĀ“t know why...
I checked my parameters and they are passed correctly...
1 2 3 4 5 6 7 8 9 10 11
|
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)
{...
|
m_InSock is the created socket,
fromlen should work, too,
c, too,
and addr is passed ( it is alive and not destroyed due to some block/-scope stuff...
So I am wondering, because the WSAEINVAL can also mean, that You need to bind a socket...
But that would be lame on the client -.-'...
Any suggestions/clues/etc?...