// ********************************************************************** // // Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. // // ********************************************************************** #ifndef ICE_TCP_TRANSCEIVER_H #define ICE_TCP_TRANSCEIVER_H #include #include #include #include #include namespace IceInternal { class TcpConnector; class TcpAcceptor; class TcpTransceiver : public Transceiver { enum State { StateNeedConnect, StateConnectPending, StateConnected }; public: virtual SOCKET fd(); virtual void close(); virtual bool write(Buffer&); virtual bool read(Buffer&); virtual std::string type() const; virtual std::string toString() const; virtual SocketStatus initialize(); virtual void checkSendSize(const Buffer&, size_t); private: TcpTransceiver(const InstancePtr&, SOCKET, bool); virtual ~TcpTransceiver(); friend class TcpConnector; friend class TcpAcceptor; const TraceLevelsPtr _traceLevels; const Ice::LoggerPtr _logger; const Ice::StatsPtr _stats; SOCKET _fd; State _state; std::string _desc; #ifdef _WIN32 int _maxPacketSize; #endif }; } #endif