samurai 0.1.5

Very early stage user-space P2P network protocol.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import socket
from datetime import datetime

HOST='localhost'
PORT=9393
MAX_MSG=512

sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.bind((HOST, PORT))

sock.listen(1)

while True:
    connection, client_address = sock.accept()
    data = connection.recv(MAX_MSG)
    print("[{}] [{}]: {}".format(datetime.now(), client_address[0], data.decode()))