Sockets : recv'ing from a non-blocking socket returns WSAEWOULDBLOCK

Started by
1 comment, last by gimp 21 years, 11 months ago
Is this normal or have I incorrectly setup my non-blocking options? Some of my dodgy code:
  
	SOCKET Socket = (SOCKET)a_Client->Socket;
	u_long Ready;
	int BytesQueued = ioctlsocket(Socket, FIONREAD, &Ready);

	a_Client->Recieve.reserve(BytesQueued+1);
	int BytesRecieved = recv(Socket, (char*)(&a_Client->Recieve.front()), BytesQueued+1, 0);
	if (BytesRecieved == INVALID_SOCKET)
	{
  
Chris Brodie http:\\fourth.flipcode.com
Chris Brodie
Advertisement
That is exactly what a non-blocking socket should do if there is no data to receive.
Cool, thanks.
Chris Brodie

This topic is closed to new replies.

Advertisement