Changeset 24895 in vbox for trunk/src/VBox/Main
- Timestamp:
- Nov 24, 2009 12:30:13 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ConsoleImplTeleporter.cpp
r24878 r24895 285 285 AssertReturn(pState->mfIsSource, VERR_INVALID_HANDLE); 286 286 287 /* Poll for incoming NACKs and errors from the other side */288 int rc = RTTcpSelectOne(pState->mhSocket, 0);289 if (rc != VERR_TIMEOUT)290 {291 if (RT_SUCCESS(rc))292 {293 LogRel(("Teleporter/TCP: Incoming data found before write, assuming it's a cancel.\n"));294 rc = VERR_SSM_CANCELLED;295 }296 else297 LogRel(("Teleporter/TCP: RTTcpSelectOne -> %Rrc before write.\n", rc));298 return rc;299 }300 301 287 for (;;) 302 288 { … … 305 291 Hdr.u32Magic = TELEPORTERTCPHDR_MAGIC; 306 292 Hdr.cb = RT_MIN((uint32_t)cbToWrite, TELEPORTERTCPHDR_MAX_SIZE); 307 rc = RTTcpWrite(pState->mhSocket, &Hdr, sizeof(Hdr));293 int rc = RTTcpWrite(pState->mhSocket, &Hdr, sizeof(Hdr)); 308 294 if (RT_FAILURE(rc)) 309 295 { … … 483 469 484 470 /** 471 * @copydoc SSMSTRMOPS::pfnIsOk 472 */ 473 static DECLCALLBACK(int) teleporterTcpOpIsOk(void *pvUser) 474 { 475 TeleporterState *pState = (TeleporterState *)pvUser; 476 477 if (pState->mfIsSource) 478 { 479 /* Poll for incoming NACKs and errors from the other side */ 480 int rc = RTTcpSelectOne(pState->mhSocket, 0); 481 if (rc != VERR_TIMEOUT) 482 { 483 if (RT_SUCCESS(rc)) 484 { 485 LogRel(("Teleporter/TCP: Incoming data detect by IsOk, assuming it's a cancel.\n")); 486 rc = VERR_SSM_CANCELLED; 487 } 488 else 489 LogRel(("Teleporter/TCP: RTTcpSelectOne -> %Rrc (IsOk).\n", rc)); 490 return rc; 491 } 492 } 493 494 return VINF_SUCCESS; 495 } 496 497 498 /** 485 499 * @copydoc SSMSTRMOPS::pfnClose 486 500 */ … … 522 536 teleporterTcpOpTell, 523 537 teleporterTcpOpSize, 538 teleporterTcpOpIsOk, 524 539 teleporterTcpOpClose, 525 540 SSMSTRMOPS_VERSION
Note:
See TracChangeset
for help on using the changeset viewer.