forked from tishrof/Hacktoberfest2022
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClient.java
More file actions
22 lines (22 loc) · 747 Bytes
/
Client.java
File metadata and controls
22 lines (22 loc) · 747 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import java.net.*;
import java.io.*;
public class Client
{
public static void main(String[] args)
{
try
{
Socket s = new Socket("localhost", 6000);
BufferedReader br = new BufferedReader(new FileReader("F:\\IIIT V BOOKS\\Distributed\\201951046.txt"));
byte []b = new byte[1000];
String k = br.readLine();
DataOutputStream dos = new DataOutputStream(s.getOutputStream());
dos.writeUTF(k);
System.out.println("Transfer Complete");
}
catch (IOException ie)
{
ie.printStackTrace();
}
}
}