You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// - - - - - 8< - - - -
import std.stdio, std.socket;
void main()
{
auto lsock = new TcpSocket();
lsock.blocking(false);
lsock.bind(new InternetAddress("127.0.0.1",5000));
try{
lsock.listen(1);
}catch(Exception e){
writeln("listen() failed (This is not the bug, choose another port?)");
return;
}
try{ auto sock = lsock.accept(); writeln("Accept returned: ",sock);}catch(Exception e){ writeln("Accept threw Exception:
",e);
}
lsock.close();
}
// - - - - - 8< - - - -
Behavior when socket.accept() is called when no new connection is available:
- Linux, OSX: An Exception is thrown
- Windows: A new Socket(isAlive=false) is returned
- Other: <untested>
The text was updated successfully, but these errors were encountered:
soul8o8 reported this on 2012-01-21T10:47:02Z
Transfered from https://issues.dlang.org/show_bug.cgi?id=7338
CC List
Description
// - - - - - 8< - - - - import std.stdio, std.socket; void main() { auto lsock = new TcpSocket(); lsock.blocking(false); lsock.bind(new InternetAddress("127.0.0.1",5000)); try{ lsock.listen(1); }catch(Exception e){ writeln("listen() failed (This is not the bug, choose another port?)"); return; } try{ auto sock = lsock.accept(); writeln("Accept returned: ",sock); }catch(Exception e){ writeln("Accept threw Exception: ",e); } lsock.close(); } // - - - - - 8< - - - - Behavior when socket.accept() is called when no new connection is available: - Linux, OSX: An Exception is thrown - Windows: A new Socket(isAlive=false) is returned - Other: <untested>The text was updated successfully, but these errors were encountered: