import java.net.*;
import java.io.*;
public class myclient
{
Socket s;
DataInputStream din;
DataOutputStream dout;
myclient()
{
try
{
s=new Socket("Localhost",13);
System.out.println(s);
din=new DataInputStream(s.getInputStream());
dout=new DataOutputStream(s.getOutputStream());
clientchat();
}
catch(Exception e)
{
System.out.println(e);
}
}
public void clientchat() throws IOException
{
BuffferedReader br= new BufferedReader(new InputStreamReader(System.in));
String s1;
do
{
s1=br.readLine();
dout.writeUTF(s1);
dout.flush();
System.out.println("Server message"+din.readUTF());
}
while(!s1.equals("stop"));
}
public static void main(String...g)
{
new myclient();
}
}