mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
The usual.
This commit is contained in:
parent
887d072cc0
commit
e03c050595
25 changed files with 363 additions and 181 deletions
|
@ -265,7 +265,12 @@ class UDPServer(TCPServer):
|
|||
max_packet_size = 8192
|
||||
|
||||
def get_request(self):
|
||||
return self.socket.recvfrom(self.max_packet_size)
|
||||
data, client_addr = self.socket.recvfrom(self.max_packet_size)
|
||||
return (data, self.socket), client_addr
|
||||
|
||||
def server_activate(self):
|
||||
# No need to call listen() for UDP.
|
||||
pass
|
||||
|
||||
|
||||
if hasattr(socket, 'AF_UNIX'):
|
||||
|
@ -411,4 +416,4 @@ class DatagramRequestHandler(BaseRequestHandler):
|
|||
self.wfile = StringIO.StringIO(self.packet)
|
||||
|
||||
def finish(self):
|
||||
self.socket.send(self.wfile.getvalue())
|
||||
self.socket.sendto(self.wfile.getvalue(), self.client_address)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue