Logo 
Search:

Networking Articles

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

TCP/IP program to do output processing to the socket

Posted By: Milind Mishra     Category: Networking     Views: 2082

TCP/IP program to do output processing to the socket.

Code for TCP/IP program to do output processing to the socket in Networking

#include <sys/types.h>
#include <stdio.h>
#include "tnfsm.h"externstruct fsm_trans    sostab[];
externint        sostate;
extern u_char        sofsm[][NCHRS];

int
sowrite(FILE *sfp, FILE *tfp, u_char *buf, int cc)
{
    struct fsm_trans    *pt;
    int            i, ki;

    for (i=0; i<cc; ++i) {
        int    c = buf[i];

        ki = sofsm[sostate][c];
        pt = &sostab[ki];

        if ((pt->ft_action)(sfp, tfp, c) < 0)
            sostate = KSREMOTE;    /* an error occurred    */else
            sostate = pt->ft_next;
    }
}
  
Share: 


Didn't find what you were looking for? Find more on TCP/IP program to do output processing to the socket Or get search suggestion and latest updates.

Milind Mishra
Milind Mishra author of TCP/IP program to do output processing to the socket 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!