#include "version.h" #include "main.h" #include "util.h" #include "char.h" #include "tcpip_util.h" #include "saacproto_util.h" #include "saacproto_oac.h" #ifdef _OACSTRUCT_TCP #define BACKLOGNUM 5 int oactcptype = -1; static int btime = 0; OACListArray OAC_List[MAXTCPCONNECTION]; int OAC_InitTcpIp( int tcptype, char *addr, int tport) { int tcpdb=0, binport=OAC_PORT; //andy_log log( "_InitTcpIp( %d)\n", tcptype); OAC_InitAclist(); if( MEMBUF_InitSize( CHARDATASIZE * 4 * MAXTCPCONNECTION , tcpdb ) != OK ){ return INIT_SOMEERROR; } if( tport > 0 ) binport = tport; oactcptype = tcptype; switch( tcptype){ case OACTYPE_BIND: if( TCPIP_bindSocket( addr , binport, 0) < 0 ) return INIT_SOMEERROR; break; case OACTYPE_CONNECT: OAC_ReadFileInsertAcList( "oac.lis"); OAC_ConnectOacList(); // if( OAC_ConnectOacList() == 0 ) // return INIT_SOMEERROR; break; default: return INIT_SOMEERROR; } return OK; } int OAC_ConnectOacList( void) { int i=0, cnt=0; for( i=0; i btime){ OAC_CheckConnect(); btime = detime+180; } return 1; } int OAC_ReadMessLine( void) { int i=0, l; char buf[ CHARDATASIZE*4 ]; for( i=0; i= MAXTCPCONNECTION ) break; } fclose( fp); {//andy_log int i; for( i=0; i