Skip to content

Instantly share code, notes, and snippets.

@substring
Created August 5, 2016 12:40
Show Gist options
  • Save substring/0944d7420e6010608f2a99320af3b0d9 to your computer and use it in GitHub Desktop.
Save substring/0944d7420e6010608f2a99320af3b0d9 to your computer and use it in GitHub Desktop.
# Import socket module
import socket
# Create a socket object
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
# Define the port on which you want to connect
port = 55355
# connect to the server on local computer
s.connect(('127.0.0.1', port))
# receive data from the server
print s.send("QUIT")
# close the connection
s.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment