Re: Strange socket error

2010-12-24 Thread Bob Cowdery
Perseverance pays off in the end. Having worked out how the socket class was supposed to work it seemed that the select call was returning when it was not supposed to and giving a false indication in the socket set of who spoke. When I looked at the return code of select() it was -1 (interrupted).

Re: Strange socket error

2010-12-23 Thread Bob Cowdery
Hi All communication is appreciated. I often find just trying to explain a problem can lead to fixing it. Sorry this is a bit rambling. I know D is not done yet and there will be bugs. I don't know yet if its me or D. The program structure is quite simple. 1. I have 3 pieces of C code. An interfa

Re: Strange socket error

2010-12-23 Thread Heywood Floyd
Hi! I see. I think my previous answer was a bit naive—I didn't appreciate the full scope of the problem. Sorry for that, but you know, internet is fast, snap snap : ) Ok, for now I'm afraid I don't have any more to add. (An isolated example would of course help greatly!) All I can say is, i

Re: Strange socket error

2010-12-23 Thread Bob Cowdery
Hi Heywood Thankyou for your time. Yes I agree making the call blocking does stop the exceptions churning. Unfortunately the application stops accepting data now because after the first incoming transfer from the web socket client it sees data on the listening socket and promptly blocks on it and

Re: Strange socket error

2010-12-22 Thread Heywood Floyd
Hi Bob! My guess: You're listener is set to be non-blocking. That means that when you call listener.accept() it will return immediately with an SocketAcceptException, if there's no connection. And you're basically calling listener.accept() over and over again in an infinite loop. The followin

Re: Strange socket error

2010-12-22 Thread Bob Cowdery
On 22/12/2010 10:04, "Jérôme M. Berger" wrote: > Bob Cowdery wrote: >> The listner is a single thread that creates an instance of my web socket >> class for each connection. I'm not trying to support lots of users, most >> of the time just one. The listner code is almost the same as the sockets >>

Re: Strange socket error

2010-12-22 Thread Jérôme M. Berger
Bob Cowdery wrote: > The listner is a single thread that creates an instance of my web socket > class for each connection. I'm not trying to support lots of users, most > of the time just one. The listner code is almost the same as the sockets > example. If you or anyone else can spare a few moment

Re: Strange socket error

2010-12-22 Thread Bob Cowdery
On 21/12/2010 22:22, "Jérôme M. Berger" wrote: > 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,

Re: Strange socket error

2010-12-21 Thread Jérôme M. Berger
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 dat

Strange socket error

2010-12-21 Thread Bob Cowdery
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 s