Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
492 B
2
Indexable
Never
import java.io.*;
import java.net.*;

public class ClientEcho {
	public static void main(String q[]) throws IOException
	{
		Socket sc=new Socket("localhost",8001);
		
		DataOutputStream out=new DataOutputStream(sc.getOutputStream());
		String Message="hi...CSBS Student";
		out.writeUTF(Message.toUpperCase()+"\n");
		
		DataInputStream in=new DataInputStream(sc.getInputStream());
		String msg=in.readUTF();
		System.out.println("Message From Server: " + msg);
		
		sc.close();
						
	}

}
Leave a Comment