libfilezilla
Public Member Functions | Protected Member Functions | List of all members
socket_interface Class Referenceabstract

Interface for sockets. More...

#include <socket.hpp>

Inheritance diagram for socket_interface:
Inheritance graph
[legend]
Collaboration diagram for socket_interface:
Collaboration graph
[legend]

Public Member Functions

 socket_interface (socket_interface const &)=delete
 
socket_interfaceoperator= (socket_interface const &)=delete
 
virtual int read (void *buffer, unsigned int size, int &error)=0
 
virtual int write (void const *buffer, unsigned int size, int &error)=0
 
virtual void set_event_handler (event_handler *pEvtHandler)=0
 
virtual native_string peer_host () const =0
 
virtual int peer_port (int &error) const =0
 
virtual int connect (native_string const &host, unsigned int port, address_type family=address_type::unknown)=0
 
virtual fz::socket_state get_state () const =0
 
virtual int shutdown ()=0
 Signals peers that we want to close the connections. More...
 
virtual int shutdown_read ()=0
 
- Public Member Functions inherited from socket_event_source
socket_event_sourceroot () const
 Gets the root source. More...
 

Protected Member Functions

 socket_interface (socket_event_source *root)
 
- Protected Member Functions inherited from socket_event_source
 socket_event_source (socket_event_source *root)
 

Additional Inherited Members

- Protected Attributes inherited from socket_event_source
socket_event_source *const root_ {}
 

Detailed Description

Interface for sockets.

Can be used for layers, see fz::socket for the expexted semantics.

Member Function Documentation

◆ shutdown()

virtual int shutdown ( )
pure virtual

Signals peers that we want to close the connections.

Only disallows further sends, does not affect reading from the socket.

Returns 0 on success, an erorr code otherwise. If it returns EGAIN, shutdown is not yet complete. Call shutdown again after the next write event.

Implemented in socket, tls_layer, and rate_limited_layer.

◆ shutdown_read()

virtual int shutdown_read ( )
pure virtual

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