-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathClient.java
103 lines (66 loc) · 1.77 KB
/
Client.java
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/*
4:40 AM 16th Sept 2018
Santosh Kavhar
Client
*/
import java.util.*;
import java.io.*;
import java.net.*;
import java.sql.*;
import java.util.concurrent.*;
public class Client
{
public static void main(String args[])
{
try{
Socket socket=new Socket("localhost",7008);
Scanner sc = new Scanner(System.in);
DataInputStream din =new DataInputStream(socket.getInputStream());
DataOutputStream dos =new DataOutputStream(socket.getOutputStream());
System.out.println(din.readUTF());
dos.writeInt(sc.nextInt());
System.out.println(din.readUTF());
dos.writeUTF(sc.next());
System.out.println(din.readUTF());
dos.writeUTF(sc.next());
System.out.println(din.readInt());
}
catch(Exception e)
{
System.out.println(e);
}
}
}
//String str1=(String)in.readUTF();
/*while(true)
{
String line = in.nextLine();
}*/
/*
ScheduledExecutorService scheduler
= Executors.newSingleThreadScheduledExecutor();
Runnable task = new Runnable() {
public void run() {
// s.close();
}
};
int delay = 5;
scheduler.schedule(task, delay, TimeUnit.MINUTES);
scheduler.shutdown();
*/
// char ans;
/*
private static final String url = "jdbc:mysql://localhost:3306/SIS";
private static final String user = "root";
private static final String password = "root";
transient Scanner ch=new Scanner(System.in);
public void Enroll() //Registartion Function
{
try
{
System.out.println("*********SUGGESTIONS INFORMATION SYSTEM********:");
DataInputStream dis=new DataInputStream(s.getInputStream());
DataOutputStream dout=new DataOutputStream(s.getOutputStream());
}
}
*/