Re: Abstract sockets (linux)

2015-06-26 Thread Ali Çehreli via Digitalmars-d-learn
On 06/26/2015 07:39 AM, freeman wrote: > Is this worthy of a bug report? If it's a bug, yes. :) Ali

Re: Abstract sockets (linux)

2015-06-26 Thread freeman via Digitalmars-d-learn
On Thursday, 25 June 2015 at 15:56:06 UTC, freeman wrote: I am having trouble using abstract sockets on Linux. Here is sample python code that works, which works: ptm_sockname = "\0/var/run/ptmd.socket" sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) sock.connect(ptm_socknam

Re: Abstract sockets (linux)

2015-06-26 Thread Kagamin via Digitalmars-d-learn
On Friday, 26 June 2015 at 13:36:49 UTC, freeman wrote: This works (socat): connect(3, {sa_family=AF_FILE, path=@"/var/run/ptmd.socket"}, 23) = 0 This does not (from deneme, modified): connect(3, {sa_family=AF_FILE, path=@"/var/run/ptmd.socket"}, 24) = -1 ECONNREFUSED (Connection ref

Re: Abstract sockets (linux)

2015-06-26 Thread freeman via Digitalmars-d-learn
On Thursday, 25 June 2015 at 19:47:37 UTC, Ali Çehreli wrote: I've found an old example of mine, which uses abstract sockets. Apparently, it was a concurrency experiment as well. Just translated from Turkish to English: http://ddili.org/ornek_kod/client_server.d One difference I see is th

Re: Abstract sockets (linux)

2015-06-25 Thread Ali Çehreli via Digitalmars-d-learn
On 06/25/2015 08:56 AM, freeman wrote: I am having trouble using abstract sockets on Linux. Here is sample python code that works, which works: ptm_sockname = "\0/var/run/ptmd.socket" sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) sock.connect(ptm_sockname) sock.set

Re: Abstract sockets (linux)

2015-06-25 Thread freeman via Digitalmars-d-learn
On Thursday, 25 June 2015 at 18:50:29 UTC, Daniel Kozak wrote: Any pointers? instead of: string socket_name = "\0/var/run/ptmd.socket"; try: string socket_name = "/var/run/ptmd.socket"; works for me It is the null character that makes it an abstract socket (see man unix). There is no file /

Re: Abstract sockets (linux)

2015-06-25 Thread Daniel Kozak via Digitalmars-d-learn
On Thu, 25 Jun 2015 15:56:04 + freeman via Digitalmars-d-learn wrote: > I am having trouble using abstract sockets on Linux. > > Here is sample python code that works, which works: > ptm_sockname = "\0/var/run/ptmd.socket" > sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)

Re: Abstract sockets (linux)

2015-06-25 Thread freeman via Digitalmars-d-learn
On Thursday, 25 June 2015 at 16:07:51 UTC, Steven Schveighoffer wrote: I believe there was a recently fixed bug regarding unix sockets. The upcoming 2.068 may help, have you tried the beta? http://downloads.dlang.org/pre-releases/2.x/2.068.0/ -Steve Unfortunately the problem persists (I was

Re: Abstract sockets (linux)

2015-06-25 Thread Steven Schveighoffer via Digitalmars-d-learn
On 6/25/15 11:56 AM, freeman wrote: I am having trouble using abstract sockets on Linux. Here is sample python code that works, which works: ptm_sockname = "\0/var/run/ptmd.socket" sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) sock.connect(ptm_sockname) sock.setblo

Abstract sockets (linux)

2015-06-25 Thread freeman via Digitalmars-d-learn
I am having trouble using abstract sockets on Linux. Here is sample python code that works, which works: ptm_sockname = "\0/var/run/ptmd.socket" sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) sock.connect(ptm_sockname) sock.setblocking(1) sock.sendall('get-status det