users@glassfish.java.net

Re: How can a standalone application client check its connection to the server (ejb, mms)?

From: Harshad Vilekar <harshad.vilekar_at_oracle.com>
Date: Thu, 25 Oct 2012 23:19:11 -0700

When a remote client Java program performs a new initialContext() call,
it creates a client side ORB instance. This in turn creates a socket
connection to the GlassFish Server IIOP port (default 3700). Check the
socket connection state on your client machine, using a program like
"netstat". Active connection will have "ESTABLISHED" state.

For example:
$ netstat -an | grep 3700
Proto Recv-Q Send-Q Local Address Foreign Address
State
tcp6 0 0 127.0.0.1:50576 127.0.1.1*:3700
* ESTABLISHED

Similarly, on the machine running GlassFish server, only a Listener is
present when no ORB client is connected.
$ netstat -an | grep 3700
tcp6 0 0 :::3700 :::* LISTEN

When the client connects, a socket connection is established:

Proto Recv-Q Send-Q Local Address Foreign Address
State
tcp6 0 0 127.0.1.1:*3700 *
127.0.0.1:50576 ESTABLISHED

Harshad.

On 10/25/2012 10:27 AM, forums_at_java.net wrote:
> Hi there, I have written a standalone application client (java webstart),
> which connects to a server to communicate with session beans via RMI /
> IIOP
> and to receive JMS messages. It can be launched here:
> http://www.dlsc.com:9080/collapp/ The client sometimes looses its
> connection
> to the server. This might be because of a network issue or because the
> laptop
> went into sleep mode. So this is normal. The client eventually
> reconnects to
> the server by itself. The problem I am having is that the user does not
> understand what is going on, why there is a delay. Can anyone tell me
> how I
> can check whether the connection to the server is still up and running
> ? I am
> assuming that there are different things that need to be done to check
> the
> RMI connection and to check the JMS connection. Is there any way I can
> hook
> into the JMS machinery on the client to see its status (connected,
> reconnecting, disconnected)? How do I check the RMI connection? A simple
> socket check? Any help much appreciated. --Dirk
>
> --
>
> [Message sent by forum member 'dlemmermann']
>
> View Post: http://forums.java.net/node/891774
>
>