public ServerThread() { try { serverSocket = new ServerSocket(4444); System.out.println("Waiting for connection..."); socket = serverSocket.accept(); System.out.println("Connection accepted...");
readFromClient = new BufferedReader( new InputStreamReader( socket.getInputStream())); writeToClient = new PrintWriter( socket.getOutputStream(), true); readFromServer = new BufferedReader( new InputStreamReader( System.in));
public ClientThread(Socket socket) { try { this.socket = socket; readFromServer = new BufferedReader( new InputStreamReader( socket.getInputStream())); writeToServer = new PrintWriter( socket.getOutputStream(), true); readFromClient = new BufferedReader( new InputStreamReader(System.in));
2 Comments
itw working..Thank you..
ReplyDeleteHi Thanks for the code thank you very much
ReplyDelete