crossroads

Git mirror of https://crossroads.e-tunity.com/
git clone git://git.finwo.net/app/crossroads
Log | Files | Refs

copysockets.c (683B)


      1 /*************************************************************************
      2  * This file is part of Crosroads 1.23, a load balancer and fail over
      3  * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL.
      4  * Visit http://crossroads.e-tunity.com for information.
      5  *************************************************************************/
      6 #include "crossroads.h"
      7 
      8 void copysockets (int clientsock, int serversock) {
      9     unsigned char buf[TCP_BUFSZ];
     10 
     11     /* Copy between client and server. Function net_copy() will
     12      * stop itself when either an error is seen, or when no more
     13      * data are there. */
     14     while (1)
     15 	net_copy (clientsock, serversock, TCP_BUFSZ, buf);
     16 }