Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package server;
- import java.io.DataInputStream;
- import java.io.DataOutputStream;
- import java.io.IOException;
- import java.net.Socket;
- public class GameThread extends Thread{
- DataInputStream in;
- DataOutputStream out;
- private Socket socket;
- private boolean isHost;
- public GameThread(Socket skt) throws IOException {
- super("GameThread");
- socket = skt;
- in = new DataInputStream(socket.getInputStream());
- out = new DataOutputStream(socket.getOutputStream());
- }
- public String getUsername() throws IOException {
- String name = in.readUTF();
- return name;
- }
- public void setUserList(String list) throws IOException {
- out.writeUTF(list);
- out.flush();
- }
- }
Add Comment
Please, Sign In to add comment