(self, address, conf, log, fd=None)
| 19 | class BaseSocket: |
| 20 | |
| 21 | def __init__(self, address, conf, log, fd=None): |
| 22 | self.log = log |
| 23 | self.conf = conf |
| 24 | |
| 25 | self.cfg_addr = address |
| 26 | if fd is None: |
| 27 | sock = socket.socket(self.FAMILY, socket.SOCK_STREAM) |
| 28 | bound = False |
| 29 | else: |
| 30 | sock = socket.fromfd(fd, self.FAMILY, socket.SOCK_STREAM) |
| 31 | os.close(fd) |
| 32 | bound = True |
| 33 | |
| 34 | self.sock = self.set_options(sock, bound=bound) |
| 35 | |
| 36 | def __str__(self): |
| 37 | return "<socket %d>" % self.sock.fileno() |
no test coverage detected