Open hamzehnasajpour opened 5 years ago
connect returns an endpoint object that has an address attribute
e1 = s1.connect(path) e1.address
all endpoints are also available as a list on the socket
s1.endpoints
My m
My main problem is that ipc_path = "ipc://test"
isn't available, and no body listen to it, how can I detect that ipc_path
is available and I could connect it successfully.
ipc_path = "ipc://test"
s1 = Socket(PUSH)
s1.connect(ipc_path)
Ok I see a problem. Testing between process on ubuntu 18.10 with libnanomsg version 0.8~beta+dfsg-1 (that's very old?) I can't connect between the two using 'ipc://test' - lsof shows two separate unix sockets called test. using 'ipc:///tmp/test' work fine.
Is this the same issue you are having?
Sorry, This is an misunderstanding. One process(server) listen to a Unix Socket, and another process(client) can connect to it by this socket. If the server does not exist so there is no Unix Socket (ipc_path
) so when my client connect to it, how can I detect that this path is available or not? How can I detect that I can send data to it or the server not available?
Ah Ok. Depends on your use case I guess. But if you just want to exit the client if the server is not there you could set a socket timeout with recv_timeout? But I've just tried it and it seems broken. What are your OS, Python version and architecture (x86_64?)?
Sorry for late reply. I'm using Ubuntu 18.04 (x86_64) with Python2.7.
How can I change the socket timeout for recv or send?
After creating a socket, how can I find out that the connection path is available or not? Please see the following codes, assume that
path
isn't available. How can I detect it afters1.connect(path)
?