1 |
ServerSocket s = new ServerSocket(port); |
|
1 |
Socket client = s.accept(); |
|
2 |
|
Socket client = new Socket(host, port); |
3 |
readfromclient = new BufferedReader(new InputStreamReader(client.getInputStream())); |
readfromserver = new BufferedReader(new InputStreamReader(socket.getInputStream())); |
3 |
writetoclient = new PrintWriter(client.getOutputStream()); |
writetoserver = new PrintWriter(client.getOutputStream()); |
4 |
readfromclient.close(); |
readfromserver.close(); |
4 |
writetoclient.close(); |
writetoserver.close(); |
4 |
client.close(); |
client.close(); |