telnetd/UGStub.cpp
/*--- function tcp_send -------------------------------------
 *
 *  Exit:   Returns 0 if success
 */
function tcp_send
Exit:   Returns 0 if success
function tcp_send Exit : Returns 0 if success
short tcp_send (short id,
          unsigned char *buff,
          unsigned short len,
          unsigned short flags)
{
	SOCKET mysock = Connection[id].sock;
   TypConn *pConn = &Connection[id];
   int retcode = send((SOCKET)mysock, (char *)buff, (int) len, 0);
   if(SOCKET_ERROR == retcode || retcode != len) {
      return WSAGetLastError()+20000;
   }
   char mymsg[80];
   if(pConn->ConnDebug>1) {
      FmtDebug("Sending %d bytes:",len);
   }
   if(pConn->ConnDebug>1) {
      wsprintf(mymsg,"Snd to id %d: ",id);
      Dout(mymsg,(char *)buff,(int)len);
   }
	return 0;
}
short tcp_send ( short id , unsigned char * buff , unsigned short len , unsigned short flags ) { SOCKET mysock = Connection [ id ] . sock ; TypConn * pConn = & Connection [ id ] ; int retcode = send ( ( SOCKET ) mysock , ( char * ) buff , ( int ) len , 0 ) ; if ( SOCKET_ERROR == retcode || retcode != len ) { return WSAGetLastError ( ) + 20000 ; } char mymsg [ 80 ] ; if ( pConn -> ConnDebug > 1 ) { FmtDebug ( " " , len ) ; } if ( pConn -> ConnDebug > 1 ) { wsprintf ( mymsg , " " , id ) ; Dout ( mymsg , ( char * ) buff , ( int ) len ) ; } return 0 ; }
function tcp_send
  Exit:   Returns 0 if success
function tcp_send Exit : Returns 0 if success