// ********************************************************************** // // 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_UDP_TRANSCEIVER_H #define ICE_UDP_TRANSCEIVER_H #ifdef __hpux # define _XOPEN_SOURCE_EXTENDED #endif #include #include #include #include #include #include #ifndef _WIN32 # include // For struct sockaddr_storage #endif namespace IceInternal { class UdpEndpoint; class SUdpTransceiver; class UdpTransceiver : public Transceiver { 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); int effectivePort() const; private: UdpTransceiver(const InstancePtr&, const struct sockaddr_storage&, const std::string&, int); UdpTransceiver(const InstancePtr&, const std::string&, int, const std::string&, bool); virtual ~UdpTransceiver(); void setBufSize(const InstancePtr&); friend class UdpEndpointI; friend class UdpConnector; const TraceLevelsPtr _traceLevels; const Ice::LoggerPtr _logger; const Ice::StatsPtr _stats; const bool _incoming; const struct sockaddr_storage _addr; struct sockaddr_storage _mcastAddr; SOCKET _fd; bool _connect; int _rcvSize; int _sndSize; const bool _warn; static const int _udpOverhead; static const int _maxPacketSize; bool _shutdownReadWrite; IceUtil::Mutex _shutdownReadWriteMutex; }; } #endif