Cross-Platform C++

ot::net
class DatagramSocketImpl  (abstract)

#include "ot/net/DatagramSocketImpl.h"

ot::ManagedObject An abstract base class providing an interface for classes that implement datagram sockets. OpenTop is supplied with an undocumented PlainDatagramSocketImpl class which provides a default implementation.




Method Summary
protected  virtual void bind(InetAddress* pAddress, int port)=0
         Binds this socket to the specified port and IP address.
protected  virtual void close()=0
         Closes the underlying operating system socket.
protected  virtual void connect(InetAddress* pAddress, int port)=0
         Connects a datagram socket to an IP address/port.
protected  virtual void create()=0
        
protected  virtual void disconnect()=0
        
protected  virtual RefPtr< InetAddress > getInetAddress() const=0
        
protected  virtual int getIntOption(int level, int option) const=0
        
protected  virtual RefPtr< InetAddress > getLocalAddress() const=0
        
protected  virtual int getLocalPort() const=0
        
protected  virtual int getPort() const=0
        
protected  virtual RefPtr< SocketDescriptor > getSocketDescriptor() const=0
        
protected  virtual size_t getTimeout() const=0
        
protected  virtual void getVoidOption(int level, int option, void* pOut, size_t* pLen) const=0
        
protected  virtual bool isBound() const=0
        
protected  virtual bool isClosed() const=0
        
protected  virtual bool isConnected() const=0
        
protected  virtual void receive(DatagramPacket& p)=0
        
protected  virtual void send(const DatagramPacket& p)=0
        
protected  virtual void setIntOption(int level, int option, int value)=0
        
protected  virtual void setTimeout(size_t timeoutMS)=0
        
protected  virtual void setVoidOption(int level, int option, void* pValue, size_t valLen)=0
        
protected  virtual String toString() const=0
        

Methods inherited from class ot::ManagedObject
addRef, getRefCount, onFinalRelease, operator=, release

Method Detail

bind

protected virtual void bind(InetAddress* pAddress,
                            int port)=0
Binds this socket to the specified port and IP address.

Parameters:
pAddress - the IP address to bind to. A null pointer means that the socket will be bound to ANY local interface.
port - the port number.
Exceptions:
SocketException - if an error occurs binding the socket.

close

protected virtual void close()=0
Closes the underlying operating system socket. In common with most close() methods, further calls to close() have no effect.


connect

protected virtual void connect(InetAddress* pAddress,
                               int port)=0
Connects a datagram socket to an IP address/port.

Parameters:
pAddress - the remote IP address
port - the port number
Exceptions:
SocketException - if an error occurs trying to connect to the host

create

protected virtual void create()=0


disconnect

protected virtual void disconnect()=0


getInetAddress

protected virtual RefPtr< InetAddressgetInetAddress() const=0


getIntOption

protected virtual int getIntOption(int level,
                                   int option) const=0


getLocalAddress

protected virtual RefPtr< InetAddressgetLocalAddress() const=0


getLocalPort

protected virtual int getLocalPort() const=0


getPort

protected virtual int getPort() const=0


getSocketDescriptor

protected virtual RefPtr< SocketDescriptorgetSocketDescriptor() const=0


getTimeout

protected virtual size_t getTimeout() const=0


getVoidOption

protected virtual void getVoidOption(int level,
                                     int option,
                                     void* pOut,
                                     size_t* pLen) const=0


isBound

protected virtual bool isBound() const=0


isClosed

protected virtual bool isClosed() const=0


isConnected

protected virtual bool isConnected() const=0


receive

protected virtual void receive(DatagramPacket& p)=0


send

protected virtual void send(const DatagramPacket& p)=0


setIntOption

protected virtual void setIntOption(int level,
                                    int option,
                                    int value)=0


setTimeout

protected virtual void setTimeout(size_t timeoutMS)=0


setVoidOption

protected virtual void setVoidOption(int level,
                                     int option,
                                     void* pValue,
                                     size_t valLen)=0


toString

protected virtual String toString() const=0



Cross-Platform C++

Found a bug or missing feature? Please email us at support@elcel.com

Copyright © 2000-2003 ElCel Technology   Trademark Acknowledgements