Changeset 57955 in vbox for trunk/src/VBox/Runtime
- Timestamp:
- Sep 29, 2015 10:26:31 PM (9 years ago)
- svn:sync-xref-src-repo-rev:
- 102934
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/udp.cpp
r57944 r57955 687 687 } 688 688 689 690 RTR3DECL(int) RTUdpCreateClientSocket(const char *pszAddress, uint32_t uPort, PRTSOCKET pSock) 691 { 692 /* 693 * Validate input. 694 */ 695 AssertReturn(uPort > 0, VERR_INVALID_PARAMETER); 696 AssertPtrReturn(pszAddress, VERR_INVALID_POINTER); 697 698 /* 699 * Resolve the address. 700 */ 701 RTNETADDR Addr; 702 int rc = RTSocketParseInetAddress(pszAddress, uPort, &Addr); 703 if (RT_FAILURE(rc)) 704 return rc; 705 706 /* 707 * Create the socket and connect. 708 */ 709 RTSOCKET Sock; 710 rc = rtSocketCreate(&Sock, AF_INET, SOCK_DGRAM, 0); 711 if (RT_SUCCESS(rc)) 712 { 713 RTSocketSetInheritance(Sock, false /* fInheritable */); 714 rc = rtSocketBind(Sock, &Addr); 715 if (RT_SUCCESS(rc)) 716 { 717 *pSock = Sock; 718 return VINF_SUCCESS; 719 } 720 RTSocketClose(Sock); 721 } 722 return rc; 723 }
Note:
See TracChangeset
for help on using the changeset viewer.