Skip to content
Browse files

Send the most minimal body for connecting in produce.py

  • Loading branch information...
1 parent 46110f1 commit 25e5e23d3eca769e221bccd8d93926b134d84f0c @jedahan jedahan committed Nov 30, 2011
Showing with 2 additions and 5 deletions.
  1. +2 −5 produce.py
View
7 produce.py
@@ -32,11 +32,8 @@ def produce(hostname, api_key, swarm_id, resource_id, wrap):
#Sleep required to allow the swarm server time to respond with header
time.sleep(1)
- #Send a blank message to open the connection
- stripped_msg = '{"message": {"to": ["' + swarm_id + '"], "payload":}}'
- size = hex(len(stripped_msg))[2:] + "\r\n"
- chunk = stripped_msg + "\r\n"
- conn.send(size+chunk)
+ #Send a blank http body to open the connection
+ conn.send('2\r\n\n\n\r\n')
#Execute further messages
if wrap == False:

0 comments on commit 25e5e23

Please sign in to comment.
Something went wrong with that request. Please try again.