Problem w/New Server

junkster at rochester.rr.com junkster at rochester.rr.com
Thu Sep 14 17:54:53 CEST 2000


I'm working on adapting some code to work with UDP & TCP/IP... And
to me, it appears like it should work.....

This is using Socket_Server....

def server(serverlog, host, port, backlog, update_time):
	try:
		tcp_server = TCPServer (('', 37), MyRequestHandler)
		tcp_server.request_queue_size = backlog
		udp_server = UDPServer (('', 37), MyRequestHandler)
		udp_server.request_queue_size = backlog
	except error:
		serverlog.write_status ('error', 'Unable to Open Port')
#        .....
#        ..... Cut to save Bandwidth
#        .....
        While 1:
 		polling_speed = .5
			#
			#	Check for a TCP Connection, and then
process it.
			#
                ready_read, ready_write, in_error = select.select
([tcp_server.fileno()], [], [], 0)
		if ready_read:
			tcp_server.handle_request()

			#
			#	Check for a UDP Connection, and then
process it.
			#
                ready_read, ready_write, in_error = select.select (
[udp_server.fileno()], [], [], 0)
		if ready_read:
			print "udp"
			udp_server.handle_request()
		time.sleep(.5)

UDP's "ready_read", never seems to be anything but a empty set...
And the client application, never gets any further than the socket.recv
(4) line in the code.... No error messages, nothing, just sits there...

Any suggestions?



Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list