Exemplo n.º 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;
 }
Exemplo n.º 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();
 }