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

Method start

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

Creates welcome socket and starts update loop to handle arbitrary sequence of clients making requests. @param port a port number @throws Exception

(int port)

Source from the content-addressed store, hash-verified

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

Callers 1

mainMethod · 0.95

Calls 2

downloadMethod · 0.95
uploadMethod · 0.95

Tested by

no test coverage detected