forked from sparrowxiao/ConcurrentTest
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCSClientThread.java
More file actions
43 lines (36 loc) · 987 Bytes
/
CSClientThread.java
File metadata and controls
43 lines (36 loc) · 987 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
33
34
35
36
37
38
39
40
41
42
43
import java.io.*;
import java.net.*;
import java.lang.*;
/**
*
* @author sparrow
*/
public class CSClientThread {
public void CSClientThread(){};
/**
* @param args the command line arguments
*/
public static void main(String[] args) throws IOException {
String host = "127.0.0.1";
int port = 3456;//port is 3456
int sizeofMsg = 512;//bytes
if( args.length != 0)
{
host = args[0];
port = Integer.parseInt(args[1]);
sizeofMsg = Integer.parseInt(args[2]);
}
try{
for(int i =0 ; i<10;i++)
{
ProduceClient threadClient = new ProduceClient(host,port,sizeofMsg);
threadClient.start();
threadClient.sleep(2000);
}
}
catch(InterruptedException ex)
{
ex.printStackTrace();
}
} // main
}