#204 JNP Connection Timeout

v2.4 (stable)
closed-rejected
Scott M Stark
5
2002-04-27
2002-04-23
Lucas McGregor
No

When JNP utilizes a connection or attempts to make a connection to a server, there is no timeout value as there is with RMI. Also, the Socket class used for this connection is the standard SDK java.net.Socket, which does not have a connection timeout option as of SDK1.3. An attempt to connect to a bad address can take up to 4 minutes to timeout, and 15 minutes to timeout established connections gone dead on a default install of Solaris8. So a new SocketOpener support object is used that spawns a timer thread that will timeout connections that have not been established in a period of time. So if either a jnp.connect.timeout or jnp.sotimeout value has been set in the Context.environment (usually via the jndi.properties file), this NamingContext object will use the SocketOpener to create the socket, enforce a connect timeout, and set the soTimeout. If neither value is set, then it NamingContext will save the resources and simply call the java.net.Socket constructor.

There is a patch for org.jnp.interfaces.NamingContext and a new org.jnp.interfaces.SocketOpener. Two new values can be added to the jndi.properties file: np.connect.timeout and jnp.sotimeout (both in ms).

Discussion

  • Lucas McGregor
    Lucas McGregor
    2002-04-23

    org.jnp.interfaces.SocketOpener source code

     
    Attachments
  • Lucas McGregor
    Lucas McGregor
    2002-04-23

    diff -u for org.jnp.interfaces.NamingContext patch

     
    Attachments
  • Scott M Stark
    Scott M Stark
    2002-04-27

    • assigned_to: nobody --> starksm
    • status: open --> open-rejected
     
  • Scott M Stark
    Scott M Stark
    2002-04-27

    Logged In: YES
    user_id=175228

    The diff is against a version from the main and your
    additions are not following the existing code format.
    Resubmit against the 2.4 branch and keep the existing
    formatting.

     
  • Scott M Stark
    Scott M Stark
    2002-04-27

    • status: open-rejected --> closed-rejected