Changeset bf5fdab in rtems-tools


Ignore:
Timestamp:
Nov 27, 2018, 12:24:38 AM (5 months ago)
Author:
Chris Johns <chrisj@…>
Branches:
master
Children:
a1498ab
Parents:
a4fbd16
Message:

tester/tftpd: Set the socket option to reuse.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tester/rt/tftpy/TftpServer.py

    ra4fbd16 rbf5fdab  
    7777            raise TftpException("The tftproot does not exist.")
    7878
     79    def __del__(self):
     80        if self.sock is not None:
     81            try:
     82                self.sock.close()
     83            except:
     84                pass
     85
    7986    def listen(self, listenip="", listenport=DEF_TFTP_PORT,
    8087               timeout=SOCK_TIMEOUT):
     
    9198            # FIXME - sockets should be non-blocking
    9299            self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
     100            self.sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
    93101            self.sock.bind((listenip, listenport))
    94102            _, self.listenport = self.sock.getsockname()
Note: See TracChangeset for help on using the changeset viewer.