Skip to content

Instantly share code, notes, and snippets.

@bergundy
Created March 12, 2012 23:00
Show Gist options
  • Save bergundy/2025259 to your computer and use it in GitHub Desktop.
Save bergundy/2025259 to your computer and use it in GitHub Desktop.
from tornado.util import b
import socket
import sys
MB = 0x100000
dlen = 5 * MB
data = b("A") * dlen + "\r\n"
port = 16661
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0)
s.connect((sys.argv[1, port))
print s.recv(1024)
s.send(data)
print s.recv(1024)
# sample runner:
# for x in `seq 100`; do python2.7 simple_client.py & done; time wait
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment