› Clovertech Forums › Read Only Archives › Cloverleaf › Cloverleaf › hcitcptest
Hi Kevin,
Syntax for hcitcptest is:
hcitcptest [-h hostname] [-f file] -t tcp_encoding_type -p port
so you will always need to specify the tcp_encoding_type.
And you need to specify the hostname too, or else hcitcptest will act as a server and listen to the specified port.
So your example will listen to port 12002 on the localhost, but I’m not sure which encoding_type will be used. If you want to send messages to port 12002 on localhost, try
hcitcptest -h localhost -t 4 -p 12002
Use
hcitcptest
to get more info.
Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands
thanks, makes more sense to me now. When we send a message through the tunnel and they get thier message, after a while we lose connection with the vendor. we are only sending them one hl7 message an hour. our tech guy is working on something with the firewall. with this being my first interface setup is there anything i can look for on the cloverleaf side?
Kevin, we have run into this problem with VPN/Firewall connections before. For whatever reason, the firewall nazis will not change the way the firewall times out for our interface connections over VPNs. So, we worked with the vendor and created a heartbeat message that is sent with a cronjob every 5 minutes.
I’ll paste our code below, but keep in mind you’ll have to modify it for your own needs.
heartbeat.tcl
#!/hci/quovadx/qdx5.6/integrator/bin/tcl
################################################################################
#
# Name: heartbeat
# Purpose: Send a heartbeat to keep vpn/firewall connections alive
#
################################################################################
# Note: The heartbeat message needs to be in $HCISITEDIR/iig/files/ directory.
global HciRoot
# Set the date (used for debugging and logging if needed)
set date [clock format [clock seconds] -format %Y%m%d]
# Example cron:
#00,05,10,15,20,25,30,35,40,45,50,55 * * * * . ~/.profile.cron;/hci/bin/heartbeat.tcl testbno bno31 bno31bblab_out heartbeat_bb.hl7 heartbeat_bb.log > /dev/null 2>&1
# Get args
set scriptName $argv0
set site [lindex $argv 0]
set process [lindex $argv 1]
set thread [lindex $argv 2]
set heartbeat [lindex $argv 3]
set log [lindex $argv 4]
# Set up the environment for Cloverleaf commands
eval [exec $HciRoot/sbin/hcisetenv -root tcl $HciRoot $site]
# Send the heartbeat
#catch {exec hcicmd -p $process [code]#!/hci/quovadx/qdx5.6/integrator/bin/tcl
################################################################################
#
# Name: heartbeat
# Purpose: Send a heartbeat to keep vpn/firewall connections alive
#
################################################################################
# Note: The heartbeat message needs to be in $HCISITEDIR/iig/files/ directory.
global HciRoot
# Set the date (used for debugging and logging if needed)
set date [clock format [clock seconds] -format %Y%m%d]
# Example cron:
#00,05,10,15,20,25,30,35,40,45,50,55 * * * * . ~/.profile.cron;/hci/bin/heartbeat.tcl testbno bno31 bno31bblab_out heartbeat_bb.hl7 heartbeat_bb.log > /dev/null 2>&1
# Get args
set scriptName $argv0
set site [lindex $argv 0]
set process [lindex $argv 1]
set thread [lindex $argv 2]
set heartbeat [lindex $argv 3]
set log [lindex $argv 4]
# Set up the environment for Cloverleaf commands
eval [exec $HciRoot/sbin/hcisetenv -root tcl $HciRoot $site]
# Send the heartbeat
#catch {exec hcicmd -p $process
-- Max Drown (Infor)
Firewall nazis? 😈
Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands
Hehe.
By the way, here’s our heartbeat message.
MSH|^~&|HEARTBEAT|HEARTBEAT|HEARTBEAT|HEARTBEAT|20080909082000||ORM^O01|999999-999999999999|P|2.3.1^M
^M == carriage return
-- Max Drown (Infor)
If you’re running Unix you can adjust your tcp_keep_alive so that it is less than the time-out values of the various pieces of equipment along the route. I changed ours to 15 minutes instead of the default 2 hours. We had a router/switch in the path that was timing out and shutting the tunnel down. No problems since.
Ugh I hate VPN’s… nothing but problems with them. 😈
if you change the keep_alive from say 2 hrs to 15 minutes what does that do to the other sockets. we are running a unix box. i havent really heard of the keep_alive untill this posting. what exactly does it do?
thanks.
We are on HP-UX 11i. Your mileage may vary.
The control file on our system is /etc/rc.config.d/nddconf
The specific parameter is tcp_keepalive_interval which controls how often “probes” are sent on idle TCP connections to keep them from timing out. This setting applies to all TCP connections on the system. The value is in milliseconds.
The default for HP-UX is to send a probe every 2 hours. I wouldn’t imagine that sending them every 15 minutes on an idle connection would have much impact on other systems.
Setting this value appropriately should eliminate the need for sending HL7 messages from the engine just to keep connections from timing out. Work with your network people to determine an appropriate value. As I mentioned earlier, it’s not just the destination that could be timing out. It can be any piece of equipment in the route. In our case it was one of our switches that was causing the problem.
On UNIX you can get more information from the man pages: man ndd
What is the “probe” exactly? Is it some sort of icmp packet like a ping?
-- Max Drown (Infor)
All the gory details are contained in RFC-1122.
Here’s what Chris is talking about.
See this thread:
https://usspvlclovertch2.infor.com/viewtopic.php?t=734
You need to tweak (if AIX) AIX’s tcp_keepidle parameter.