src\libnet\Interface\INet.h
First u must set callback address...
//callback when connect host succeed
virtual bool CSetConnectedCall(const CALL_FUN pcntedfun) = 0;
//callback when connected failed
virtual bool CSetConnectFailedCall(const CALL_FUN pcntfailedfun) = 0;
//callback when break
virtual bool CSetConnectionBreakCall(const CALL_FUN pbreakfun) = 0;
//callback when recv msg
virtual bool CSetRecvCall(const CALL_FUN precvfun) = 0;
//callback when a new remoter connected
virtual bool CSetNewConCall(const CALL_FUN precvfun) = 0;
Use this interface start net event
//async listen
virtual bool CListen(const char * ip, const u16 port, const u16 count = 200) = 0;
//async connect
virtual bool CConnectEx(const char * ip, const u16 port, const void * buff = NULL, const u32 size = 0) = 0;
//close link
virtual bool CClose(const u16 conid) = 0;
//async send msg
virtual bool CSendMsg(const u16 conid, const void * buff, const u16 size) = 0;
//get remote info
virtual bool CGetRemoteInfo(const u16 conid, const char * & ip, u16 & port) = 0;
//start network thread
virtual void CStartLoop(u32 waitTime = 5, bool demon = false) = 0;
-
Notifications
You must be signed in to change notification settings - Fork 1
854825967/mylib
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
liblog,libnet
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published