#ifndef __SOCKETPORT_H_INCL__ #define __SOCKETPORT_H_INCL__ #include // standard input / output functions #include #include // string function definitions #include // File control definitions #include // Error number definitions #ifdef __linux__ #include // UNIX standard function definitions #include #include #include #include #include #else //#include #include #include #include #endif #include "transportSocket.h" /** * TODO: Add class description * * @author Gagua */ class socketPort : public transportSocket { private: basicLogCollection *m_pLog; CSTR m_sHostName; #ifdef __linux__ struct sockaddr_in serv_addr; int m_nSocketFD; #else SOCKET m_nSocketFD; #endif int m_nPort; bool m_bKeepAlive; bool _connect( void ); protected: int sendBlock(unsigned char *Data, int DataSize); int recptBlock(unsigned char *Buffer, int *BufferLength); public: // Constructor socketPort(); socketPort(CSTR URI); socketPort(CSTR Host, int Port, bool KeepALive = true); // Destructor virtual ~socketPort(); bool disconnect(void); bool connectTo(CSTR Host, int Port); bool reconnect(void){ return _connect(); }; bool isConnected(void){ return m_bConnected; }; void setKeepAlive(bool Param); bool getKeepAlive(void){ return m_bKeepAlive; }; }; #endif // __SOCKETPORT_H_INCL__