MCPcopy Create free account
hub / github.com/0linlin0/CyberBox / start

Method start

Skay_Exp/src/tools/nc/NetcatUDPClient.java:27–41  ·  view source on GitHub ↗

Creates client socket makes request to the server. @throws Exception

(String host, int port)

Source from the content-addressed store, hash-verified

25 * @throws Exception
26 */
27 @SuppressWarnings("InfiniteLoopStatement")
28 private static void start(String host, int port) throws Exception {
29 clientSocket = new DatagramSocket();
30 ipAddress = InetAddress.getByName(host);
31 if (System.in.available() > 0) {
32 uploadMode = true;
33 }
34 while (true) {
35 if (uploadMode) {
36 upload(port);
37 } else {
38 download(port);
39 }
40 }
41 }
42
43 /**
44 * In download mode, client reads data from the socket and writes it to standard output.

Callers 1

mainMethod · 0.95

Calls 2

uploadMethod · 0.95
downloadMethod · 0.95

Tested by

no test coverage detected