Jump to content

View more

Image of the Day

Inventory ! Va falloir trouver une autre couleur pour le cadre D: #AzTroScreenshot #screenshotsaturday https://t.co/PvxhGL7cOH
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

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

4: Adsense

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   

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.

#2 SiCrane   Moderators   

11763
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   

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.