#!/usr/bin/python import gats import socket import time s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) s.bind(('', 5051)) s.listen(1) conn, addr = s.accept() print 'Connected by', addr while 1: print 'Reading...' obj = gats.recv( conn ) print 'Read',obj gats.send( {'recvAddr': addr, 'recvTime': time.time(), 'recvObj': obj }, conn ) conn.close()