Bug 14611 – socket.localAddress fails on Unix sockets with longer path (> 13 characters)

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2015-05-20T13:28:00Z
Last change time
2015-05-23T09:28:02Z
Assigned to
nobody
Creator
dragoscarp

Comments

Comment #0 by dragoscarp — 2015-05-20T13:28:14Z
import std.file; import std.stdio; import std.socket; void main() { string unixSocketNameOk = "1234567890123"; auto sOk = new Socket(AddressFamily.UNIX, SocketType.STREAM); sOk.bind(new UnixAddress(unixSocketNameOk)); scope (exit) remove(unixSocketNameOk); writeln(sOk.localAddress); string unixSocketNameFail = "12345678901234"; auto sFail = new Socket(AddressFamily.UNIX, SocketType.STREAM); sFail.bind(new UnixAddress(unixSocketNameFail)); scope (exit) remove(unixSocketNameFail); writeln(sFail.localAddress); } Output: > localhost:1234567890123 > std.socket.SocketParameterException@std/socket.d(2894): Not enough socket address storage
Comment #1 by dragoscarp — 2015-05-22T07:48:22Z