3
# Drizzle Client & Protocol Library
5
# Copyright (C) 2008-2010 Eric Day (eday@oddments.org)
8
# Use and distribution licensed under the BSD license. See
9
# the COPYING.BSD file in the root source directory for full text.
12
Send an infinite amount of data to a MySQL server.
19
parser = optparse.OptionParser(add_help_option=False)
21
parser.add_option("--help", action="help", help="Print out help details")
22
parser.add_option("-h", "--host", dest="host", default="localhost",
23
help="Host or IP to test", metavar="HOST")
24
parser.add_option("-p", "--port", dest="port", default=3306,
25
help="Port to test", metavar="PORT")
27
(options, args) = parser.parse_args()
29
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
30
s.connect((options.host, int(options.port)))
31
print 'Connected to %s:%s' % (options.host, options.port)
33
server_header = s.recv(1024)
34
print 'Server Header:'
35
print list(server_header)
38
print 'Each . represents 16MB of data:'
40
# Max packet size plus sequence number '1'.
41
packet = '\xFF\xFF\xFF\x01'
44
# Keep sending max size packets, causes infinite loop in my_net_skip_rest.
48
# Send 16777215 bytes.
49
for x in range(0, 2047):