@@ -38,22 +38,22 @@ Call the server from the command-line
38
38
39
39
Now, in another terminal, call the exposed module::
40
40
41
- $ zerorpc --client --connect tcp://* :1234 strftime %Y/%m/%d
42
- Connecting to "tcp://* :1234"
41
+ $ zerorpc --client --connect tcp://127.0.0.1 :1234 strftime %Y/%m/%d
42
+ Connecting to "tcp://127.0.0.1 :1234"
43
43
"2011/03/07"
44
44
45
45
Since the client usecase is the most common one, "--client" is the default
46
46
parameter, and you can remove it safely::
47
47
48
- $ zerorpc --connect tcp://* :1234 strftime %Y/%m/%d
49
- Connecting to "tcp://* :1234"
48
+ $ zerorpc --connect tcp://127.0.0.1 :1234 strftime %Y/%m/%d
49
+ Connecting to "tcp://127.0.0.1 :1234"
50
50
"2011/03/07"
51
51
52
52
Moreover, since the most common usecase is to *connect * (as opposed to *bind *)
53
53
you can also omit "--connect"::
54
54
55
- $ zerorpc tcp://* :1234 strftime %Y/%m/%d
56
- Connecting to "tcp://* :1234"
55
+ $ zerorpc tcp://127.0.0.1 :1234 strftime %Y/%m/%d
56
+ Connecting to "tcp://127.0.0.1 :1234"
57
57
"2011/03/07"
58
58
59
59
@@ -63,8 +63,8 @@ See remote service documentation
63
63
You can introspect the remote service; it happens automatically if you don't
64
64
specify the name of the function you want to call::
65
65
66
- $ zerorpc tcp://* :1234
67
- Connecting to "tcp://* :1234"
66
+ $ zerorpc tcp://127.0.0.1 :1234
67
+ Connecting to "tcp://127.0.0.1 :1234"
68
68
tzset tzset(zone)
69
69
ctime ctime(seconds) -> string
70
70
clock clock() -> floating point number
@@ -85,17 +85,17 @@ Specifying non-string arguments
85
85
Now, see what happens if we try to call a function expecting a non-string
86
86
argument::
87
87
88
- $ zerorpc tcp://* :1234 sleep 3
89
- Connecting to "tcp://* :1234"
88
+ $ zerorpc tcp://127.0.0.1 :1234 sleep 3
89
+ Connecting to "tcp://127.0.0.1 :1234"
90
90
Traceback (most recent call last):
91
91
[...]
92
92
TypeError: a float is required
93
93
94
94
That's because all command-line arguments are handled as strings. Don't worry,
95
95
we can specify any kind of argument using JSON encoding::
96
96
97
- $ zerorpc --json tcp://* :1234 sleep 3
98
- Connecting to "tcp://* :1234"
97
+ $ zerorpc --json tcp://127.0.0.1 :1234 sleep 3
98
+ Connecting to "tcp://127.0.0.1 :1234"
99
99
[wait for 3 seconds...]
100
100
null
101
101
0 commit comments