sockets - Reading incoming request string in python -


is there way can read incoming message client using 'socket' in python? looking way without using socketserver. doesn't work in case. example, have following piece of code 'accept' incoming connection? how can incoming string this?

import socket  def serve(self):     listener=socket.socket()     listener.bind(('',6000))     listener.listen(5)      while true:         sockadd, c =listener.accept()          # can write accepted request string???          # there way it?  

i have tried listener.recv(1024) gives exception.

help please, in advance.

sockadd socket representing connection client here, use send , receive message client.

data = sockadd.recv(1024)

check socket documentation, there several samples.


Comments

Popular posts from this blog

c# - SelectList with Dictionary, add values to the Dictionary after it's assigned to SelectList -

how can i manage url using .htaccess in php? -

ios - I get the error Property '...' not found on object of type '...' -