|
-
Jul 19th, 2009, 05:40 PM
#2
Re: File Transfer
It is important to z that you aren't working directly with packets when using TCP/IP.
You should think of the connection as a pipeline between two hosts through which data streams in both directions, forget about packets and all that. Because when you send data from your application, the TCP and IP protocols will create packets and segments as they see fit, and one "send call" does not equal to one sent packet... nor does one "receive call" receive one packet...it will return everything that has arrived since the last time it checked for data...which explains the "packet appending" thing you describe.
So does this Winsock component not provide a method for sending byte data? Only strings? This is one of the downsides to using the Winsock component in .NET applications, you can not adjust it to your needs, but must figure out dodgy work-arounds because of it. If you have the possibility to do so, I would strongly advice you to use the native .NET classes TcpClient/TcpListener. However if not, we'll just have to figure out a dodgy workaround 
So you're saying that if you try to send the entire picture (as a string), and then convert it back to bytes on the receiving end, it will not contain all the bytes?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|