fusion/mw/tcpserver/mw_tcpserver.h

36 lines
724 B
C
Raw Normal View History

2025-08-05 07:53:44 +00:00
#ifndef __MW_TCPSERVER__
#define __MW_TCPSERVER__
#include <stdint.h>
#include "list.h"
#include "kpacket.h"
#include "json_packet.h"
#include "hloop.h"
#include "hbase.h"
#include "hthread.h"
typedef struct tcpserver{
int8_t status;// 'I' idle(initial), 'R' running, 'E' exit
hloop_t *loop;
int16_t stack_size;
iobuffer read_iobuf;
hthread_t th;
hio_t *hio; /*连接的hio, 如果多个则自动选择, 最快那个*/
}tcpserver;
tcpserver *tcpserver_init(int stack_size);
/**
* close掉后面连接的
**/
int32_t tcpserver_deinit(tcpserver *tclient);
void tcpserver_test();
#endif /* __MW_TCPSERVER__ */