Bug 7338 – Non-blocking socket.accept() behavior differs on platforms

Status
NEW
Severity
normal
Priority
P3
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-01-21T10:47:02Z
Last change time
2024-12-01T16:14:47Z
Assigned to
No Owner
Creator
Heywood Floyd
Moved to GitHub: phobos#9587 →

Comments

Comment #0 by soul8o8 — 2012-01-21T10:47:02Z
// - - - - - 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:\n",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>
Comment #1 by bugzilla — 2019-10-17T19:42:31Z
What is the expected correct behavior?
Comment #2 by robert.schadek — 2024-12-01T16:14:47Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/9587 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB