Skip to content

Support for Unix Domain Socket #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Simple msgpackrpc client and server examples using Unix domain socket
support.
  • Loading branch information
hvishwanath committed Apr 8, 2013
commit 690b18f11cf017061e8d61817cc2bb104b92a098
1 change: 1 addition & 0 deletions example/uds_simpleclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import msgpackrpc.udsaddress
from msgpackrpc.transport import uds

#Use UDSAddress instead of default Address object
client = msgpackrpc.Client(msgpackrpc.udsaddress.UDSAddress("/tmp/exrpc"), builder=uds)
result = client.call('sum', 1, 2) # = >
print "Sum of 1 and 2 : %d" % result
2 changes: 2 additions & 0 deletions example/uds_simpleserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ class SumServer(object):
def sum(self, x, y):
return x + y

# Use builder as uds. default builder is tcp which creates tcp sockets
server = msgpackrpc.Server(SumServer(), builder=uds)
# Use UDSAddress instead of msgpackrpc.Address
server.listen(msgpackrpc.udsaddress.UDSAddress('/tmp/exrpc'))
server.start()