Logo 
Search:

Networking Articles

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

TCP/IP program to suspend execution temporarily

Posted By: Milind Mishra     Category: Networking     Views: 2095

TCP/IP program to suspend execution temporarily.

Code for TCP/IP program to suspend execution temporarily in Networking

#include <sys/types.h>
#include <sys/signal.h>
#include <stdio.h>
#include <string.h>

#include "local.h"externstruct termios    tntty;

/*ARGSUSED*/int
suspend(FILE *sfp, FILE *tfp, int c)
{
    if (tcgetattr(0, &tntty) < 0)    /* save current tty state    */
        errexit("can't get tty modes: %s\n", strerror(errno));
    if (tcsetattr(0, TCSADRAIN, &oldtty) < 0) /* restore old state    */
        errexit("can't set tty modes: %s\n", strerror(errno));

    (void) kill(0, SIGTSTP);

    if (tcgetattr(0, &oldtty) < 0)    /* may have changed        */
        errexit("can't get tty modes: %s\n", strerror(errno));
    if (tcsetattr(0, TCSADRAIN, &tntty) < 0) /* back to telne modes*/
        errexit("can't set tty modes: %s\n", strerror(errno));
    return 0;
}
  
Share: 


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

Milind Mishra
Milind Mishra author of TCP/IP program to suspend execution temporarily 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!