[Issue 14611] New: socket.localAddress fails on Unix Sockets with longer Path (> 13 characters)
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Wed May 20 06:28:14 PDT 2015
https://issues.dlang.org/show_bug.cgi?id=14611
Issue ID: 14611
Summary: socket.localAddress fails on Unix Sockets with longer
Path (> 13 characters)
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: enhancement
Priority: P1
Component: Phobos
Assignee: nobody at puremagic.com
Reporter: dragoscarp at gmail.com
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 at std/socket.d(2894): Not enough socket address storage
--
More information about the Digitalmars-d-bugs
mailing list