title: How to send a message from the server to a client using sockets
body: <p>Server</p>
  
  <pre><code>import socket
  import sys
  HOST = ''
  PORT = 9000
  s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  print 'Socket created'
  try:
      s.bind((HOST, PORT))
  except socket.error , msg:
      print 'Bind failed. Error Code : ' + str(msg[0]) + ' Message ' + msg[1]
      sys.exit()
  print 'Socket bind complete'
  s.listen(10)
  print 'Socket now listening'
  conn, addr = s.accept()
  print 'Connecting from: ' + addr[0] + ':' + str(addr[1])
  while 1:
      message=raw_input("&gt;")
      s.sendto(message, (addr[0], addr[1]))
      print(s.recv(1024))
  </code></pre>
  
  <p>How do I make this send a message to the client?
  I can make it reply to a string the client sends to the server, but in this case I want the server to send the first message...
  Can anyone help me, The solutions on google don't seem to work properly and I'm not sure what I'm doing wrong.</p>