예제 #1
0
 /**
  * Closes the connection.
  *
  * @exception IOException if an I/O error occurs when closing the socket
  */
 public void close() throws IOException {
   if (socket == null) return;
   socket.close();
   socket = null;
   in = null;
   out = null;
 }
예제 #2
0
 protected void init() throws IOException {
   if (address != null) socket = new Socket(address, port);
   else socket = new Socket(host, port);
   in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
   out = socket.getOutputStream();
 }