Logo 
Search:

Networking Articles

Submit Article
Home » Articles » Networking » TCP/IPRSS Feeds

TCP/IP program to TCP client for TELNET service

Posted By: Milind Mishra     Category: Networking     Views: 3457

TCP/IP program to TCP client for TELNET service.

Code for TCP/IP program to TCP client for TELNET service in Networking

#include <stdlib.h>

char    *host = "localhost";    /* host to use if none supplied        */int    errexit(constchar *format, ...);
int    telnet(constchar *host, constchar *service);

/*------------------------------------------------------------------------ * main - TCP client for TELNET service *------------------------------------------------------------------------ */int
main(int argc, char *argv[])
{
    char    *service = "telnet";    /* default service name        */switch (argc) {
    case 1:    break;
    case 3:
        service = argv[2];
        /* FALL THROUGH */case 2:
        host = argv[1];
        break;
    default:
        errexit("usage: telnet [host [port]]\n");
    }
    telnet(host, service);
    exit(0);
}
  
Share: 


Didn't find what you were looking for? Find more on TCP/IP program to TCP client for TELNET service Or get search suggestion and latest updates.

Milind Mishra
Milind Mishra author of TCP/IP program to TCP client for TELNET service is from India.
 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!