7#include "DeviceSocketDefinitions.h"
589 DeclareGetClassType();
593 virtual bool CheckDeviceLibraries()
const override;
596 virtual void SendOnConnecting();
597 virtual void SendOnConnected();
598 virtual void SendOnDisconnecting();
599 virtual void SendOnDisconnected();
604 virtual const CResult ConnectWithTimeout(SOCKET hSocket,
const sockaddr_in& sockAddrIn, uint32_t u32TimeoutSec);
605 virtual bool IsInternetAvailable(uint32_t u32TimeoutSec = 2);
614 volatile SOCKET m_hSocket;
615 volatile bool m_bTrouble;
616 int32_t m_i32BlockSize;
622 bool m_bPacketDataLogging;
624 int64_t m_i64PacketData;
626 SOCKADDR_IN m_sockAddr;
628 static WSADATA m_wsaData;
629 static int64_t m_i64WsaInitCount;
631 int64_t m_i64CumulativeSentBytes;
632 int64_t m_i64CumulativeRecvBytes;
636 friend class CDeviceSocketClientManager;
637 friend class CDeviceSocketClientASCIIManager;
638 friend class CDeviceSocketServerASCII;
639 friend class CDeviceSocketClientASCII;
Data class.
Definition FLData.h:30
Template type string class.
Definition FLString.h:34
RSA cryptography class.
Definition RSACryptography.h:30
FLImaging module execution result object.
Definition ResultsDef.h:1704
CDeviceBase()
Default constructor.
CDeviceSocketBase * GetParent() const
Get the pointer to the parent(server) socket.
virtual void SetCommLogging(bool bCommLogging)
Set whether to output communication logs.
virtual const CResult Terminate() override
Perform socket shutdown.
virtual bool IsBlockTransferMode() const
Check if the transfer mode is block transfer mode.
int64_t GetCumulativeRecvBytes() const
Get the cumulative received bytes.
const CResult GetPrivateKey(Base::CFLData &fldModulus, Base::CFLData &fldPublicExponent, Base::CFLData &fldPrivateExponent) const
Get the private key.
virtual const CResult Initialize() override
Perform socket initialization. Socket mode settings and connection information settings must be done ...
virtual const CResult SetConnectionIPAddress(const char *pU8Address, uint16_t u16Port)
Set the IP address to connect to.
const SOCKADDR_IN * GetSockAddrIn() const
Get the socket address in the form of SOCKADDR_IN*.
virtual ESocketMode GetSocketMode()
Returns socket mode.
virtual bool IsPacketDataLogging() const
Check whether packet byte logging is enabled.
const CResult AddSentBytes(int64_t i64SentBytes)
Adds the sent bytes value to the cumulative sent bytes.
virtual bool IsPassiveMode() const
Check if the connection is in passive mode.
const CResult ResetCumulativeRecvBytes()
Reset cumulative received bytes.
CDeviceSocketBase()
Default constructor.
virtual int64_t GetSocket() const
Get a socket with the int64_t type.
virtual void SetPacketDataLogging(bool bPacketDataLogging)
Enable or disable packet byte logging.
virtual bool IsFLProtocol() const
Check if the protocol is FLProtocol.
virtual bool IsLogging() const
Get whether to output logs.
virtual void SetLogging(bool bLogging)
Set whether to output logs.
const CResult SetPublicKey(const Base::CFLData &fldModulus, const Base::CFLData &fldPublicExponent)
Set the public key.
int64_t GetCumulativeSentBytes() const
Get the cumulative sent bytes.
const CResult ResetCumulativeSentBytes()
Reset cumulative sent bytes.
const Base::CFLString< char > & GetDNS() const
Get the DNS set with the SetConnectionDNSAddress function.
const CResult AddRecvBytes(int64_t i64RecvBytes)
Adds the received bytes value to the cumulative received bytes.
virtual ~CDeviceSocketBase()
Default destructor.
virtual const CResult SetConnectionDNSAddress(const char *pDNSAddress, uint16_t u16Port)
Set the DNS address to connect to.
virtual int32_t GetBlockSize() const
Get the current block size for data transfer.
const CResult GetIPAddress(uint8_t arrU8IPAddr[4]) const
Get an IP address.
virtual CDeviceSocketPacketDistinguisher * GetSocketPacketDistinguisher() const
Get a CDeviceSocketPacketDistinguisher object.
virtual const CResult SetSocketMode(ESocketMode eSocketMode=ESocketMode_FLProtocol_Passive_Plain)
Set socket mode.
virtual const CResult SetBlockSize(int32_t i32BlockSize)
Set the block size for data transfer.
virtual const CResult AssignSocketPacketDistinguisher(CDeviceSocketPacketDistinguisher *pSocketPacketDistinguisher)
Set CDeviceSocketPacketDistinguisher.
virtual bool IsCommLogging() const
Get whether to output communication logs.
const CResult SetPrivateKey(const Base::CFLData &fldModulus, const Base::CFLData &fldPublicExponent, const Base::CFLData &fldPrivateExponent)
Set the private key.
virtual int64_t GetPacketDataLoggingSize() const
Get the number of packet bytes to be displayed in logs.
const CResult GetPublicKey(Base::CFLData &fldModulus, Base::CFLData &fldPublicExponent) const
Get the public key.
uint16_t GetPort() const
Get the port number currently in use.
virtual void ClearSocketPacketDistinguisher()
Clear CDeviceSocketPacketDistinguisher.
virtual const CResult SetPacketDataLoggingSize(int64_t i64PacketDataLoggingSize)
Set the number of packet bytes to be displayed in logs.
const CResult CreateKeyPair(uint32_t u32Bits)
Create a key pair to be used for security.
virtual bool IsSecured() const
Gets whether to transmit securely.
A class that dispatches packets to their registered procedures based on packet type.
Definition DeviceSocketPacketDistinguisher.h:31
Socket packet class.
Definition DeviceSocketPacket.h:22
Socket Server Class.
Definition DeviceSocketServer.h:29
Definition AutoFileCleaner.h:19
ESocketMode
Definition of socket mode used for communication.
Definition DefinitionsDevices.h:29
@ ESocketMode_FLProtocol_Passive_Plain
FLProtocol Passive mode with Plain communication.
Definition DefinitionsDevices.h:33