The server process gets a request to run a process from a remote
machine, gets a "next available" port number and sends it back to the
remote process. It then starts up the requested process process passing
then port to it on the command line then. The process on the remote
machine starts up a listener on the port number specified and after
waiting a few seconds for this to be established the process on the
local machine opens a socket to the remote listener on the specified port.
Look here: http://www.schasny.com/bp/SOCKET.SERVER
George Gallen wrote:
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
--
------------------------------------------------------------------------
Jeff Schasny - Denver, Co, USA
jschasny at gmail dot com
------------------------------------------------------------------------
_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users