[Tutor] Socket Programming

Navneet rocklearnpython at gmail.com
Thu Jan 26 16:22:05 CET 2012


Hi,

I am trying to create a chat program.(Programs are attached)
Please find the code below, where I am having the problem.

def run( self ):
     while 1:
             print "Hello There !!!!"
         print self.descriptors
         # Await an event on a readable socket descriptor
             (sread, swrite, sexc) = select.select( self.descriptors, 
[], [] )
         print sexc
             # Iterate through the tagged read descriptors
         print sread
             print "Hello There 1 !!!!"
         for sock in sread:


For this I am getting the output as below:
bash-3.1$ python Server.py
Enter the Port:...9009
ChatServer started on port 9009
Hello There !!!!
[<socket._socketobject object at 0x0000000002487660>]


But it is not printing the value of sread or "Hello There 1 !!!!!"





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20120126/dc130fa7/attachment.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Server.py
URL: <http://mail.python.org/pipermail/tutor/attachments/20120126/dc130fa7/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: testclientchat.py
URL: <http://mail.python.org/pipermail/tutor/attachments/20120126/dc130fa7/attachment-0001.ksh>


More information about the Tutor mailing list