I run a Python program on an embedded system. This system runs a server that creates UNIX sockets.
def com(request):
my_socket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
my_socket.connect("/var/run/.json-cgi")
my_socket.send(request)
reply = my_socket.recv(4096)
return repr(reply)
/var/run/.json-cgi
is the socket created by the server. I send a http request that I wrote before and I passed in the arg of the function.
When I print the reply, I just get ''
.
I wonder if my program creates a new socket that has the same path than the server's one or if it uses the socket of the server. I want to use the socket created by the server.
Did I forget something ?