T
Theo James
I am a newbie perl programmer and I have an idea for a perl program,
but I want to know if it is possible before I attempt to write it.
Here is what I need:
I have a client, talking to my server via TCP/IP to port 1234. The
client is creating many seperate conversations that are a simple
request/response pairing. All requests from the client go to port
1234. Here is how I would like it to flow:
(main loop)
Server.pl accepts connection on port 1234 ->
locks port 1234 from any other new connection ->
redirects conversation to lesser know port (ex. 2345) ->
calls subserver.pl on port 2345 to handle request response
conversation
as soon as Server.pl fires off subserver.pl ->
unblock port 1234 and allow another connection (main loop)->
subserver.pl handles all communications with client and upon
completion (or time out) imports Server.pl that port 2345 is avilabile
for communication and then dies (or optionally wait for Server.pl to
send another session to it).
I already know how to handle this conversation without multiple
threads. Everything I've read out there seems to tell me that this is
hard or impossible. Can this be done? If so, is this design the best
what to handle it? If so, can you give me the main functions I should
look into? If not, can you point me in a different direction (please,
not C!!!)
Any help would greatly be appreicated!
--Theo James
but I want to know if it is possible before I attempt to write it.
Here is what I need:
I have a client, talking to my server via TCP/IP to port 1234. The
client is creating many seperate conversations that are a simple
request/response pairing. All requests from the client go to port
1234. Here is how I would like it to flow:
(main loop)
Server.pl accepts connection on port 1234 ->
locks port 1234 from any other new connection ->
redirects conversation to lesser know port (ex. 2345) ->
calls subserver.pl on port 2345 to handle request response
conversation
as soon as Server.pl fires off subserver.pl ->
unblock port 1234 and allow another connection (main loop)->
subserver.pl handles all communications with client and upon
completion (or time out) imports Server.pl that port 2345 is avilabile
for communication and then dies (or optionally wait for Server.pl to
send another session to it).
I already know how to handle this conversation without multiple
threads. Everything I've read out there seems to tell me that this is
hard or impossible. Can this be done? If so, is this design the best
what to handle it? If so, can you give me the main functions I should
look into? If not, can you point me in a different direction (please,
not C!!!)
Any help would greatly be appreicated!
--Theo James