Skip to content

Instantly share code, notes, and snippets.

@pfreixes
Created July 17, 2017 14:28
Show Gist options
  • Select an option

  • Save pfreixes/7a85e43642782eb7e7d0669eadd0216a to your computer and use it in GitHub Desktop.

Select an option

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
Copy Markdown
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