Don't rely on a hard-coded port in test.
This commit is contained in:
parent
d2b777607a
commit
0b44d15045
|
@ -12,7 +12,7 @@ import core.time : msecs;
|
|||
|
||||
shared static this()
|
||||
{
|
||||
listenTCP(11375,(conn){
|
||||
auto l = listenTCP(0, (conn) {
|
||||
auto td = runTask!TCPConnection((conn) {
|
||||
ubyte [3] buf;
|
||||
try {
|
||||
|
@ -22,17 +22,17 @@ shared static this()
|
|||
}, conn);
|
||||
sleep(10.msecs);
|
||||
conn.close();
|
||||
});
|
||||
}, "127.0.0.1");
|
||||
|
||||
runTask({
|
||||
try {
|
||||
auto conn = connectTCP("127.0.0.1", 11375);
|
||||
auto conn = connectTCP("127.0.0.1", l.bindAddress.port);
|
||||
conn.write("a");
|
||||
conn.close();
|
||||
} catch (Exception e) assert(false, e.msg);
|
||||
|
||||
try {
|
||||
auto conn = connectTCP("127.0.0.1", 11375);
|
||||
auto conn = connectTCP("127.0.0.1", l.bindAddress.port);
|
||||
conn.close();
|
||||
} catch (Exception e) assert(false, e.msg);
|
||||
|
||||
|
|
Loading…
Reference in a new issue