Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 229751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T19:47:31+00:00 2026-05-11T19:47:31+00:00

Ping is not working. Telnet is not an option, sending a mail also. Preferably

  • 0

Ping is not working. Telnet is not an option, sending a mail also. Preferably a function from a library that returns true or false.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T19:47:32+00:00Added an answer on May 11, 2026 at 7:47 pm

    If by working you mean open, you can just connect to the port and see if the socket opens successfully.

    If you mean that it’s accepting valid SMTP over SSL, then you’d need a library that connects and issues a trivial SMTP command like HELO or something.

    Chilkat has library code and examples for this.

    Example connect code for win32:

    #include <winsock2.h>
    #include <ws2tcpip.h>
    #include <wspiapi.h>
    
    void tryconnect(const char * host, const char * port)
    {
        SOCKET Socket = INVALID_SOCKET;
        struct addrinfo *resAddrInfo = NULL;
        struct addrinfo *ptr = NULL;
        struct addrinfo hints;
        int result = 0;
    
        printf("Connecting to %s:%s\n", host, port);
    
        ZeroMemory(&hints, sizeof(hints));
        hints.ai_family = AF_UNSPEC;
        hints.ai_socktype = SOCK_STREAM;
        hints.ai_protocol = IPPROTO_TCP;
    
        result = getaddrinfo(host, port, &hints, &resAddrInfo);
        if (result != 0)
        {
            printError("getaddrinfo failed");
            return;
        }
    
        ptr = resAddrInfo;
        Socket = WSASocket(ptr->ai_family, ptr->ai_socktype, ptr->ai_protocol, NULL, 0, WSA_FLAG_OVERLAPPED);
        if (Socket == INVALID_SOCKET)
        {
            printError("Error Creating Socket");
            freeaddrinfo(resAddrInfo);
            return;
        }
    
        result = WSAConnect(Socket, ptr->ai_addr, (int)ptr->ai_addrlen, NULL, NULL, NULL, NULL);
        if (result != 0)
        {
            printError("Error Connecting");
            closesocket(Socket);
            freeaddrinfo(resAddrInfo);
            return;
        }
    
        freeaddrinfo(resAddrInfo);
        printf("Success!\n\n");
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to call ping from c++ code.I'd like to easily read the output
So I have this c# application that needs to ping my web server thats
can somebody tell me why my code is not working? class Connection { public
I found more source codes which are working like ping. My only problem with
I wrote a little program, which is working like a ping command(i use ICMPSendEcho2),
I'm working on something similar to a pastebin (yeah, it's that generic) but allowing
I want to ping a site in my ruby code and saw that net-ping
I can ping using console app, but I want to ping from ASP.NET, the
Starting from Ameer Dawood ideea of ping from JS ( pinger ), I've got
Is it always possible to ping localhost and it resolves to 127.0.0.1? I know

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.