Implement writing to a connection