HELP with Sockets using OOB data (Out-Of-Band)

HELP with Sockets using OOB data (Out-Of-Band)

Post by Jay Claybau » Sat, 11 Dec 1993 06:25:08

I'm attempting to send priority Out-Of-Band data on a stream socket between two
processes running under Solaris 2.2.  By calling send(sd, buf, 1, MSG_OOB), I
can successfully tag the data as OOB over the network (verified using snoop).  The
receive process sometimes receives it as OOB and sometimes as ordinary data.  When
received as OOB, the connection appears to be in a bad state thereafter since select
repeatedly returns with the exception_fds set but recv() returns -1 with errno set to
"no more processes."

If anyone knows what's going on or has an alternative method of getting high priority
data over a socket that is potentially backed up, I could use the help.

 Harris Corp., MS 5W/5837        | USENET:
 PO Box 91000, Melbourne, FL     | PHONE:  (407) 729-7492
                 32902           | FAX:    (407) 729-7273


1. Out-of-band data on sockets - how to detect "true" exceptions ?


I have a question regarding the use of "select" system call to detect
the exception condition caused by arrival of "out-of-band" data.
I am running into the following problem (item 4 below describes the
actual problem)

(1) A signal handler is associated with the SIGURG signal. Thus,
    when an out-of-band data arrives, the signal handler is called.
    The signal handler uses the "select" system call to determine
    which sockets have exception conditions. It reads an out-of-band
    byte on each socket that has the exception.
    (using recv(fd, &data, 1, MSG_OOB))
(2) process A and B both send one byte of out-of-band data
    to process C (using send(fd, &data, 1, MSG_OOB)).
(3) The out-of-band data from A arrives first and causes
    the signal handler to be called.
    The socket (say, Sa) connecting C and A is detected to have
    an exception. The signal handler reads a byte (out-of-order)
    from that socket. No exception is detected on the socket
    (say Sb) connecting B and C.

(4) The signal handler is called again when the out-of-band data
    arrives from B to process C.
    There cannot be any pending out-of-order data from A on socket Sa.
    However, when "select" is called, it indicates that BOTH
    sockets Sa and Sb have an exception condition.
    An attempt to recv(fd, &data, 1, MSG_OOB) on socket Sa returns
    error EINVAL (as there is no out-of-band data on that socket).

Should socket Sa show an exception condition when the out-of-band
data has already been read ?
Or, do I have to do something to "clear" the exception condition
after the out-of-band data is read ?

I would appreciate your reply. Please send your reply

- nitin vaidya

2. sctrace

3. BSD Sockets and Out-of-Band data

4. How to change video modes?

5. select & out-of-band socket data

6. Using .forward

7. socket out-of-band data

8. Need Help w/New Install of SCO OpenServer 5.04 on PC with an IDE CDrom

9. sockets and out-of-band data

10. out-of-band data on tcp-sockets

11. Out-of-band data - how? (please help, urgent)

12. Out-of-band data on pty's?

13. 2.6 out-of-band data problem