[comp.protocols.tcp-ip] datagrams and non-blocking sockets ==> PROBLEM

rla@media01.UUCP (Raymond van der Laan) (06/07/90)

I have written a network interface on a Sun 386 machine using socket
based IPC. The virtual circuit stuff works fine, but I have a problem
with the datagram part.

Because I want to be able to identify the sender of the datagram,
I let the sender bind its socket to a portnumber (which is well-known
to both parties). When I use the recvfrom call on the receiver's side,
I can retrieve the portnumber and the hostmachine, so I know who sent
the DG. No problems so far.

However, because I do not want to wait forever if there is no dg sent at
all, I use the ioctl call on the receivers side to mark the socket non-
blocking (FIONBIO). When I do this, the binding done by the sender has no
effect. Instead, the system binds the socket to some other portnumber, so
the receiver doesn't know who sent the DG.
(I use the same ioctl call for VC's, but this call is made after the
VC is established.)

What's happening? If anyone knows more about this, please let me know.


+---------------------------------------------------------------------------+
| Raymond van der Laan                                                      |
| Mediasystemen B.V.                                                        |
| Holland                                                                   |
+---------------------------------------------------------------------------+