Important Updates:

- FunctionCore:
  - Output() returns largest no of bytes written to linked input
- SelectableCore:
  - Auto-manage:
    - Add AutoManage param -> Persistent
    - Will automatic open port if written to when Auto-Manage enabled
    - Will keep port open (re-open if closed) if Persistent = true
  - DNS resolve:
    - Set AddressFailed if port could not open/bind
    - Only use next resolved address if current address failed
This commit is contained in:
Charl Wentzel
2017-11-18 17:06:32 +02:00
parent abba077ed0
commit 7ef3d71af9
3 changed files with 74 additions and 14 deletions

View File

@@ -75,7 +75,9 @@ struct SHandle {
// State
int FD;
EConnectState State;
bool AutoManage;
bool Persistent;
// Callback functions
FHandleCallback StateCallback[ 6 ];
@@ -89,6 +91,7 @@ struct SHandle {
char * PortName; // Socket port no or protocol, e.g. "80" or "HTTP"
struct addrinfo * AddressList; // List of resolved IP Addresses for host name
struct addrinfo * AddressInfo; // Current selected IP Address
bool AddressFailed; // Indicate failure to connect to address
bool KeepAlive; // Socket keep alive
// Buffers
@@ -241,7 +244,7 @@ public:
THandle * CreateHandle( const char * HandleName, bool CreateChannel );
bool SetCallback( THandle * Handle, EConnectState pState, FHandleCallback pCallback );
bool SetAutoManage( THandle * Handle, bool AutoManage, int ReopenTime = 0 );
bool SetAutoManage( THandle * Handle, bool AutoManage, bool Persistent, int ReopenTime = 0 );
bool SetBuffers( THandle * Handle, int InBufSize, int OutBufSize, int InTimeout, const char * InMarker, int InMarkerLen );
bool SerialConfig( THandle * Handle, int Baud, short DataBits, short StopBits, short Parity, short FlowCtrl, int Wait );