Changeset 57970 in vbox
- Timestamp:
- Sep 30, 2015 2:56:34 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
-
include/iprt/udp.h (modified) (1 diff)
-
src/VBox/Runtime/r3/udp.cpp (modified) (3 diffs)
-
src/VBox/Runtime/testcase/tstRTUdp-1.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/udp.h
r57957 r57970 156 156 * @param pszAddress The address to connect to. 157 157 * @param uPort The port to connect to. 158 * @param p DefaultDstAddr A default destination address for sending data159 * through this socket, can beNULL.158 * @param pLocalAddr The local address to bind this socket to, can be 159 * NULL. 160 160 * @param pSock Where to store the handle to the established connection. 161 161 */ 162 RTR3DECL(int) RTUdpCreateClientSocket(const char *pszAddress, uint32_t uPort, PRTNETADDR p DefaultDstAddr, PRTSOCKET pSock);162 RTR3DECL(int) RTUdpCreateClientSocket(const char *pszAddress, uint32_t uPort, PRTNETADDR pLocalAddr, PRTSOCKET pSock); 163 163 164 164 /** @} */ -
trunk/src/VBox/Runtime/r3/udp.cpp
r57958 r57970 688 688 689 689 690 RTR3DECL(int) RTUdpCreateClientSocket(const char *pszAddress, uint32_t uPort, PRTNETADDR p DefaultDstAddr, PRTSOCKET pSock)690 RTR3DECL(int) RTUdpCreateClientSocket(const char *pszAddress, uint32_t uPort, PRTNETADDR pLocalAddr, PRTSOCKET pSock) 691 691 { 692 692 /* … … 695 695 AssertReturn(uPort > 0, VERR_INVALID_PARAMETER); 696 696 AssertPtrReturn(pszAddress, VERR_INVALID_POINTER); 697 AssertPtrReturn(pSock, VERR_INVALID_POINTER); 697 698 698 699 /* … … 712 713 { 713 714 RTSocketSetInheritance(Sock, false /* fInheritable */); 714 rc = rtSocketBind(Sock, &Addr); 715 if (pLocalAddr) 716 rc = rtSocketBind(Sock, pLocalAddr); 715 717 if (RT_SUCCESS(rc)) 716 718 { 717 if (pDefaultDstAddr) 718 rc = rtSocketConnect(Sock, pDefaultDstAddr, RT_SOCKETCONNECT_DEFAULT_WAIT); 719 rc = rtSocketConnect(Sock, &Addr, RT_SOCKETCONNECT_DEFAULT_WAIT); 719 720 if (RT_SUCCESS(rc)) 720 721 { -
trunk/src/VBox/Runtime/testcase/tstRTUdp-1.cpp
r57957 r57970 30 30 #include <iprt/string.h> 31 31 #include <iprt/test.h> 32 33 #define RT_TEST_UDP_CLIENT_ADDRESS "localhost"34 #define RT_TEST_UDP_CLIENT_PORT 5200135 32 36 33 /* Server address must be "localhost" */ … … 99 96 int rc; 100 97 RTSOCKET hSocket; 101 RTTESTI_CHECK_RC(rc = RTUdpCreateClientSocket(RT_TEST_UDP_CLIENT_ADDRESS, RT_TEST_UDP_CLIENT_PORT, &ServerAddress, &hSocket), 102 VINF_SUCCESS); 98 RTTESTI_CHECK_RC(rc = RTUdpCreateClientSocket(RT_TEST_UDP_LOCAL_HOST, RT_TEST_UDP_SERVER_PORT, NULL, &hSocket), VINF_SUCCESS); 103 99 if (RT_SUCCESS(rc)) 104 100 {
Note:
See TracChangeset
for help on using the changeset viewer.

