Created
June 6, 2017 13:16
-
-
Save joffilyfe/d217d49179b8b9bbe58ba73a51c59bab to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Chat; | |
import java.io.DataInputStream; | |
import java.io.IOException; | |
import java.net.Socket; | |
public class MainClient { | |
public static void main(String[] args) throws IOException { | |
Client cliente1 = new Client("localhost", 7171, "Joffily"); | |
cliente1.start(); | |
Socket socket = cliente1.getSocket(); | |
while(socket.isConnected()) { | |
// Recebendo uma mensagem | |
DataInputStream in = new DataInputStream(socket.getInputStream()); | |
System.out.println(in.readUTF()); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment