Posted on 2004-10-28
Can I do the following in the Windows C++ programming :
I am sending this from Client side:
iBytesSent = sendto( socket, BufData,
20, 0, (SOCKADDR*) &service,sizeof(service) );
And receiving this at Server end....
bytesRecv = recvfrom(socket, RecData, 6,0,
(SOCKADDR*) &service, &addrLen);
What I am trying to do here is sent 20 bytes and receive 6 bytes. I am getting -1 error when I do this.
Here is the error detail by WSAGetLastError():
Message too long.
A message sent on a datagram socket was larger than the internal message buffer or some other network limit, or the buffer used to receive a datagram was smaller than the datagram itself.
It work in TCP but I need to do it in UDP. Please let me know if this is possible in UDP.