Created
February 17, 2015 10:29
-
-
Save hyperair/63d53924460b00349dc5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import socket | |
| import sys | |
| port = int(sys.argv[1]) | |
| s = socket.socket(socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_TCP) | |
| s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) | |
| s.bind(('127.0.0.1', 12345)) | |
| s.connect(('localhost', port)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment