ease asserting, constants wrapped for future robustness

This commit is contained in:
Boris-Barboris 2018-06-06 10:41:20 +00:00
parent a2d96f1831
commit ed9fdcd467
7 changed files with 41 additions and 38 deletions

View file

@ -19,7 +19,7 @@ void main()
writeln("This doesn't work on macOS. Skipping this test until it is determined that this special case should stay supported.");
return;
} else {
static ubyte[] pack1 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
auto baddr = new InternetAddress(0x7F000001, 40002);

View file

@ -8,7 +8,7 @@ import eventcore.core;
import eventcore.socket;
import eventcore.internal.utils : print;
import std.socket : InternetAddress;
import core.time : Duration, msecs;
import core.time : Duration, msecs, seconds;
ubyte[256] s_rbuf;
bool s_done;
@ -69,6 +69,10 @@ void main()
client = sock;
assert(status == ConnectStatus.connected);
assert(sock.state == ConnectionState.connected);
print("Setting keepalive and timeout options");
client.setKeepAlive(true);
client.setKeepAliveParams(10.seconds, 10.seconds, 4);
client.setUserTimeout(5.seconds);
print("Initial write");
client.write!((wstatus, bytes) {
print("Initial write done");