1

How do I stop VB6 Winsock from sending an end of stream byte? It sends a 0 after each message, and it is messing with my code.

LunchMarble
  • 5,079
  • 9
  • 64
  • 94
  • Can you just ignore the zero? If it sends one every time just ignore the last byte in the stream. – Jesus Ramos Oct 26 '11 at 02:23
  • 4
    Something fishy here. First Winsock does not support "messages" in TCP (you did say "stream"), second I have never seen any "end of stream" 0 bytes. Sounds like a logic error in your code. – Bob77 Oct 26 '11 at 02:26
  • @BobRiemersma: You're absolutely right, if you post this as an answer I'd be glad to mark you. I allocated 1 byte more than I was using. I sent 23 instead of 22. – LunchMarble Oct 26 '11 at 15:57
  • 1
    Thanks for the thought, but go ahead and give credit to the answer below. – Bob77 Oct 27 '11 at 14:16

1 Answers1

3

The only bytes you receive are the ones that are sent. TCP/IP will not add extra bytes. Additionally, in TCP/IP, the "end of the stream" is not the same as the end of a message. The stream never ends unless the connection is broken.

If you can post some code, we can get to the bottom on the problem.

tcarvin
  • 10,715
  • 3
  • 31
  • 52