{"action":"opened","issue":{"url":"https://api.github.com/repos/nim-lang/Nim/issues/7848","repository_url":"https://api.github.com/repos/nim-lang/Nim","labels_url":"https://api.github.com/repos/nim-lang/Nim/issues/7848/labels{/name}","comments_url":"https://api.github.com/repos/nim-lang/Nim/issues/7848/comments","events_url":"https://api.github.com/repos/nim-lang/Nim/issues/7848/events","html_url":"https://github.com/nim-lang/Nim/issues/7848","id":324656062,"number":7848,"title":"net.acceptAddr \"Client socket needs to be initialised with `new`\"","user":{"login":"enthus1ast","id":13794470,"avatar_url":"https://avatars1.githubusercontent.com/u/13794470?v=4","gravatar_id":"","url":"https://api.github.com/users/enthus1ast","html_url":"https://github.com/enthus1ast","followers_url":"https://api.github.com/users/enthus1ast/followers","following_url":"https://api.github.com/users/enthus1ast/following{/other_user}","gists_url":"https://api.github.com/users/enthus1ast/gists{/gist_id}","starred_url":"https://api.github.com/users/enthus1ast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enthus1ast/subscriptions","organizations_url":"https://api.github.com/users/enthus1ast/orgs","repos_url":"https://api.github.com/users/enthus1ast/repos","events_url":"https://api.github.com/users/enthus1ast/events{/privacy}","received_events_url":"https://api.github.com/users/enthus1ast/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-19T20:01:06Z","updated_at":"2018-05-19T20:01:06Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"please note the `new Socket`\r\n\r\n```\r\nimport net # https://nim-lang.org/docs/net.html\r\nvar socket = newSocket()\r\nsocket.bindAddr(Port(1234))\r\nsocket.listen()\r\n\r\nvar client = new Socket\r\nvar address = \"\"\r\nwhile true:\r\n  socket.acceptAddr(client, address) #<---\r\n  echo(\"Client connected from: \", address)\r\n\r\n\r\n# Client connected from: 127.0.0.1\r\n# btcp.nim(9)         btcp\r\n# net.nim(793)             acceptAddr\r\n# system.nim(3788)         failedAssertImpl\r\n# system.nim(3781)         raiseAssert\r\n# system.nim(2843)         sysFatal\r\n# Error: unhandled exception: int(client.fd) <= 0 Client socket needs to be initialised with `new`, not `newSocket`. [AssertionError]\r\n# Error: execution of an external program failed: '/home/david/nimPlayground/btcp '\r\n```"}}
{"actor":{"display_login":"enthus1ast"}}