We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
return error,should return "INVALID_SOCKET" ... socket_t hostname_connect(const std::string& hostname, int port) { struct addrinfo hints; struct addrinfo *result; struct addrinfo *p; int ret; socket_t sockfd = INVALID_SOCKET; char sport[16]; memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; snprintf(sport, 16, "%d", port); if ((ret = getaddrinfo(hostname.c_str(), sport, &hints, &result)) != 0) { fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(ret)); return 1; //here should return "INVALID_SOCKET" } ...
The text was updated successfully, but these errors were encountered:
No branches or pull requests
return error,should return "INVALID_SOCKET"
...
socket_t hostname_connect(const std::string& hostname, int port) {
struct addrinfo hints;
struct addrinfo *result;
struct addrinfo *p;
int ret;
socket_t sockfd = INVALID_SOCKET;
char sport[16];
memset(&hints, 0, sizeof(hints));
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;
snprintf(sport, 16, "%d", port);
if ((ret = getaddrinfo(hostname.c_str(), sport, &hints, &result)) != 0)
{
fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(ret));
return 1; //here should return "INVALID_SOCKET"
}
...
The text was updated successfully, but these errors were encountered: