Browse Source

codec: test.py: use 127.0.0.1 always for localhost

Without it, while tests passed on linux, they failed on OS X.

This fixes the consistency.
Ugorji Nwoke 8 years ago
parent
commit
5038cc52f7
1 changed files with 3 additions and 3 deletions
  1. 3 3
      codec/test.py

+ 3 - 3
codec/test.py

@@ -84,7 +84,7 @@ def doRpcServer(port, stopTimeSec):
         def EchoStruct(self, msg):
             return ("%s" % msg)
     
-    addr = msgpackrpc.Address('localhost', port)
+    addr = msgpackrpc.Address('127.0.0.1', port)
     server = msgpackrpc.Server(EchoHandler())
     server.listen(addr)
     # run thread to stop it after stopTimeSec seconds if > 0
@@ -96,14 +96,14 @@ def doRpcServer(port, stopTimeSec):
     server.start()
 
 def doRpcClientToPythonSvc(port):
-    address = msgpackrpc.Address('localhost', port)
+    address = msgpackrpc.Address('127.0.0.1', port)
     client = msgpackrpc.Client(address, unpack_encoding='utf-8')
     print client.call("Echo123", "A1", "B2", "C3")
     print client.call("EchoStruct", {"A" :"Aa", "B":"Bb", "C":"Cc"})
    
 def doRpcClientToGoSvc(port):
     # print ">>>> port: ", port, " <<<<<"
-    address = msgpackrpc.Address('localhost', port)
+    address = msgpackrpc.Address('127.0.0.1', port)
     client = msgpackrpc.Client(address, unpack_encoding='utf-8')
     print client.call("TestRpcInt.Echo123", ["A1", "B2", "C3"])
     print client.call("TestRpcInt.EchoStruct", {"A" :"Aa", "B":"Bb", "C":"Cc"})