Socket exceptions

Socket exceptions

Post by Brian Gans » Fri, 23 Dec 1994 05:21:08



I am hoping to have a socket question answered for me in something I'm trying
to fix at work.

Recently we have been going over our socket/TN3270 communication section of
our product.  We have have noticed that the select() function has been has
been triggering but none of the FD's are true when you do the FD_ISSET.  We
are guessing that it has something to do with the exception and have set
the mask to see it when it occurs.

The problem we're having is that one of our books tell us what happens when
this mask is set.  We are unsure how to proceed with this when it happens.

Any help in this matter in the way of pointers, books to get, or the like
would be greatly appreciated.

Thanks,
Brian Gansle

 
 
 

Socket exceptions

Post by Brian Gans » Fri, 23 Dec 1994 21:31:27



Quote:>What value is select() returning, are you checking this?  It might be
>returning -1 (error) and errno set to EINTR, in which case a signal
>interrupted the call.  Another possibility, if you are using timeout
>value, is that it is returning 0, in which case the timeout expired.

Before everyone asks, YES we check for -1.  We have to for signal purposes.
But we do not have a timeout so it will stay there until someone does
something to one of the sockets.

BTW, my post should have said that NONE of our books tell us what happens
when an exception hits.

 
 
 

Socket exceptions

Post by Raja B Dao » Fri, 23 Dec 1994 12:18:05



>We have have noticed that the select() function has been has
>been triggering but none of the FD's are true when you do the FD_ISSET.

What value is select() returning, are you checking this?  It might be
returning -1 (error) and errno set to EINTR, in which case a signal
interrupted the call.  Another possibility, if you are using timeout
value, is that it is returning 0, in which case the timeout expired.

--Raja

-=-

Ohio Supercomputer Center               http://www.osc.edu/lam.html

 
 
 

Socket exceptions

Post by Nick Gianniot » Tue, 27 Dec 1994 15:08:35



>Before everyone asks, YES we check for -1.  We have to for signal purposes.
>But we do not have a timeout so it will stay there until someone does
>something to one of the sockets.

>BTW, my post should have said that NONE of our books tell us what happens
>when an exception hits.

I assume you are selecting on read activity on your descriptors by
defining a descriptor set using the FD_ZERO() and FD_SET() macros.

Things to check:
        1. you are initializing the write & exception descriptor sets via
           FD_ZERO().
        2. The return value from select() > 0.
        3. The bit-width of the descriptor sets you pass to select() is
           correct. (are you calling ulimit(3C) ?)

If all these are correct, yet FD_ISSET() says there are no fds ready to
read after select has returned, it sounds like your select() could be
broken. Especially if you see exception activity yet you did not
specifically select for it.

For the record, exception conditions on sockets under SunOS 4.1 are only
meant to occur on tcp stream sockets to indicate the presence of
out-of-band data. OOB data may be transmitted via send(2) and received via
recv(2).

Hope this helps,
Nick

 
 
 

1. Socket Exceptions

Could anyone help me with a socket problem that I have.

I am performing a select() on the socket with both the ifds and the efds
set to
the socket I am polling.  select() returns ok with data to read on the
socket - however
the efds bit remains set indicating that there is an exception on the
socket.

Use of the socket can proceed normally if the exception is ignored but this
is lowdown
in the isode stack and cannot be altered - does anyone know of how i can
get more
information as to the exception that occurred on the socket????

Thanks in advance,

Lee.

-----------------------
Lee Huddleston                  BJSS,
Technical Consultant            2nd Floor West,
                                        Capitol House,

                                        Leeds.
Tel: +44 (0)113 2979797         LS1 5SS
Fax: +44 (0)113 2979798         England.

2. help- term always give me timeout messages

3. socket exceptions on SysV.4

4. Reading is much more interesting than TV (1038/1708)

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

6. can ping/ssh into machine, but machine can't reach out.

7. exception conditions on sockets

8. Deleting everything

9. Clearing exception condition on a socket

10. Run-time exception; no handler for exception problem

11. Sockets sockets and more sockets

12. Socket, Socket, whose got the socket?

13. Socket, socket, who's got the socket?