Commit ff6e0b18 authored by Matti Pulkkinen's avatar Matti Pulkkinen
Browse files

Added closing comments and a close method to StreamHandler

parent ef8abff3
......@@ -50,7 +50,7 @@ public class SocketHandler {
public SocketHandler() throws IOException {
this.serverSocket = new ServerSocket(LOCALPORT);
this.serverSocket.setSoTimeout(TIMEOUTMILLIS);
} // SocketOpener()
} // SocketHandler()
/**
* Closes the resources handled by this ConnectionHandler.
......@@ -75,8 +75,6 @@ public class SocketHandler {
/**
* TODO
*
* @param ois
* @param oos
* @throws IOException if opening one of the sockets fails.
*/
public StreamHandler openStreamHandler() throws IOException {
......@@ -106,7 +104,7 @@ public class SocketHandler {
}
return null;
} // openObjectStreams()
} // openStreamHandler()
/**
* Sends the port number localPort to the port remotePort at remoteHost
......
......@@ -12,13 +12,19 @@ public class StreamHandler {
public StreamHandler(ObjectInputStream ois, ObjectOutputStream oos) {
this.ois = ois;
this.oos = oos;
}
} // StreamHandler(ObjectInputStream, ObjectOutputStream)
void close() throws IOException {
this.ois.close();
this.oos.close();
} // close()
int readInt() throws IOException {
return this.ois.readInt();
}
} // readInt()
void writeInt(int n) throws IOException {
this.oos.writeInt(n);
}
}
} // writeInt(int)
} // class StreamHandler
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment