Python SocketServer.DatagramRequestHandler() Examples

The following are 24 code examples of SocketServer.DatagramRequestHandler(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module SocketServer , or try the search function .
Example #1
Source File: test_socketserver.py    From ironpython2 with Apache License 2.0 6 votes vote down vote up
def test_ThreadingUDPServer(self):
        self.run_server(SocketServer.ThreadingUDPServer,
                        SocketServer.DatagramRequestHandler,
                        self.dgram_examine) 
Example #2
Source File: test_socketserver.py    From CTFCrackTools with GNU General Public License v3.0 6 votes vote down vote up
def test_ForkingUDPServer(self):
            with simple_subprocess(self):
                self.run_server(SocketServer.ForkingUDPServer,
                                SocketServer.DatagramRequestHandler,
                                self.dgram_examine)

    # Alas, on Linux (at least) recvfrom() doesn't return a meaningful
    # client address so this cannot work:

    # if HAVE_UNIX_SOCKETS:
    #     def test_UnixDatagramServer(self):
    #         self.run_server(SocketServer.UnixDatagramServer,
    #                         SocketServer.DatagramRequestHandler,
    #                         self.dgram_examine)
    #
    #     def test_ThreadingUnixDatagramServer(self):
    #         self.run_server(SocketServer.ThreadingUnixDatagramServer,
    #                         SocketServer.DatagramRequestHandler,
    #                         self.dgram_examine)
    #
    #     if HAVE_FORKING:
    #         def test_ForkingUnixDatagramServer(self):
    #             self.run_server(SocketServer.ForkingUnixDatagramServer,
    #                             SocketServer.DatagramRequestHandler,
    #                             self.dgram_examine) 
Example #3
Source File: test_socketserver.py    From CTFCrackTools-V2 with GNU General Public License v3.0 6 votes vote down vote up
def test_ForkingUDPServer(self):
            with simple_subprocess(self):
                self.run_server(SocketServer.ForkingUDPServer,
                                SocketServer.DatagramRequestHandler,
                                self.dgram_examine)

    # Alas, on Linux (at least) recvfrom() doesn't return a meaningful
    # client address so this cannot work:

    # if HAVE_UNIX_SOCKETS:
    #     def test_UnixDatagramServer(self):
    #         self.run_server(SocketServer.UnixDatagramServer,
    #                         SocketServer.DatagramRequestHandler,
    #                         self.dgram_examine)
    #
    #     def test_ThreadingUnixDatagramServer(self):
    #         self.run_server(SocketServer.ThreadingUnixDatagramServer,
    #                         SocketServer.DatagramRequestHandler,
    #                         self.dgram_examine)
    #
    #     if HAVE_FORKING:
    #         def test_ForkingUnixDatagramServer(self):
    #             self.run_server(SocketServer.ForkingUnixDatagramServer,
    #                             SocketServer.DatagramRequestHandler,
    #                             self.dgram_examine) 
Example #4
Source File: main.py    From dnsAutoRebinding with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self,*args,**kwargs):
			SocketServer.DatagramRequestHandler.__init__(self, *args, **kwargs) 
Example #5
Source File: test_socketserver.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_UDPServer(self):
        self.run_server(SocketServer.UDPServer,
                        SocketServer.DatagramRequestHandler,
                        self.dgram_examine) 
Example #6
Source File: test_socketserver.py    From CTFCrackTools with GNU General Public License v3.0 5 votes vote down vote up
def test_ThreadingUDPServer(self):
        self.run_server(SocketServer.ThreadingUDPServer,
                        SocketServer.DatagramRequestHandler,
                        self.dgram_examine) 
Example #7
Source File: test_socketserver.py    From CTFCrackTools with GNU General Public License v3.0 5 votes vote down vote up
def test_UDPServer(self):
        self.run_server(SocketServer.UDPServer,
                        SocketServer.DatagramRequestHandler,
                        self.dgram_examine) 
Example #8
Source File: test_socketserver.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_ForkingUDPServer(self):
        with simple_subprocess(self):
            self.run_server(SocketServer.ForkingUDPServer,
                            SocketServer.DatagramRequestHandler,
                            self.dgram_examine) 
Example #9
Source File: test_socketserver.py    From CTFCrackTools-V2 with GNU General Public License v3.0 5 votes vote down vote up
def test_ThreadingUDPServer(self):
        self.run_server(SocketServer.ThreadingUDPServer,
                        SocketServer.DatagramRequestHandler,
                        self.dgram_examine) 
Example #10
Source File: test_socketserver.py    From CTFCrackTools-V2 with GNU General Public License v3.0 5 votes vote down vote up
def test_UDPServer(self):
        self.run_server(SocketServer.UDPServer,
                        SocketServer.DatagramRequestHandler,
                        self.dgram_examine) 
Example #11
Source File: test_socketserver.py    From gcblue with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def test_InterruptServerSelectCall(self):
        with self.mocked_select_module() as mock_select:
            pid = self.run_server(SocketServer.TCPServer,
                                  SocketServer.StreamRequestHandler,
                                  self.stream_examine)
            # Make sure select was called again:
            self.assertGreater(mock_select.called, 1)

    # Alas, on Linux (at least) recvfrom() doesn't return a meaningful
    # client address so this cannot work:

    # @requires_unix_sockets
    # def test_UnixDatagramServer(self):
    #     self.run_server(SocketServer.UnixDatagramServer,
    #                     SocketServer.DatagramRequestHandler,
    #                     self.dgram_examine)
    #
    # @requires_unix_sockets
    # def test_ThreadingUnixDatagramServer(self):
    #     self.run_server(SocketServer.ThreadingUnixDatagramServer,
    #                     SocketServer.DatagramRequestHandler,
    #                     self.dgram_examine)
    #
    # @requires_unix_sockets
    # @requires_forking
    # def test_ForkingUnixDatagramServer(self):
    #     self.run_server(SocketServer.ForkingUnixDatagramServer,
    #                     SocketServer.DatagramRequestHandler,
    #                     self.dgram_examine) 
Example #12
Source File: test_socketserver.py    From gcblue with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def test_ForkingUDPServer(self):
        with simple_subprocess(self):
            self.run_server(SocketServer.ForkingUDPServer,
                            SocketServer.DatagramRequestHandler,
                            self.dgram_examine) 
Example #13
Source File: test_socketserver.py    From gcblue with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def test_ThreadingUDPServer(self):
        self.run_server(SocketServer.ThreadingUDPServer,
                        SocketServer.DatagramRequestHandler,
                        self.dgram_examine) 
Example #14
Source File: test_socketserver.py    From gcblue with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def test_UDPServer(self):
        self.run_server(SocketServer.UDPServer,
                        SocketServer.DatagramRequestHandler,
                        self.dgram_examine) 
Example #15
Source File: test_socketserver.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_UnixDatagramServer(self):
        self.run_server(SocketServer.UnixDatagramServer,
                        SocketServer.DatagramRequestHandler,
                        self.dgram_examine) 
Example #16
Source File: test_socketserver.py    From oss-ftp with MIT License 5 votes vote down vote up
def test_InterruptServerSelectCall(self):
        with self.mocked_select_module() as mock_select:
            pid = self.run_server(SocketServer.TCPServer,
                                  SocketServer.StreamRequestHandler,
                                  self.stream_examine)
            # Make sure select was called again:
            self.assertGreater(mock_select.called, 1)

    # Alas, on Linux (at least) recvfrom() doesn't return a meaningful
    # client address so this cannot work:

    # @requires_unix_sockets
    # def test_UnixDatagramServer(self):
    #     self.run_server(SocketServer.UnixDatagramServer,
    #                     SocketServer.DatagramRequestHandler,
    #                     self.dgram_examine)
    #
    # @requires_unix_sockets
    # def test_ThreadingUnixDatagramServer(self):
    #     self.run_server(SocketServer.ThreadingUnixDatagramServer,
    #                     SocketServer.DatagramRequestHandler,
    #                     self.dgram_examine)
    #
    # @requires_unix_sockets
    # @requires_forking
    # def test_ForkingUnixDatagramServer(self):
    #     self.run_server(SocketServer.ForkingUnixDatagramServer,
    #                     SocketServer.DatagramRequestHandler,
    #                     self.dgram_examine) 
Example #17
Source File: test_socketserver.py    From oss-ftp with MIT License 5 votes vote down vote up
def test_ForkingUDPServer(self):
        with simple_subprocess(self):
            self.run_server(SocketServer.ForkingUDPServer,
                            SocketServer.DatagramRequestHandler,
                            self.dgram_examine) 
Example #18
Source File: test_socketserver.py    From oss-ftp with MIT License 5 votes vote down vote up
def test_ThreadingUDPServer(self):
        self.run_server(SocketServer.ThreadingUDPServer,
                        SocketServer.DatagramRequestHandler,
                        self.dgram_examine) 
Example #19
Source File: test_socketserver.py    From oss-ftp with MIT License 5 votes vote down vote up
def test_UDPServer(self):
        self.run_server(SocketServer.UDPServer,
                        SocketServer.DatagramRequestHandler,
                        self.dgram_examine) 
Example #20
Source File: test_socketserver.py    From BinderFilter with MIT License 5 votes vote down vote up
def test_InterruptServerSelectCall(self):
        with self.mocked_select_module() as mock_select:
            pid = self.run_server(SocketServer.TCPServer,
                                  SocketServer.StreamRequestHandler,
                                  self.stream_examine)
            # Make sure select was called again:
            self.assertGreater(mock_select.called, 1)

    # Alas, on Linux (at least) recvfrom() doesn't return a meaningful
    # client address so this cannot work:

    # if HAVE_UNIX_SOCKETS:
    #     def test_UnixDatagramServer(self):
    #         self.run_server(SocketServer.UnixDatagramServer,
    #                         SocketServer.DatagramRequestHandler,
    #                         self.dgram_examine)
    #
    #     def test_ThreadingUnixDatagramServer(self):
    #         self.run_server(SocketServer.ThreadingUnixDatagramServer,
    #                         SocketServer.DatagramRequestHandler,
    #                         self.dgram_examine)
    #
    #     if HAVE_FORKING:
    #         def test_ForkingUnixDatagramServer(self):
    #             self.run_server(SocketServer.ForkingUnixDatagramServer,
    #                             SocketServer.DatagramRequestHandler,
    #                             self.dgram_examine) 
Example #21
Source File: test_socketserver.py    From BinderFilter with MIT License 5 votes vote down vote up
def test_ForkingUDPServer(self):
            with simple_subprocess(self):
                self.run_server(SocketServer.ForkingUDPServer,
                                SocketServer.DatagramRequestHandler,
                                self.dgram_examine) 
Example #22
Source File: test_socketserver.py    From BinderFilter with MIT License 5 votes vote down vote up
def test_ThreadingUDPServer(self):
        self.run_server(SocketServer.ThreadingUDPServer,
                        SocketServer.DatagramRequestHandler,
                        self.dgram_examine) 
Example #23
Source File: test_socketserver.py    From BinderFilter with MIT License 5 votes vote down vote up
def test_UDPServer(self):
        self.run_server(SocketServer.UDPServer,
                        SocketServer.DatagramRequestHandler,
                        self.dgram_examine) 
Example #24
Source File: test_socketserver.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_ThreadingUnixDatagramServer(self):
        self.run_server(SocketServer.ThreadingUnixDatagramServer,
                        SocketServer.DatagramRequestHandler,
                        self.dgram_examine)