kodr
Programmer
- Dec 4, 2003
- 368
I've searched every way I can think of, and I'm down to 2 questions...
I'm implementing a client/server application that needs to send small packets of data back and forth. I'm using TCP, and everything is working okay, except for the issue of sending data.
From what I can tell, when you use winsock.senddata, the data is actually going to a buffer somewhere in the windows world and is sent by the underlaying programs/process/whatever that drives windows TCP connections, and is not actually handled by your program. I'm cool with that.
What I'm doing is to gather all related data in one string, transmit it, and i'm done with it. The recieving side see's the data come in as a 'packet' and processes it fine.
What is the (or is there) default size for the senddata buffer? If I decide to send a large chunk of data to the recieving end, how large can it be before it gets broken down into seperate 'packets'?
The reason I ask that is my client app needs a prefix code telling it what type of message/action is occuring, and if a chunk of data gets split, I need to ensure the follow on chunk gets the prefix code also.
The second question is, if I have a large string, what is a simple way of telling how large it is, so I can compare it to the buffer size I have remaining?
Thanks in advanced.
I'm implementing a client/server application that needs to send small packets of data back and forth. I'm using TCP, and everything is working okay, except for the issue of sending data.
From what I can tell, when you use winsock.senddata, the data is actually going to a buffer somewhere in the windows world and is sent by the underlaying programs/process/whatever that drives windows TCP connections, and is not actually handled by your program. I'm cool with that.
What I'm doing is to gather all related data in one string, transmit it, and i'm done with it. The recieving side see's the data come in as a 'packet' and processes it fine.
What is the (or is there) default size for the senddata buffer? If I decide to send a large chunk of data to the recieving end, how large can it be before it gets broken down into seperate 'packets'?
The reason I ask that is my client app needs a prefix code telling it what type of message/action is occuring, and if a chunk of data gets split, I need to ensure the follow on chunk gets the prefix code also.
The second question is, if I have a large string, what is a simple way of telling how large it is, so I can compare it to the buffer size I have remaining?
Thanks in advanced.