MCPcopy Create free account
hub / github.com/Tencent/Hardcoder / toSockaddr

Function toSockaddr

libapp2sys/src/main/cpp/util.h:144–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

142}
143
144static sockaddr_in toSockaddr(const char *ip, uint16_t port) {
145 struct sockaddr_in addr = {0};
146 addr.sin_family = AF_INET;
147 addr.sin_port = htons(port);
148 inet_pton(AF_INET, ip, &(addr.sin_addr));
149 return addr;
150}
151
152static int sockaddrToIpPort(struct sockaddr_in addr, std::string *ip, int *pPort) {
153 char a[32] = {0};

Callers 1

startMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected