Skip to content

Commit

Permalink
Updated requests dependency.
Browse files Browse the repository at this point in the history
  • Loading branch information
Neoklosch committed Jun 27, 2019
1 parent f5e142e commit d3f07d9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 28 deletions.
32 changes: 5 additions & 27 deletions samples/zeromq/capabilities_request/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import zmq

context = zmq.Context()
server = context.socket(zmq.REP)
client = context.socket(zmq.REQ)


Expand All @@ -16,34 +15,13 @@ def signal_handler(signal, frame):


def main():
server.bind("tcp://*:5555")
client.connect("tcp://172.18.0.11:5091")

server_thread = threading.Thread(target=start_server, args=())
server_thread.daemon = True
server_thread.start()
client.send_string("")

client.connect("tcp://localhost:5555")

for request in range(10):
print("Sending request %s" % request)
client.send_string("Hello ")

# Get the reply.
message = client.recv_string()
print("Received reply %s [ %s ]" % (request, message))


def start_server():
while True:
# Wait for next request from client
message = server.recv_string()
print("Received request: %s" % message)

# Do some 'work'
sleep(1)

# Send reply back to client
server.send_string("World")
# Get the reply.
message = client.recv_string()
print("Received reply %s [ %s ]" % (1, message))


if __name__ == '__main__':
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def run(self):
'pytz==2017.2',
'PyYAML==3.12',
'pyzmq==16.0.2',
'requests==2.13.0',
'requests==2.22.0',
'Rx==1.5.9',
'sanic==0.5.2',
'six==1.10.0',
Expand Down

0 comments on commit d3f07d9

Please sign in to comment.