title: Python How to distinguish data in python socket module(when server receive.)
body: <p>I don't know how to distinguish data which received in server.</p>
  
  <p>I want to distinguish the data by setting MessageID(example name) when I send data or receive data.</p>
  
  <p>Here's the example.:</p>
  
  <p>server</p>
  
  <pre><code>import socket
  s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  host=''
  port=int(input(Please Enter the port:))
  s.bind((host,port))
  s.listen(1)
  conn, addr = s.accept()
  print('Someone connected.He :%s'%addr)
  while True:
      data=conn.recv(1024,MessageID) # I want to make this.
      print(data)
  </code></pre>
  
  <p>client</p>
  
  <pre><code>import socket
  s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  host=''
  port=int(input(Please Enter the port:))
  s.connect((host,port))
  data='hello world'
  data=data.encode('utf-8') # I encoded data because Python 3.3.3's socket module doesn't
  work with string(str) when I send data.
  s.send(data,MessageID) # This is what I want.I want to set messageID which can        distinguish data.
  </code></pre>
  
  <hr>
  
  <p>How to make like this?</p>
  
  <p>How other programmers distinguish data in python..?</p>
  
  <p>I really want is : Don't receive if not messageID which server want.</p>