Avoid a possible concurrent write to the same socket.
This commit is contained in:
parent
e66b29d8df
commit
e8f35c0e0f
|
@ -38,12 +38,16 @@ void main()
|
||||||
assert(bts == pack1.length);
|
assert(bts == pack1.length);
|
||||||
assert(s_rbuf[0 .. pack1.length] == pack1);
|
assert(s_rbuf[0 .. pack1.length] == pack1);
|
||||||
|
|
||||||
|
auto tmw = eventDriver.timers.create();
|
||||||
|
eventDriver.timers.set(tmw, 20.msecs, 0.msecs);
|
||||||
|
eventDriver.timers.wait(tmw, (tmw) {
|
||||||
print("Second write");
|
print("Second write");
|
||||||
client.write!((status, bytes) {
|
client.write!((status, bytes) {
|
||||||
print("Second write done");
|
print("Second write done");
|
||||||
assert(status == IOStatus.ok);
|
assert(status == IOStatus.ok);
|
||||||
assert(bytes == pack2.length);
|
assert(bytes == pack2.length);
|
||||||
})(pack2, IOMode.once);
|
})(pack2, IOMode.once);
|
||||||
|
});
|
||||||
|
|
||||||
print("Second read");
|
print("Second read");
|
||||||
incoming.read!((status, bts) {
|
incoming.read!((status, bts) {
|
||||||
|
|
Loading…
Reference in a new issue