libfilezilla
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Classes | Namespaces | Macros | Typedefs | Enumerations | Functions
socket.hpp File Reference

Socket classes for networking. More...

#include "libfilezilla.hpp"
#include "event_handler.hpp"
#include "iputils.hpp"
#include <memory>
#include <errno.h>
Include dependency graph for socket.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  socket_event_source
 All classes sending socket events should derive from this. More...
 
class  socket_base
 Common base clase for fz::socket and fz::listen_socket. More...
 
class  socket_descriptor
 
class  listen_socket
 
class  socket_interface
 Interface for sockets. More...
 
class  socket
 IPv6 capable, non-blocking socket class. More...
 
class  socket_layer
 A base class for socket layers. More...
 

Namespaces

 fz
 The namespace used by libfilezilla.
 

Macros

#define EISCONN   WSAEISCONN
 
#define EINPROGRESS   WSAEINPROGRESS
 
#define EAFNOSUPPORT   WSAEAFNOSUPPORT
 
#define EADDRINUSE   WSAEADDRINUSE
 
#define ENOBUFS   WSAENOBUFS
 
#define EPROTONOSUPPORT   WSAEPROTONOSUPPORT
 
#define EALREADY   WSAEALREADY
 
#define ECONNREFUSED   WSAECONNREFUSED
 
#define ENOTSOCK   WSAENOTSOCK
 
#define ETIMEDOUT   WSAETIMEDOUT
 
#define ENETUNREACH   WSAENETUNREACH
 
#define EHOSTUNREACH   WSAEHOSTUNREACH
 
#define ENOTCONN   WSAENOTCONN
 
#define ENETRESET   WSAENETRESET
 
#define EOPNOTSUPP   WSAEOPNOTSUPP
 
#define ESHUTDOWN   WSAESHUTDOWN
 
#define EMSGSIZE   WSAEMSGSIZE
 
#define ECONNABORTED   WSAECONNABORTED
 
#define ECONNRESET   WSAECONNRESET
 
#define EHOSTDOWN   WSAEHOSTDOWN
 

Typedefs

typedef simple_event
< socket_event_type,
socket_event_source
*, socket_event_flag, int > 
socket_event
 
typedef simple_event
< hostaddress_event_type,
socket_event_source
*, std::string > 
hostaddress_event
 

Enumerations

enum  socket_event_flag { connection_next, connection, read, write }
 
enum  listen_socket_state { none, listening }
 
enum  socket_state {
  none, connecting, connected, shutting_down,
  shut_down, closed, failed
}
 State transitions are monotonically increasing. More...
 

Functions

void remove_socket_events (event_handler *handler, socket_event_source const *const source)
 Remove all pending socket events from source sent to handler. More...
 
void change_socket_event_handler (event_handler *old_handler, event_handler *new_handler, socket_event_source const *const source)
 
std::string socket_error_string (int error)
 
native_string socket_error_description (int error)
 Gets a human-readable, translated description of the error.
 

Detailed Description

Socket classes for networking.

Declares the fz::socket and fz::listen_socket classes, alongside supporting classes to handle socket events.