Strange socket error

Bob Cowdery bob at bobcowdery.plus.com
Tue Dec 21 13:05:12 PST 2010


Hi all,

This is a long shot but I'm out of ideas. I ported an app from Windows
to Linux and after many issues it is working but I'm left with a strange
problem. The app basically reads data streams from a USB device,
processes them and outputs real-time graphical data to a browser. There
is also some control input from the browser. The interface to the
browser is web sockets for which I have written a D web-socket server.
Depending on how much of my application I allow to run I get a stream of
these errors.

Error accepting: std.socket.SocketAcceptException: Unable to accept
socket connection: Resource temporarily unavailable
----------------
./DcSdr() [0x80aa2ed]
./DcSdr() [0x806f52b]
./DcSdr() [0x804f752]
./DcSdr() [0x809b422]
./DcSdr() [0x80ae77e]
/lib/tls/i686/cmov/libpthread.so.0(+0x596e) [0x48496e]
/lib/tls/i686/cmov/libc.so.6(clone+0x5e) [0xc5fa4e]

This is the web-socket accept. I seem to fall straight through the
accept call even when I am not making any connection attempt. When I do
connect the stream stops and I get one of these outputs each time I send
data from the browser. I should not even be near the accept at that
point as the connection is made.

The app appears to be unaffected and works as expected. The odd think is
if I shut down part of the app these errors stop. I can't tie it down to
any specific thing but I suspect threading as the number of threads is
reduced by stopping parts of the app. The error also seems to indicate
threads are involved. I did not get this problem on Windows.

Any ideas would be much appreciated.

Thanks
bob


More information about the Digitalmars-d-learn mailing list