20 lines
391 B
D
20 lines
391 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");
|
|
|
|
auto msg = `{"action":"bind","target":"testnpc"}`;
|
|
sock.send(msg.toUTF8);
|
|
writeln("Sent");
|
|
Thread.sleep(dur!"seconds"(1));
|
|
} |