-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClient.java
More file actions
32 lines (26 loc) · 897 Bytes
/
Copy pathClient.java
File metadata and controls
32 lines (26 loc) · 897 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import java.lang.*;
import java.net.*;
import java.io.*;
class Client
{
public static void main(String arg[]) throws Exception
{
System.out.println("Client application is running...");
String s1, s2;
Socket s = new Socket("localhost",1100);
BufferedReader brK = new BufferedReader(new InputStreamReader(System.in));
BufferedReader br = new BufferedReader(new InputStreamReader(s.getInputStream()));
PrintStream ps = new PrintStream(s.getOutputStream());
while(!(s1 = brK.readLine()).equals("gn"))
{
ps.println(s1);
s2 = br.readLine();
System.out.println("Server says : "+s2);
System.out.println("Enter message for server : ");
}
s.close();
br.close();
brK.close();
ps.close();
}
}