Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

out of band and socket

Name: Anonymous 2014-02-15 7:27

what's the best practice for out of band communication over sockets
should you make another meta socket
or embed the out of band information into the main socket
a possible use case would be, someone is downloading a 1GB file
but after 30 minutes the client needs to stop the download
or after 30 minutes the server stops the download
I want to minimize overhead
I'd also rather not introduce escape sequences into the binary stream
but keeping it to a single socket might be useful

Name: Anonymous 2014-02-15 12:47

Use packet flags in TCP, you can use MSG_OOB to trigger signals:

http://blogger.popcnt.org/2007/07/what-happened-to-tcp-flag-urgent-msgoob.html

Or just write your own wrapper that looks at the packet header. You have 1 byte of data available with plain MSG_OOB, use the SO_OOBINLINE socket option if you need more.

Name: Anonymous 2014-02-15 14:48

>>2
Thank you. I think I will try to support both in case I'm using a medium that doesn't support anything outside of a single bidirectional byte stream.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List