UDPserver bug / documentation error?
Richard Brodie
R.Brodie at rl.ac.uk
Fri Jan 7 12:24:52 EST 2000
I was attempting to kludge together a quick UDP server program in Python (1.5.2).
In the handler, h.request is documented as a string containg the received data
but it apparently is a tuple of the data and the socket object.
Any thoughts? My guess is at some point someone decided it might be handy to
have the socket object available but didn't fix the documentation.
class UDPServer(TCPServer):
"""UDP server class."""
socket_type = socket.SOCK_DGRAM
max_packet_size = 8192
def get_request(self):
data, client_addr = self.socket.recvfrom(self.max_packet_size)
return (data, self.socket), client_addr
????????
More information about the Python-list
mailing list