Tony,

I don't do U2 sockets but I'm guessing Craig's code is missing something.
In socket comms, you wait on the listen, accept a connection, do whatever
you need, then go back to listen.  Looping on accept is OK but after the
repeat you have to go back to listening, and that shouldn't mean going back
to the initServerSocket unless an existing socket goes immediately to
listen.

once you initServerSocket in UV, any other process trying to initServerSocket on the same ip/port combination fails. It looked to me like Cedric was using SOREUSEADDR to allow multiple D3 processes to handle incoming connections (using SOREUSEADDR so that mutiple processes could listen in turn for incoming connections ... maybe D3 doesn't work like this and I misunderstood his code?). Such a design won't work under UV as you have no way to apply the SOREUSEADDR option to the listener.

So you need to loop on acceptconnection and then loop on read/write operations until you are done with a client connection and then accept the next connection (or accept multiple connections into the one process and have your program service each one in a loop).

I will admit that I haven't bothered with UV socket servers since 9.6 because of these limitations.



Craig
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to