Changeset 86114 in vbox for trunk/src/VBox
- Timestamp:
- Sep 13, 2020 5:52:04 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Serial/DrvTCP.cpp
r84688 r86114 136 136 137 137 /** 138 * Closes the connection. 139 * 140 * @returns nothing. 141 * @param pThis The TCP driver instance. 142 */ 143 static void drvTcpConnectionClose(PDRVTCP pThis) 144 { 145 Assert(pThis->hTcpSock != NIL_RTSOCKET); 146 147 int rc = RTPollSetRemove(pThis->hPollSet, DRVTCP_POLLSET_ID_SOCKET); 148 AssertRC(rc); 149 150 if (pThis->fIsServer) 151 RTTcpServerDisconnectClient2(pThis->hTcpSock); 152 else 153 RTSocketClose(pThis->hTcpSock); 154 pThis->hTcpSock = NIL_RTSOCKET; 155 ASMAtomicDecU32(&pThis->cConnections); 156 } 157 158 159 /** 138 160 * Checks the wakeup pipe for events. 139 161 * … … 260 282 /* On error we close the socket here. */ 261 283 if (fEvtsRecv & RTPOLL_EVT_ERROR) 262 { 263 rc = RTPollSetRemove(pThis->hPollSet, DRVTCP_POLLSET_ID_SOCKET); 264 AssertRC(rc); 265 266 if (pThis->fIsServer) 267 RTTcpServerDisconnectClient2(pThis->hTcpSock); 268 else 269 RTSocketClose(pThis->hTcpSock); 270 pThis->hTcpSock = NIL_RTSOCKET; 271 ASMAtomicDecU32(&pThis->cConnections); 272 /* Continue with polling. */ 273 } 284 drvTcpConnectionClose(pThis); /* Continue with polling afterwards. */ 274 285 else 275 286 { … … 328 339 if (!cbRead && rc != VINF_TRY_AGAIN) 329 340 { 330 rc = RTPollSetRemove(pThis->hPollSet, DRVTCP_POLLSET_ID_SOCKET); 331 AssertRC(rc); 332 333 if (pThis->fIsServer) 334 RTTcpServerDisconnectClient2(pThis->hTcpSock); 335 else 336 RTSocketClose(pThis->hTcpSock); 337 pThis->hTcpSock = NIL_RTSOCKET; 341 drvTcpConnectionClose(pThis); 338 342 rc = VINF_SUCCESS; 339 343 }
Note:
See TracChangeset
for help on using the changeset viewer.