text: __author__ = 'arun'
  # Echo client program
  import socket
  import sys
  
  HOST = '0:0:0:0:0:0:0:1'    # The remote host
  PORT = 50007              # The same port as used by the server
  s = None
  for res in socket.getaddrinfo(HOST, PORT, socket.AF_UNSPEC, socket.SOCK_STREAM):
      af, socktype, proto, canonname, sa = res
      try:
          print "Client "
          print "af : ", af
          #s = socket.socket(socket.AF_INET, socktype, proto)
          s = socket.socket(socket.AF_INET)
      except socket.error as msg:
          s = None
          continue
      try:
          print "sa : ", sa
          sa = ('127.0.0.1', '50007')
          s.connect(sa)
      except socket.error as msg:
          s.close()
          s = None
          continue
      break
  if s is None:
      print 'could not open socket'
      sys.exit(1)
  s.sendall('Hello, world')
  data = s.recv(1024)
  s.close()
  print 'Received', repr(data)