22 lines
487 B
D
22 lines
487 B
D
#!dmd -run
|
|
|
|
import core.thread;
|
|
import std.stdio;
|
|
import std.socket;
|
|
import std.conv;
|
|
import std.utf;
|
|
|
|
void main() {
|
|
writeln("Start");
|
|
auto sock = new TcpSocket;
|
|
sock.blocking = 1;
|
|
sock.connect(new InternetAddress("127.0.0.1", 8080));
|
|
writeln("Connected");
|
|
|
|
sock.send(`{"action":"bind","target":"testnpc"}`.toUTF8);
|
|
writeln("Sent");
|
|
Thread.sleep(dur!"seconds"(1));
|
|
sock.send(`{"action":"getenv","target":"testnpc"}`.toUTF8);
|
|
writeln("Sent2");
|
|
Thread.sleep(dur!"seconds"(1));
|
|
} |