/***************************************************************************** * FileName : netport.h * * Programmer : Li Liangchu * * Writen at : 2004.07.21 * * Version : * * Description: base on net comm sports driver * * Last modify: 2004.07.21 * *****************************************************************************/ #ifndef __NET_PORT_H_ICL__ #define __NET_PORT_H_ICL__ #include "common.h" BYTE CreateUdpSock(int *CommSock, DWORD NetPort, DWORD NetCommIpAddr); BYTE CreateTcpServerSock(int *LiSock, DWORD NetPort); BYTE CreateTcpClientSock(int *CommSock, DWORD NetPort, DWORD NetCommIpAddr); // 设置及时知道TCP非优雅的方式断开连接的socket属性 //void set_keepalive(int fd, int keep_alive, int keep_idle, int keep_interval, int keep_count); void OpenNetPort( int commid); void CloseNetPort( int commid ); void CloseNetListenPort( int commid ); void UdpRecv(int commid, int fds, u_long ipaddr); void UdpSend(int commid); BOOL TcpRecv(int commid, int fds, u_long ipaddr); void TcpSend(int commid); // 检查连接服务器端口的客户端ip地址配置的端口 void TcpAccept(int commid, int lisfds); void PollAllPort(void); #endif