Major Update:
- FunctionCore
- Replace Channel->Ready with Channel->State (off/waiting/ready)
- Add Function reference to Handle
- SelectableBare/Core:
- Implement async address resolve with event handling
- Create ResolveHandler() signal handler (friend) function
- Change Create/Remove/DestroyHandle() methods to virtual methods
- Move socket specific code to SelectableCore
- Rename ChangeState() to virtual HandleState()
- Move ClearHandle() from SelectableBare -> SelectableCore
- Implement new/delete from THandle
- Set max TCP SYN count on connect
This commit is contained in:
@@ -17,6 +17,12 @@
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
// Enumarate Types
|
||||
typedef enum { CH_off = 0, CH_wait = 1, CH_ready = 2 } EChannelState;
|
||||
const char ChannelStateName[][15] = { "Off", "Waiting", "Ready" };
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
// Preview
|
||||
typedef struct SChannel TChannel;
|
||||
typedef struct SChannelLink TChannelLink;
|
||||
@@ -32,7 +38,7 @@ struct SChannel
|
||||
|
||||
TChannelLink * FirstLink = NULL; // List of channels linked for input/output
|
||||
|
||||
bool Ready = false; // Channel ready to receive input
|
||||
EChannelState State = CH_off; // Channel ready to receive input
|
||||
|
||||
TChannel * Next = NULL;
|
||||
};
|
||||
@@ -112,10 +118,10 @@ public:
|
||||
inline const char * GetType() { return Type; };
|
||||
|
||||
// Manage Channels
|
||||
virtual TChannel * AddChannel( const char * ChannelName, const bool Ready );
|
||||
virtual TChannel * AddChannel( const char * ChannelName, const EChannelState State );
|
||||
|
||||
virtual bool SetChannelState( TChannel * Channel, const bool Ready );
|
||||
virtual bool ChannelStateEvent( TChannel * Channel, const char * SourceRef, const bool Ready );
|
||||
virtual bool SetChannelState( TChannel * Channel, const EChannelState State );
|
||||
virtual bool ChannelStateEvent( TChannel * Channel, const char * SourceRef, const EChannelState State );
|
||||
|
||||
// Pushing Data Output -> Input
|
||||
virtual int Output( const char * ChannelName, const char * TargetRef, const bool SourceRef, const char * Data, int Len = -1 );
|
||||
|
||||
Reference in New Issue
Block a user