Link to home
Start Free TrialLog in
Avatar of isond
isond

asked on

HSM connection

Hi,

I am writing a program to send commands to a HSM. This is done using sockets. I have a problem that the socket does not seem to disconnect imediately after calling the close method on the socket. It seems to wait for a timeout before disconnecting, is there anyway that I can force the connection to be dropped straight away as we only have a limited number of HSM connections.

Thanks,

Darren.
Avatar of rjackman
rjackman

hi
try assigning null to ref after calling close
also close all the streams opened by that socket befor closing it
try
{
  //close input& output stream opened by this socket
  instream.close();
  instream=null;
  outstream.close();
  outstream = null;
  socket.close();
  socket=null;
}
catch(IOException ioe)
{
  ioe.printStackTrace();
}
Avatar of girionis
No comment has been added lately, so it's time to clean up this TA.

I will leave a recommendation in the Cleanup topic area that this question is:

- To be PAQ'ed and points NOT refunded

Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

girionis
Cleanup Volunteer
ASKER CERTIFIED SOLUTION
Avatar of PashaMod
PashaMod

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial