libktorrent  2.2.0
Public Types | Public Member Functions | Protected Attributes | List of all members
net::SocketDevice Class Referenceabstract
Inheritance diagram for net::SocketDevice:
Inheritance graph
[legend]

Public Types

enum  State {
  IDLE, CONNECTING, CONNECTED, BOUND,
  CLOSED
}
 

Public Member Functions

 SocketDevice (bt::TransportProtocol proto)
 
virtual Uint32 bytesAvailable () const =0
 
virtual void close ()=0
 
virtual bool connectSuccesFull ()=0
 See if a connectTo was succesfull in non blocking mode.
 
virtual bool connectTo (const Address &addr)=0
 
virtual int fd () const =0
 
virtual const AddressgetPeerName () const =0
 
virtual Address getSockName () const =0
 
virtual bool ok () const =0
 
virtual void prepare (Poll *p, Poll::Mode mode)=0
 Prepare for polling.
 
virtual bool ready (const Poll *p, Poll::Mode mode) const =0
 Check if the socket is ready according to the poll.
 
virtual int recv (bt::Uint8 *buf, int max_len)=0
 
virtual void reset ()=0
 reset the socket (i.e. close it and create a new one)
 
virtual int send (const bt::Uint8 *buf, int len)=0
 
virtual void setBlocking (bool on)=0
 
void setRemoteAddress (const Address &a)
 
virtual bool setTOS (unsigned char type_of_service)=0
 
State state () const
 
bt::TransportProtocol transportProtocol () const
 Get the used transport protocol for this SocketDevice.
 

Protected Attributes

Address addr
 
State m_state
 
bool remote_addr_override
 
bt::TransportProtocol transport_protocol
 

Detailed Description

Definition at line 31 of file socketdevice.h.

Member Function Documentation

◆ setRemoteAddress()

void net::SocketDevice::setRemoteAddress ( const Address a)
inline

Set the remote address, used by Socks to set the actual address.

Parameters
addrThe address

Definition at line 68 of file socketdevice.h.


The documentation for this class was generated from the following file: