#ifndef _LISTENER_SOCKETCONNECTIONRECEIVER_HPP_ #define _LISTENER_SOCKETCONNECTIONRECEIVER_HPP_ #include #include #include #include #include #include #include #include #include #include #include #include class SocketConnectionReceiver { public: SocketConnectionReceiver(int socket, sockaddr_in inernalSocketAddress); virtual ~SocketConnectionReceiver(); void close(void); private: static constexpr size_t BUFFER_LENGTH=65536; // this is the buffer length for the socket void threadFunction(int data); bool handlePut(Block &commands); size_t readLine(String &line); size_t expectPacket(void); size_t read(Array &buffer); String restoreFileName(Block block,DWORD startIndex,DWORD endIndex); friend class SocketServer; char mBuffer[BUFFER_LENGTH] = {0}; int mSocket; sockaddr_in mInternalSocketAddress; }; #endif