> 1.  I'm assuming you are "NULL"ing the used sockets, so they get garbage 
>     collected?

You should not rely on garbage collection for scarce resources such
as file and socket handles.  Make sure you invoke socket.close() when
you're done.

Since you're working with threads, it is possible that a silent exception
is breaking your expected flow of execution.  Whenever I deal with
such scarce resources I write code like:

Socket socket = ...

try {

  // do the work

} finally {
  try { socket.close(); } catch (Throwable e) { ... log ... }
}

Alexander


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to