Hi Gaoyang,
There may be several reasons why you cannot telnet to a specific port. By
default, telnet servers listen at port 23. In order to telnet to port 6660, the
telnet server at that IP address needs to be set up to listen at that port. In
addition, that port would need to be open (not obstructed by a firewall etc).
While port 6660 may be set up on that server to be dedicated for MLLP
communication, make sure there are no obstructions that prevent the server from
actually receiving messages at that port.
Erik
________________________________
From: gaoyang4011 <[email protected]>
To: hl7api-devel <[email protected]>
Sent: Thu, November 25, 2010 7:54:32 AM
Subject: [HAPI-devel] sending Hl7 message via MLLP
Dear friends,
I have a question. I am doing a test about sending HL7 message via
MLLP.We have two servers in our company that works using VPN. The PC with
192.168.10.11 is the client with sending HL7 message , and the PC with
192.168.10.32 is the server with receiving the hl7 message. And the server's
port is 6660.
Now,I can ping 192.168.10.32,but can not telnet
192.168.10.32 6660. Someone tells me that 'Port 6660 is only available for
MLLP calls, and it cannot be accessed by telnet. ' Is it right? In my code,I
get the connection to the server of 192.168.10.32 like this :the flowing codes:
connectionHub = ConnectionHub.getInstance();
// A connection object represents a socket attached to an HL7 server
connection = connectionHub.attach(“192.168.10.32”, 6660, new PipeParser(),
MinLowerLayerProtocol.class);
public Connection attach(String host, int port, Parser parser, Class llpClass)
throws HL7Exception {
Connection conn = getExisting(host, port, parser.getClass(),
llpClass);
if (conn == null) {
try {
//Parser p = (Parser) parserClass.newInstance();
LowerLayerProtocol llp = (LowerLayerProtocol)
llpClass.newInstance();
conn = connect(host, port, parser, llp);
} catch (ClassCastException e) {
//Log.tryToLog(cce, "Problem opening new connection to " +
host
+ " port " + port);
throw new HL7Exception( "ClassCastException - need a
LowerLayerProtocol class to get an Inititator",
HL7Exception.APPLICATION_INTERNAL_ERROR,
e);
} catch (Exception e) {
//Log.tryToLog(e, "Problem opening new connection to " + host
+
" port " + port);
throw new HL7Exception( "Can't connect to " + host + " port "
+
port + ": " + e.getClass().getName() + ": " + e.getMessage(),
HL7Exception.APPLICATION_INTERNAL_ERROR,
e);
}
}
incrementRefs(conn);
return conn;
}
private Connection connect(String host, int port, Parser parser,
LowerLayerProtocol llp) throws UnknownHostException, IOException, LLPException
{
Socket s = new Socket(host, port);
Connection i = new Connection(parser, llp, s);
connections.put(makeHashKey(host, port, parser.getClass(),
llp.getClass()), i);
sockets.put(makeHashKey(host, port, parser.getClass(),
llp.getClass()),
s);
return i;
}
but when I try to connect to the 192.168.10.32 on port 6660: I get the
failure:
ca.uhn.hl7v2.HL7Exception: Can't connect to 192.168.10.32 port 6660:
java.net.ConnectException: Connection refused: connect
at ca.uhn.hl7v2.app.ConnectionHub.attach(ConnectionHub.java:92)
at cn.com.winning.client.ClientDbMotion.getConn(ClientDbMotion.java:43)
at
cn.com.winning.message.translator.DbMotion.TranslatorV231.translatorv231(TranslatorV231.java:77)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:276)
at
org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:260)
at
org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
at org.quartz.core.JobRunShell.run(JobRunShell.java:199)
at
org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:546)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at ca.uhn.hl7v2.app.ConnectionHub.connect(ConnectionHub.java:114)
at ca.uhn.hl7v2.app.ConnectionHub.attach(ConnectionHub.java:84)
I do not find the reason why I can not connect to the 192.168.10.32 on port
6660.
Then someone tells me The SNMP service should be open in the firewall,is it
nessary? I hope to hear your opion.Thanks verry much.
Thanks,
gaoyang
2010-11-25
________________________________
gaoyang4011
---------------------------------------------------------
网易闪电邮(fm.163.com),您的专属邮件管家------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
Hl7api-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hl7api-devel