Jump to content

  • Log In with Google      Sign In   
  • Create Account


Does CAsyncSocket::Receive return a NULL terminated buffer? <mt>


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 DrJohnB   Members   -  Reputation: 122

Like
Likes
Like

Posted 17 February 2000 - 05:13 AM

Does CAsyncSocket::Receive -------------------------- virtual int Receive( void* lpBuf, int nBufLen, int nFlags = 0 ); return a NULL terminated buffer? I want to know the length of the buffer I just received.

Sponsor:

#2 SiCrane   Moderators   -  Reputation: 9550

Like
Likes
Like

Posted 17 February 2000 - 05:50 AM

I don''t believe that it''s null terminated, but the return value should be the number of bytes received. Unless the connection closed (it returns 0) or there was an error (it returns SOCKET_ERROR).

#3 DrJohnB   Members   -  Reputation: 122

Like
Likes
Like

Posted 17 February 2000 - 06:21 AM

How did you know that''s what I wanted. Anyway I just noticed it had a non-void return type. However, that was after finished adding code to ::Send() to prefix my string with 3 chars representing the length of the rest of the string.

I knew ::Receive() had to know the length because you include it in the ::Send() call. You''re so fast with your help. Thank Si.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS