The following is part of a client application running on a Solaris 8
To enable a timeout to be set when using TCP Sockets connect()
I have first set the socket to non-blocking using getsockopt() and
I then connect(), in case of an EINPROGRESS error I call select() with
On succesfully completing the connection I then use fcntl() to return
the flags to - setting the socket to blocking.
I subsequently use a listening thread which repeatedly calls recv()
the flags in recv() are set to 0 so I expect recv() to work in
I have tested this against two seperate server applications
1) A Message Router (server) running on a PC running Windows NT
(server uses CAsyncSocket). Everything seems to work OK. Messages are
received at the client and recv() blocks until the next message is
2) A Messsage Router (Server) running on a LynxOS box. In this case I
experience problems at the Listener (client) the recv() does not
appear to block and continuously returns -1, trapping the errno =
EINVAL (appears to correspond to MSG_OOB flag set and socket still non
blocking. In this case I'm lost for the cause of the problem.
a)Can I change the flags for a socket after connection.
b)Is it possible that the Router (server) is
disconnecting/reconnecting the socket
c)Should recv() block if the flags are set to zero regardless of the
flags set for the socket
If you can help