Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4bbe475

Browse files
committed
client connect via 127.0.0.1 rather than *
1 parent e7a9c6a commit 4bbe475

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

README.rst

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,22 +38,22 @@ Call the server from the command-line
3838

3939
Now, in another terminal, call the exposed module::
4040

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"
4343
"2011/03/07"
4444

4545
Since the client usecase is the most common one, "--client" is the default
4646
parameter, and you can remove it safely::
4747

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"
5050
"2011/03/07"
5151

5252
Moreover, since the most common usecase is to *connect* (as opposed to *bind*)
5353
you can also omit "--connect"::
5454

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"
5757
"2011/03/07"
5858

5959

@@ -63,8 +63,8 @@ See remote service documentation
6363
You can introspect the remote service; it happens automatically if you don't
6464
specify the name of the function you want to call::
6565

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"
6868
tzset tzset(zone)
6969
ctime ctime(seconds) -> string
7070
clock clock() -> floating point number
@@ -85,17 +85,17 @@ Specifying non-string arguments
8585
Now, see what happens if we try to call a function expecting a non-string
8686
argument::
8787

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"
9090
Traceback (most recent call last):
9191
[...]
9292
TypeError: a float is required
9393

9494
That's because all command-line arguments are handled as strings. Don't worry,
9595
we can specify any kind of argument using JSON encoding::
9696

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"
9999
[wait for 3 seconds...]
100100
null
101101

0 commit comments

Comments
 (0)