Skip to content

Instantly share code, notes, and snippets.

@madwayz
Created August 11, 2019 14:21
Show Gist options
  • Select an option

  • Save madwayz/82de42d1d09dd798844c764bfecabe0d to your computer and use it in GitHub Desktop.

Select an option

Save madwayz/82de42d1d09dd798844c764bfecabe0d to your computer and use it in GitHub Desktop.
Socket сервер
import socket
ADDRESS = '127.0.0.1'
PORT = 7777
with socket.socket() as s:
s.bind((ADDRESS, PORT))
s.listen(1)
connectionObject, address = s.accept()
connectionObject.sendall(b'Hello, World!')
while True:
with connectionObject:
data = connectionObject.recv(1024)
print(data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment