{"action":"opened","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/21801","repository_url":"https://api.github.com/repos/JuliaLang/julia","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/21801/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/21801/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/21801/events","html_url":"https://github.com/JuliaLang/julia/issues/21801","id":228039729,"number":21801,"title":"Julia's getsockname is different from UNIX getsockname","user":{"login":"amitmurthy","id":117461,"avatar_url":"https://avatars2.githubusercontent.com/u/117461?v=3","gravatar_id":"","url":"https://api.github.com/users/amitmurthy","html_url":"https://github.com/amitmurthy","followers_url":"https://api.github.com/users/amitmurthy/followers","following_url":"https://api.github.com/users/amitmurthy/following{/other_user}","gists_url":"https://api.github.com/users/amitmurthy/gists{/gist_id}","starred_url":"https://api.github.com/users/amitmurthy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amitmurthy/subscriptions","organizations_url":"https://api.github.com/users/amitmurthy/orgs","repos_url":"https://api.github.com/users/amitmurthy/repos","events_url":"https://api.github.com/users/amitmurthy/events{/privacy}","received_events_url":"https://api.github.com/users/amitmurthy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-05-11T15:52:45Z","updated_at":"2017-05-11T15:52:45Z","closed_at":null,"body":"Julia's `getsockname` :\r\n```\r\nhelp?> getsockname\r\nsearch: getsockname\r\n\r\n  getsockname(sock::Union{TCPServer, TCPSocket}) -> (IPAddr, UInt16)\r\n\r\n  Get the IP address and the port that the given TCPSocket is connected to (or bound to, in the case of TCPServer).\r\n```\r\n\r\n\r\nUNIX:\r\n```     \r\nint\r\n     getsockname(int socket, struct sockaddr *restrict address, socklen_t *restrict address_len);\r\n\r\nDESCRIPTION\r\n     The getsockname() function returns the current address for the specified socket.\r\n```\r\n\r\n```\r\n     int\r\n     getpeername(int socket, struct sockaddr *restrict address, socklen_t *restrict address_len);\r\n\r\nDESCRIPTION\r\n     The getpeername() function returns the address of the peer connected to the specified socket.\r\n```\r\n\r\nJulia's `getsockname` is equivalent to UNIX's `getsockname` for `TCPServer`. For `TCPSocket` it is equivalent to `getpeername` - https://github.com/JuliaLang/julia/blob/1129de34c72d3fcf5155f3693cfd39ecb5db5870/base/socket.jl#L847-L855\r\n\r\nI suggest we mirror standard UNIX definitions and introduce a `getpeername` .\r\n\r\n"}}
{"actor":{"display_login":"amitmurthy"}}