Changeset 91024 in vbox for trunk/src/VBox/Devices/Audio
- Timestamp:
- Aug 31, 2021 9:56:26 AM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 146665
- Location:
- trunk/src/VBox/Devices/Audio
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/AudioTestService.cpp
r91023 r91024 1002 1002 * for every new client. 1003 1003 */ 1004 bool fFromServer; 1004 1005 PATSTRANSPORTCLIENT pTransportClient; 1005 rc = pThis->pTransport->pfnWaitForConnect(pThis->pTransportInst, 1000 /* msTimeout */, & pTransportClient);1006 rc = pThis->pTransport->pfnWaitForConnect(pThis->pTransportInst, 1000 /* msTimeout */, &fFromServer, &pTransportClient); 1006 1007 if (RT_FAILURE(rc)) 1007 1008 continue; … … 1032 1033 LogRelFunc(("Creating new client structure failed with out of memory error\n")); 1033 1034 pThis->pTransport->pfnNotifyBye(pThis->pTransportInst, pTransportClient); 1035 rc = VERR_NO_MEMORY; 1036 break; /* This is fatal, break out of the loop. */ 1037 } 1038 1039 if (RT_SUCCESS(rc)) 1040 { 1041 LogRelFunc(("New connection established (%s)\n", fFromServer ? "from server" : "as client")); 1042 1043 /** 1044 * If the new client is from a remote server (also called a reverse connection) 1045 * instead from this server, exit this loop and stop trying to connect to the remote server. 1046 * 1047 * Otherwise we would connect lots and lots of clients without any real use. 1048 * 1049 ** @todo Improve this handling -- there might be a better / more elegant solution. 1050 */ 1051 if (fFromServer) 1052 break; 1034 1053 } 1035 1054 } … … 1050 1069 int AudioTestSvcInit(PATSSERVER pThis, PCATSCALLBACKS pCallbacks) 1051 1070 { 1071 LogRelFlowFuncEnter(); 1072 1052 1073 RT_BZERO(pThis, sizeof(ATSSERVER)); 1053 1074 … … 1097 1118 LogRel(("Creating server failed with %Rrc\n", rc)); 1098 1119 1120 LogRelFlowFuncLeaveRC(rc); 1099 1121 return rc; 1100 1122 } -
trunk/src/VBox/Devices/Audio/AudioTestServiceClient.cpp
r90984 r91024 331 331 { 332 332 rc = pClient->pTransport->pfnWaitForConnect(pClient->pTransportInst, 333 msTimeout, &pClient->pTransportClient);333 msTimeout, NULL /* pfFromServer */, &pClient->pTransportClient); 334 334 if (RT_SUCCESS(rc)) 335 335 { -
trunk/src/VBox/Devices/Audio/AudioTestServiceInternal.h
r90962 r91024 128 128 * Use RT_INDEFINITE_WAIT to wait indefinitely. 129 129 * This might or might not be supported by the specific transport implementation. 130 * @param pfFromServer Returns \c true if the returned client is from a remote server (called a reverse connection), 131 * or \c false if not (regular client). Optional and can be NULL. 130 132 * @param ppClientNew Where to return the allocated client on success. 131 133 */ 132 DECLR3CALLBACKMEMBER(int, pfnWaitForConnect, (PATSTRANSPORTINST pThis, RTMSINTERVAL msTimeout, PPATSTRANSPORTCLIENT ppClientNew));134 DECLR3CALLBACKMEMBER(int, pfnWaitForConnect, (PATSTRANSPORTINST pThis, RTMSINTERVAL msTimeout, bool *pfFromServer, PPATSTRANSPORTCLIENT ppClientNew)); 133 135 134 136 /** -
trunk/src/VBox/Devices/Audio/AudioTestServiceTcp.cpp
r91023 r91024 321 321 * @interface_method_impl{ATSTRANSPORT,pfnWaitForConnect} 322 322 */ 323 static DECLCALLBACK(int) atsTcpWaitForConnect(PATSTRANSPORTINST pThis, RTMSINTERVAL msTimeout, PPATSTRANSPORTCLIENT ppClientNew) 323 static DECLCALLBACK(int) atsTcpWaitForConnect(PATSTRANSPORTINST pThis, RTMSINTERVAL msTimeout, 324 bool *pfFromServer, PPATSTRANSPORTCLIENT ppClientNew) 324 325 { 325 326 PATSTRANSPORTCLIENT pClient = (PATSTRANSPORTCLIENT)RTMemAllocZ(sizeof(ATSTRANSPORTCLIENT)); … … 338 339 pClient->fFromServer = true; 339 340 rc = RTTcpServerListen2(pThis->pTcpServer, &pClient->hTcpClient); 340 LogRelFlowFunc(("RTTcpServerListen2 -> %Rrc\n", rc));341 LogRelFlowFunc(("RTTcpServerListen2(%RTsock) -> %Rrc\n", pClient->hTcpClient, rc)); 341 342 } 342 343 else if (pThis->enmConnMode == ATSCONNMODE_CLIENT) … … 423 424 if (RT_SUCCESS(rc)) 424 425 { 426 if (pfFromServer) 427 *pfFromServer = pClient->fFromServer; 425 428 *ppClientNew = pClient; 426 429 }
Note:
See TracChangeset
for help on using the changeset viewer.