Remove debug output.
This commit is contained in:
parent
6d9daa2f11
commit
4db1a68d6e
|
@ -41,25 +41,20 @@ void testDgram()
|
||||||
auto s_baseSocket = createDatagramSocket(baddr);
|
auto s_baseSocket = createDatagramSocket(baddr);
|
||||||
auto s_freeSocket = createDatagramSocket(new UnixAddress(addr2));
|
auto s_freeSocket = createDatagramSocket(new UnixAddress(addr2));
|
||||||
auto s_connectedSocket = createDatagramSocket(new UnixAddress(addr3), baddr);
|
auto s_connectedSocket = createDatagramSocket(new UnixAddress(addr3), baddr);
|
||||||
log("drec");
|
|
||||||
s_baseSocket.receive!((status, bytes, addr) {
|
s_baseSocket.receive!((status, bytes, addr) {
|
||||||
assert(status == IOStatus.wouldBlock);
|
assert(status == IOStatus.wouldBlock);
|
||||||
})(s_rbuf, IOMode.immediate);
|
})(s_rbuf, IOMode.immediate);
|
||||||
log("drec2");
|
|
||||||
s_baseSocket.receive!((status, bts, address) {
|
s_baseSocket.receive!((status, bts, address) {
|
||||||
assert(status == IOStatus.ok);
|
assert(status == IOStatus.ok);
|
||||||
assert(bts == pack1.length);
|
assert(bts == pack1.length);
|
||||||
assert(s_rbuf[0 .. pack1.length] == pack1);
|
assert(s_rbuf[0 .. pack1.length] == pack1);
|
||||||
|
|
||||||
log("dsend2");
|
|
||||||
s_freeSocket.send!((status, bytes) {
|
s_freeSocket.send!((status, bytes) {
|
||||||
assert(status == IOStatus.ok);
|
assert(status == IOStatus.ok);
|
||||||
assert(bytes == pack2.length);
|
assert(bytes == pack2.length);
|
||||||
})(pack2, IOMode.once, baddr);
|
})(pack2, IOMode.once, baddr);
|
||||||
|
|
||||||
log("drec3");
|
|
||||||
s_baseSocket.receive!((status, bts, scope addr) {
|
s_baseSocket.receive!((status, bts, scope addr) {
|
||||||
log("drec3done");
|
|
||||||
assert(status == IOStatus.ok);
|
assert(status == IOStatus.ok);
|
||||||
assert(bts == pack2.length);
|
assert(bts == pack2.length);
|
||||||
assert(s_rbuf[0 .. pack2.length] == pack2);
|
assert(s_rbuf[0 .. pack2.length] == pack2);
|
||||||
|
@ -73,9 +68,7 @@ void testDgram()
|
||||||
eventDriver.core.exit();
|
eventDriver.core.exit();
|
||||||
})(s_rbuf, IOMode.immediate);
|
})(s_rbuf, IOMode.immediate);
|
||||||
})(s_rbuf, IOMode.once);
|
})(s_rbuf, IOMode.once);
|
||||||
log("dsend");
|
|
||||||
s_connectedSocket.send!((status, bytes) {
|
s_connectedSocket.send!((status, bytes) {
|
||||||
log("dsenddone");
|
|
||||||
assert(status == IOStatus.ok);
|
assert(status == IOStatus.ok);
|
||||||
assert(bytes == 10);
|
assert(bytes == 10);
|
||||||
})(pack1, IOMode.immediate);
|
})(pack1, IOMode.immediate);
|
||||||
|
@ -100,34 +93,17 @@ void testStream()
|
||||||
auto server = listenStream(baddr);
|
auto server = listenStream(baddr);
|
||||||
StreamSocket client;
|
StreamSocket client;
|
||||||
|
|
||||||
log("connect");
|
|
||||||
connectStream!((sock, status) {
|
|
||||||
client = sock;
|
|
||||||
assert(status == ConnectStatus.connected);
|
|
||||||
log("write1");
|
|
||||||
client.write!((wstatus, bytes) {
|
|
||||||
log("written1");
|
|
||||||
{ import std.stdio; scope (failure) assert(false); writefln("%s %s", wstatus, bytes); }
|
|
||||||
assert(wstatus == IOStatus.ok);
|
|
||||||
assert(bytes == 10);
|
|
||||||
})(pack1, IOMode.all);
|
|
||||||
})(baddr);
|
|
||||||
|
|
||||||
log("listen");
|
|
||||||
server.waitForConnections!((ref incoming) {
|
server.waitForConnections!((ref incoming) {
|
||||||
log("read1");
|
|
||||||
incoming.read!((status, bts) {
|
incoming.read!((status, bts) {
|
||||||
assert(status == IOStatus.ok);
|
assert(status == IOStatus.ok);
|
||||||
assert(bts == pack1.length);
|
assert(bts == pack1.length);
|
||||||
assert(s_rbuf[0 .. pack1.length] == pack1);
|
assert(s_rbuf[0 .. pack1.length] == pack1);
|
||||||
|
|
||||||
log("write2");
|
|
||||||
client.write!((status, bytes) {
|
client.write!((status, bytes) {
|
||||||
assert(status == IOStatus.ok);
|
assert(status == IOStatus.ok);
|
||||||
assert(bytes == pack2.length);
|
assert(bytes == pack2.length);
|
||||||
})(pack2, IOMode.once);
|
})(pack2, IOMode.once);
|
||||||
|
|
||||||
log("read2");
|
|
||||||
incoming.read!((status, bts) {
|
incoming.read!((status, bts) {
|
||||||
assert(status == IOStatus.ok);
|
assert(status == IOStatus.ok);
|
||||||
assert(bts == pack2.length);
|
assert(bts == pack2.length);
|
||||||
|
@ -144,6 +120,15 @@ void testStream()
|
||||||
})(s_rbuf, IOMode.once);
|
})(s_rbuf, IOMode.once);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
connectStream!((sock, status) {
|
||||||
|
client = sock;
|
||||||
|
assert(status == ConnectStatus.connected);
|
||||||
|
client.write!((wstatus, bytes) {
|
||||||
|
assert(wstatus == IOStatus.ok);
|
||||||
|
assert(bytes == 10);
|
||||||
|
})(pack1, IOMode.all);
|
||||||
|
})(baddr);
|
||||||
|
|
||||||
ExitReason er;
|
ExitReason er;
|
||||||
do er = eventDriver.core.processEvents();
|
do er = eventDriver.core.processEvents();
|
||||||
while (er == ExitReason.idle);
|
while (er == ExitReason.idle);
|
||||||
|
@ -157,10 +142,3 @@ void main()
|
||||||
testStream();
|
testStream();
|
||||||
testDgram();
|
testDgram();
|
||||||
}
|
}
|
||||||
|
|
||||||
void log(ARGS...)(string fmt, ARGS args)
|
|
||||||
{
|
|
||||||
import std.stdio;
|
|
||||||
try writefln(fmt, args);
|
|
||||||
catch (Exception e) {}
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue