You call socket.write(). See the documentation.