Q: How to UDPServer ??
Ripper John
drjohn at 21cn.edu.cn
Thu Jan 2 02:03:07 EST 2003
More information about the Python-list mailing list
Thu Jan 2 02:03:07 EST 2003
- Previous message (by thread): Q: How to UDPServer ??
- Next message (by thread): Q: How to UDPServer ??
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
"Peter Hansen" <peter at engcorp.com> дÈëÏûÏ¢ÐÂÎÅ :3E136F3A.5DA5E216 at engcorp.com... > "Å£·à" wrote: > > > > I have some problems in the quote_srv.py I write as below, quote server on > > TCP works well, but I can get no message on the UDP mode, are there some > > problems in the QutoeMyxinHandler ?? > > > if __name__=='__main__': > > UDPQuoteSrv = UDPServer( ('', quote_port), UDPQuoteHandler ) > > TCPQuoteSrv = TCPServer( ('', quote_port), TCPQuoteHandler ) > > > > UDPQuoteSrv.server_activate() > > TCPQuoteSrv.serve_forever() > > Looks to me like you need to call serve_forever() on the UDPQuoteSrv > as well, but of course you can't do that on both servers from the > same thread and get useful results. Try changing the last line above > to use the UDPQuoteSrv and see if it works. > > (There may be other mistakes, but this one just stood out. I can't > be sure this is the only problem you have as I haven't tried to run > the code.) > > -Peter > You are right! serve_forever() can work! But, how can I run both servers in a .py file?
- Previous message (by thread): Q: How to UDPServer ??
- Next message (by thread): Q: How to UDPServer ??
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list