-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTCPServer.h
executable file
·45 lines (32 loc) · 1.01 KB
/
TCPServer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: TCPServer.h
* Author: senjord
*
* Created on 27 марта 2018 г., 14:09
*/
#ifndef TCPSERVER_H
#define TCPSERVER_H
#include "XSocket.h"
#ifdef __cplusplus
extern "C" {
#endif
DLL_EXPORT SST *InitServer(int domain, int type, int flags, int protocol, int rbuflen);
DLL_EXPORT int SetCallBacksS(SST *serv,
void (*OnConnected)(SST *serv, SCT *cl),
int (*OnRead)(SST *serv, SCT *cl, char *buf, int len),
int (*OnWrite)(SST *serv, SCT *cl, int len),
void (*OnDisconnected)(SST *serv, SCT *cl),
void (*OnErr)(SST *serv,SCT *cl, int err));
DLL_EXPORT int Listen(SST *, char *host, char *port);
DLL_EXPORT void Todeaf(SST *serv);
DLL_EXPORT int SendToClient(SCT *cl, char *buf, int len);
DLL_EXPORT void FinitServer(SST *);
#ifdef __cplusplus
}
#endif
#endif /* TCPSERVER_H */