- Timestamp:
- Apr 23, 2018 8:08:37 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/tests/serial/loopback.py
r70797 r71988 49 49 self.oSock = socket.socket(socket.AF_INET, socket.SOCK_STREAM); 50 50 self.oSock.settimeout(iTimeout); 51 self.oSock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1); 51 52 self.oSock.bind((sHost, int(sPort))); 52 53 self.oSock.listen(1); … … 56 57 if self.oConn is not None: 57 58 self.oConn.close(); 59 if self.oSock is not None: 60 self.oSock.close(); 61 self.oSock = None; 62 63 def shutdown(self): 64 if self.oConn is not None: 65 self.oConn.close(); 66 self.oConn = None; 58 67 self.oSock.close(); 68 self.oSock = None; 59 69 60 70 def pumpIo(self): … … 85 95 86 96 def __del__(self): 87 self.oConn.close(); 97 if self.oConn is not None: 98 self.oConn.close(); 99 100 def shutdown(self): 101 if self.oConn is not None: 102 self.oConn.close(); 103 self.oConn = None; 88 104 89 105 def pumpIo(self): … … 113 129 if self.oConn is not None: 114 130 self.oConn.close(); 131 if self.oSock is not None: 132 self.oSock.close(); 133 self.oSock = None; 134 135 def shutdown(self): 136 if self.oConn is not None: 137 self.oConn.close(); 138 self.oConn = None; 115 139 self.oSock.close(); 140 self.oSock = None; 116 141 117 142 def pumpIo(self): … … 141 166 142 167 def __del__(self): 143 self.oConn.close(); 168 if self.oConn is not None: 169 self.oConn.close(); 170 171 def shutdown(self): 172 if self.oConn is not None: 173 self.oConn.close(); 174 self.oConn = None; 144 175 145 176 def pumpIo(self): … … 196 227 self.fShutdown = True; 197 228 self.oLock.release(); 229 self.oIoPumper.shutdown(); 198 230 199 231 def isShutdown(self):
Note:
See TracChangeset
for help on using the changeset viewer.