listen to a port and write to it