I'm looking to connect users over a network to a server with a pool of modems. Looks like hub4com is the solution here.
Question: Is it possible to write a script for the client side to automatically connect to the 'next unused port' on the server?
EG: I have a pool of 4 modems, COM1-4. I use com2tcp-rfc2217 to set up TCP ports 7001-7004 for those. When a user needs a modem, they use com2tcp-rfc2217 to connect one of their local ports to 7001-7004. If 7001-7003 are already in use by other users, can I script it so com2tcp-rfc2217 sees 7001-7003 are in use, and to use 7004?
Thanks,
Jeff
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Re-thinking this.. it would require clients to disconnect the COM port when they were done, which could be administratively difficult.
Has anyone used a modem pool in this application? Maybe there something else on the server side I can do to listen for connections and just forward to an open COM pool port when dialing out?
Thanks,
Jeff
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm looking to connect users over a network to a server with a pool of modems. Looks like hub4com is the solution here.
Question: Is it possible to write a script for the client side to automatically connect to the 'next unused port' on the server?
EG: I have a pool of 4 modems, COM1-4. I use com2tcp-rfc2217 to set up TCP ports 7001-7004 for those. When a user needs a modem, they use com2tcp-rfc2217 to connect one of their local ports to 7001-7004. If 7001-7003 are already in use by other users, can I script it so com2tcp-rfc2217 sees 7001-7003 are in use, and to use 7004?
Thanks,
Jeff
Re-thinking this.. it would require clients to disconnect the COM port when they were done, which could be administratively difficult.
Has anyone used a modem pool in this application? Maybe there something else on the server side I can do to listen for connections and just forward to an open COM pool port when dialing out?
Thanks,
Jeff
> Question: Is it possible to write a script for the
> client side to automatically connect to the
> 'next unused port' on the server?
Why do it on the client side?
> I use com2tcp-rfc2217 to set up TCP ports 7001-7004 for those.
Why use one TCP port per each serial port?
You can use one TCP port for all serial ports
and route any incoming TCP connection to the
first free serial port.
Below is the example for TCP port 5555 and serial ports COM1-COM4.
1. Convert com2tcp-rfc2217's command line to a file with
arguments for hub4com (see ReadMe.txt "FAQs & HOWTOs"):
SET OPTIONS=--create-filter=trace,_CUT_THIS_LINE_
com2tcp-rfc2217 COM1 5555 > my.txt
Your my.txt file will look like this:
_BEGIN_
--create-filter=trace,_CUT_THIS_LINE_
--create-filter=escparse,com,parse
--create-filter=purge,com,purge
--create-filter=pinmap,com,pinmap:--rts=cts --dtr=dsr --break=break
--create-filter=linectl,com,lc:--br=remote --lc=remote
--add-filters=0:com
--create-filter=telnet,tcp,telnet: --comport=server --suppress-echo=yes
--create-filter=lsrmap,tcp,lsrmap
--create-filter=pinmap,tcp,pinmap:--cts=cts --dsr=dsr --dcd=dcd --ring=ring
--create-filter=linectl,tcp,lc:--br=local --lc=local
--add-filters=1:tcp
--octs=off
COM1
--use-driver=tcp
*5555
_END_
2. Modify my.txt file to add more bi-routed port pairs:
_BEGIN_
--create-filter=escparse,com,parse
--create-filter=purge,com,purge
--create-filter=pinmap,com,pinmap:--rts=cts --dtr=dsr --break=break
--create-filter=linectl,com,lc:--br=remote --lc=remote
--add-filters=0:com
--create-filter=telnet,tcp,telnet: --comport=server --suppress-echo=yes
--create-filter=lsrmap,tcp,lsrmap
--create-filter=pinmap,tcp,pinmap:--cts=cts --dsr=dsr --dcd=dcd --ring=ring
--create-filter=linectl,tcp,lc:--br=local --lc=local
--add-filters=1:tcp
--octs=off
COM1
--use-driver=tcp
*5555
--bi-route=0:1
--use-driver=serial
--add-filters=2:com
COM2
--use-driver=tcp
--add-filters=3:tcp
*5555
--bi-route=2:3
--use-driver=serial
--add-filters=4:com
COM3
--use-driver=tcp
--add-filters=5:tcp
*5555
--bi-route=4:5
--use-driver=serial
--add-filters=6:com
COM4
--use-driver=tcp
--add-filters=7:tcp
*5555
--bi-route=6:7
_END_
3. Run hub4com:
hub4com --load=my.txt,_BEGIN_,_END_
Vyacheslav,
That is exactly the solution I was looking for! Thanks so much!
Jeff