Strange socket error

"Jérôme M. Berger" jeberger at free.fr
Tue Dec 21 14:22:13 PST 2010


Bob Cowdery wrote:
> 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.
> 
	Do you have several threads trying to accept connections on the
same socket simultaneously? If that is the case, the first thread
would block on the socket until your client connects and the other
threads will fail in the call to "accept".

		Jerome
-- 
mailto:jeberger at free.fr
http://jeberger.free.fr
Jabber: jeberger at jabber.fr

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20101221/980368ee/attachment.pgp>


More information about the Digitalmars-d-learn mailing list