blob: 3329471f562a10e51414e10a5f3a30b079bc68d3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
fn main() Int {
var sockint: Int = serversock(8080, "auto", 10);
println("slothnet has initialized!");
sendsock("Welcome to slothnet!", sockint);
var con: Bool = true;
while con == true {
println("wait...");
var msg: String = recvsock(sockint);
print("client: ");
println(msg);
print("send> ");
msg = readln();
sendsock(msg, sockint);
if sequals(msg, "KILLSERV") {
con = false;
}
}
closesock(sockint, true);
return 0;
}
|