Skip to content

Instantly share code, notes, and snippets.

@pfreixes
Created July 17, 2017 14:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pfreixes/7a85e43642782eb7e7d0669eadd0216a to your computer and use it in GitHub Desktop.
Save pfreixes/7a85e43642782eb7e7d0669eadd0216a to your computer and use it in GitHub Desktop.
import socket
import time
s = socket.socket(
socket.AF_INET, socket.SOCK_STREAM)
s.connect(("localhost", 6379))
# give enought time to get the
# data plus the RST Package
time.sleep(1)
# read the data
print(s.recv(100))
@pfreixes
Copy link
Author

Output of the execution

$ python test_socket.py
b'-ERR max number of clients reached\r\n'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment