text

dan

·

server

·

Plain Text

·

Total Size: 377 B

·

·

Created: 8 months ago

·

Edited: 8 months ago

import socket serversocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) serversocket.bind(('localhost', 8089)) serversocket.listen(5) # become a server socket, maximum 5 connections while True: connection, address = serversocket.accept() buf = connection.recv(64) if len(buf) > 0: print buf break

The server portion of a python socket

2 bits

141 views

Are you sure you want to delete?