in reply to How to end socket file transfer without closing socket
You need to expand you protocol. Here are some ideas based on existing protocols:
| HTTP | The size of the body ("Content-Length") is transmitted before the body itself, so the receiver knows when to stop listening for the body and start listening for another request or response. Pro: Trivial to implement.
|
| FTP | A command connecion is maintained. Commands are exchanged to create new connections over which data is transfered. Pro: Handles errors easily.
|
| SLIP | Packets are terminated with a special character ("\0300") that is not allowed to exist anywhere else in the stream. An encoding mechanism is provided to transmit these special characters as data ("\0300" is encoded as "\0333\0334" and "\0333" is encoded as "\0333\0335"). Pro: Easy to implement.
|
Update: Added pros and cons.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to end socket file transfer without closing socket (MIME)
by tye (Sage) on Oct 23, 2007 at 17:18 UTC | |
|
Re^2: How to end socket file transfer without closing socket
by redss (Monk) on Oct 23, 2007 at 17:13 UTC | |
by ikegami (Patriarch) on Oct 23, 2007 at 17:32 UTC | |
by tye (Sage) on Oct 23, 2007 at 17:34 UTC | |
by xiaoyafeng (Deacon) on Oct 23, 2007 at 23:33 UTC | |
by tye (Sage) on Oct 24, 2007 at 00:12 UTC | |
by xiaoyafeng (Deacon) on Oct 24, 2007 at 01:27 UTC |