When attempting to create a connect a socket in a VM running on a vxWorks system I'm getting a rather odd SocketException thrown intermittently. I have not been able to isolate what is causing the exception to occur. Without modifying any external factors successful connection is seemingly random.
Here's the top of the stack trace (from where it enters java.net):
(0000069317) java.net.SocketException: errno2: 68, error: errno = 0x44 for fd: 38 (0000069323) at java.net.PlainSocketImpl.socketConnect(Native Method) (0000069326) at java.net.PlainSocketImpl.doConnect(Unknown Source) (0000069329) at java.net.PlainSocketImpl.connectToAddress(Unknown Source) (0000069366) at java.net.PlainSocketImpl.connect(Unknown Source) (0000069372) at java.net.Socket.connect(Unknown Source)
The block throwing the exception is as below:
socket = new Socket();
socket.connect(addr, CONNECT_TIMEOUT);
Where addr
is a java.net.SocketAddress.
Can anyone provide some insight into what errno 0x44 is?
vxWorks have different errno code numbering than Unix systems.
In vxWorks errno 0x44 (68) is EINPROGRESS.
EINPROGRESS may be set by the following routines: aio_read(), aio_return(), aio_write()
EINPROGRESS is not usually error. With asynchronous IO, it just indicate that something is started, but it is not yet completed.
Maybe Java translates 68 incorrectly to EADV.
Try to use:
socket.connect(addr);
instead of
socket.connect(addr, CONNECT_TIMEOUT);
Maybe that is enough for avoid AIO and EINPROGRESS.