ITCPClient


Describes minimum required functionality from TCPClient component. Please note that handler write and read methods which deal with strings are actually send/read string length before sending/reading string data.

You can find more information in comments below. Overrided methods can be found in corresponding base interface.

class ITCPClient :public virtual IComponent
{
public:
    virtual bool isActive() = 0; // Return whether client is active or not 
    virtual float getConnectTimeout() = 0; // Return connection timeout in seconds 
    virtual float getTimeout() = 0; // Return IO timeout in seconds 
    virtual String getServer() = 0; // Return server address 
    virtual int getPort() = 0; // Return server port 
    virtual IClientSocket *getSocket() = 0; // Return handler or nullptr if not connected 

    virtual bool setActive(const bool value) = 0; // Activate(connect)/deactivate(disconnect) 
    virtual bool setConnectTimeout(const float value) = 0;  // Set connect timeout 
    virtual bool setTimeout(const float value) = 0; // Set IO operations timeout 
    virtual bool setServer(const String &value) = 0; // Set server address. Disconnect from current one if connected and new address differs from old one 
    virtual bool setPort(const int value) = 0; // Set port to be connected to. Disconnect from current server if connected and new port differs from old one 
};
Namespace: nitisa::standard
Include: Standard/Components/ITCPClient.h