Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

socket.accept python

socket_server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
socket_server.bind(('localhost', 5555))
socket_server.listen(5)
            
while True:
	conn, addr = socket_server.accept()
	print('Connected by', addr)
	with conn:
		while True:
			data = conn.recv(1024)
				if not data: break
 
PREVIOUS NEXT
Tagged: #python
ADD COMMENT
Topic
Name
3+2 =