I did this once and ran into the same issue and came up with a scheme using pipes. The server process handles all incoming requests and starts up a phantom to actually handle each request. The server and the phantom process communicate via pipes. The server then does a round-robin polling for data to be moved between pipes & connections and vice versa. I am not sure how many concurrent connections this could handle before things started to crawl. But typically the requests were simple one request packet & one response packet and finished. There was also some phantom/pipe pooling involved to cut down on the phantom startup and pipe creation overhead.
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of George Gallen Sent: August 28, 2009 09:53 AM To: U2 Users List Subject: Re: [U2] back to the socket problem.... The problem at hand is that you can't pass the client handle obtained from the accept() onto another process, then go back and wait for another connection. If you fire off a phantom, it's a new Process, and isn't able to receive the handle from the other process. Any suggestions? I considered the method of returning a new port number and having the client reconnect on that port, but I'm not ready to go that route just yet. George > -----Original Message----- > From: [email protected] [mailto:u2-users- > [email protected]] On Behalf Of Glen Batchelor > Sent: Thursday, August 27, 2009 5:50 PM > To: 'U2 Users List' > Subject: Re: [U2] back to the socket problem.... > > > It appears that you are stacking instances of Program A on > top of > each other when you should be starting a client socket handler instead. > The > listen() socket function uses a single server socket handle to wait for > all > connections and then accept() creates one new socket handle for each > incoming connection. You need to pass the client handle to another > process > and let it do its own thing for that one connection. > _______________________________________________ U2-Users mailing list [email protected] http://listserver.u2ug.org/mailman/listinfo/u2-users _______________________________________________ U2-Users mailing list [email protected] http://listserver.u2ug.org/mailman/listinfo/u2-users
