Conexus::NSPR::Socket Class Reference

#include <conexus/nspr_socket.h>

Inheritance diagram for Conexus::NSPR::Socket:

Inheritance graph
[legend]
List of all members.

Detailed Description

This class encapsulates NSPR's Socket API and serves as the base class for all objects performing socket I/O.

This class provides the following propertymm properties:

Author:
Rick L Vinyard Jr


Public Types

typedef ConexusPointer< Socketpointer

Public Member Functions

 IDIOSKOPOS_OBJECT (Conexus::NSPR::Socket)
virtual void close (bool force=false) throw ( close_exception )
 Overloads the parent FileDescriptor class to ensure that the final state clears the BOUND, CONNECTED, LISTENING and ACCEPTED flags.
virtual void bind () throw ( bind_exception )
 Binding without an address (autobinding) is a child specific action.
virtual void bind (Conexus::Address &a) throw ( bind_exception )
 Binds the socket to the provided address.
virtual void connect () throw ( connect_exception )
 Connecting without an address (autoconnecting) is a child specific action.
virtual void connect (Address &a) throw ( connect_exception )
 Connects the socket to the provided address.
virtual void listen (int backlog=0)
 Places the socket in a listening mode; nearly identical to calling listen() on the socket.
virtual ssize_t writeto (Address &a, Data::const_pointer data) throw (write_exception)
virtual void set_option (PRSocketOptionData &option)
virtual void change_state (long states) throw ( state_exception )
sigc::signal< void > signal_bound ()
sigc::signal< void > signal_connected ()
sigc::signal< void > signal_listening ()
bool is_bound ()
bool is_connected ()
bool is_listening ()
bool is_accepted ()
void enable_ssl (bool as_server)
void set_ssl_url (const std::string &url)
std::string ssl_get_url ()
void ssl_force_handshake ()
void ssl_rehandshake (bool flush_cache)
void ssl_reset_handshake ()
void ssl_invalidate_session ()
int ssl_input_available ()
int ssl_security_status ()
 Returns the current security status
  • Off = 0
  • On, high = 1
  • On, low = 2.

std::string ssl_cipher ()
int ssl_session_key_size ()
int ssl_secret_key_size ()
std::string ssl_issuer ()
std::string ssl_subject ()
virtual Conexus::IPv4::Addresslocal_interface ()
virtual Conexus::IPv4::Addressremote_address ()
virtual void set_remote_address (Conexus::IPv4::Address addr)
virtual void unset_remote_address ()
virtual void set_local_interface (Conexus::IPv4::Address addr)
 Socket () throw ()
 This default constructor is primarily for children to specify a domain, type and socket protocol.
virtual void close (bool force=false) throw ( close_exception )
 Overloads the parent FileDescriptor class to ensure that the final state clears the BOUND, CONNECTED, LISTENING and ACCEPTED flags.
virtual void bind () throw ( bind_exception )
 Binding without an address (autobinding) is a child specific action.
virtual void bind (Conexus::Address &a) throw ( bind_exception )
 Binds the socket to the provided address.
virtual void connect () throw ( connect_exception )
 Connecting without an address (autoconnecting) is a child specific action.
virtual void connect (Address &a) throw ( connect_exception )
 Connects the socket to the provided address.
virtual void listen (int backlog=0)
 Places the socket in a listening mode; nearly identical to calling listen() on the socket.
virtual ssize_t writeto (Address &a, const void *data, size_t size) throw ( write_exception )
virtual void set_option (PRSocketOptionData &option)
virtual void change_state (long states) throw ( state_exception )
sigc::signal< void > signal_bound ()
sigc::signal< void > signal_connected ()
sigc::signal< void > signal_listening ()
bool is_bound ()
bool is_connected ()
bool is_listening ()
bool is_accepted ()
void enable_ssl (bool as_server)
void set_ssl_url (const std::string &url)
std::string ssl_get_url ()
void ssl_force_handshake ()
void ssl_rehandshake (bool flush_cache)
void ssl_reset_handshake ()
void ssl_invalidate_session ()
int ssl_input_available ()
int ssl_security_status ()
 Returns the current security status
  • Off = 0
  • On, high = 1
  • On, low = 2.

std::string ssl_cipher ()
int ssl_session_key_size ()
int ssl_secret_key_size ()
std::string ssl_issuer ()
std::string ssl_subject ()
virtual Conexus::IPv4::Addresslocal_interface ()
virtual Conexus::IPv4::Addressremote_address ()
virtual void set_remote_address (Conexus::IPv4::Address addr)
virtual void unset_remote_address ()
virtual void set_local_interface (Conexus::IPv4::Address addr)
virtual const std::string & object_type ()
 Socket () throw ()
 This default constructor is primarily for children to specify a domain, type and socket protocol.
virtual void close (bool force=false) throw ( close_exception )
 Overloads the parent FileDescriptor class to ensure that the final state clears the BOUND, CONNECTED, LISTENING and ACCEPTED flags.
virtual void bind () throw ( bind_exception )
 Binding without an address (autobinding) is a child specific action.
virtual void bind (Conexus::Address &a) throw ( bind_exception )
 Binds the socket to the provided address.
virtual void connect () throw ( connect_exception )
 Connecting without an address (autoconnecting) is a child specific action.
virtual void connect (Address &a) throw ( connect_exception )
 Connects the socket to the provided address.
virtual void listen (int backlog=0)
 Places the socket in a listening mode; nearly identical to calling listen() on the socket.
virtual ssize_t writeto (Address &a, const void *data, size_t size) throw ( write_exception )
virtual void set_option (PRSocketOptionData &option)
virtual void change_state (long states) throw ( state_exception )
sigc::signal< void > signal_bound ()
sigc::signal< void > signal_connected ()
sigc::signal< void > signal_listening ()
bool is_bound ()
bool is_connected ()
bool is_listening ()
bool is_accepted ()
void enable_ssl (bool as_server)
void set_ssl_url (const std::string &url)
std::string ssl_get_url ()
void ssl_force_handshake ()
void ssl_rehandshake (bool flush_cache)
void ssl_reset_handshake ()
void ssl_invalidate_session ()
int ssl_input_available ()
int ssl_security_status ()
 Returns the current security status
  • Off = 0
  • On, high = 1
  • On, low = 2.

std::string ssl_cipher ()
int ssl_session_key_size ()
int ssl_secret_key_size ()
std::string ssl_issuer ()
std::string ssl_subject ()
virtual Conexus::IPv4::Addresslocal_interface ()
virtual Conexus::IPv4::Addressremote_address ()
virtual void set_remote_address (Conexus::IPv4::Address addr)
virtual void unset_remote_address ()
virtual void set_local_interface (Conexus::IPv4::Address addr)
virtual const std::string & object_type ()

Protected Member Functions

 Socket () throw ()
 This default constructor is primarily for children to specify a domain, type and socket protocol.
virtual ssize_t write_data (long int timeout, Data::const_pointer data) throw ( write_exception )
virtual Data::pointer read_data (long int timeout, size_t s=0) throw ( read_exception )
virtual void set_state_closed ()
virtual void set_state_bound ()
virtual void set_state_connected ()
virtual void set_state_listening ()
virtual void on_local_interface_changed ()
virtual void on_remote_address_changed ()
void on_local_interface_changed_proxy ()
void on_remote_address_changed_proxy ()
char * on_ssl_pkcs11_password (PK11SlotInfo *info, PRBool retry)
virtual SECStatus on_ssl_certificate_authenticate (PRBool checksig, PRBool isServer)
virtual SECStatus on_ssl_bad_certificate ()
virtual SECStatus on_ssl_handshake ()
virtual SECStatus on_ssl_client_authenticate (struct CERTDistNamesStr *caNames, struct CERTCertificateStr **pRetCert, struct SECKEYPrivateKeyStr **pRetKey)
virtual void set_state_closed ()
virtual void set_state_bound ()
virtual void set_state_connected ()
virtual void set_state_listening ()
char * on_ssl_pkcs11_password (PK11SlotInfo *info, PRBool retry)
virtual SECStatus on_ssl_certificate_authenticate (PRBool checksig, PRBool isServer)
virtual SECStatus on_ssl_bad_certificate ()
virtual SECStatus on_ssl_handshake ()
virtual SECStatus on_ssl_client_authenticate (struct CERTDistNamesStr *caNames, struct CERTCertificateStr **pRetCert, struct SECKEYPrivateKeyStr **pRetKey)
virtual void set_state_closed ()
virtual void set_state_bound ()
virtual void set_state_connected ()
virtual void set_state_listening ()
char * on_ssl_pkcs11_password (PK11SlotInfo *info, PRBool retry)
virtual SECStatus on_ssl_certificate_authenticate (PRBool checksig, PRBool isServer)
virtual SECStatus on_ssl_bad_certificate ()
virtual SECStatus on_ssl_handshake ()
virtual SECStatus on_ssl_client_authenticate (struct CERTDistNamesStr *caNames, struct CERTCertificateStr **pRetCert, struct SECKEYPrivateKeyStr **pRetKey)

Protected Attributes

Conexus::IPv4::Address m_local_interface
Conexus::IPv4::Address m_remote_address
bool m_ssl_enabled
bool m_ssl_server
bool m_remote_address_set
sigc::signal< void > m_signal_bound
sigc::signal< void > m_signal_connected
sigc::signal< void > m_signal_listening
sigc::signal< void > m_signal_bound
sigc::signal< void > m_signal_connected
sigc::signal< void > m_signal_listening
sigc::signal< void > m_signal_bound
sigc::signal< void > m_signal_connected
sigc::signal< void > m_signal_listening


Member Function Documentation

void Conexus::NSPR::Socket::bind (  )  throw ( bind_exception ) [virtual]

Binding without an address (autobinding) is a child specific action.

By default an attempt to bind without providing an address will result in a thrown exception condition. Therefore children should modify this behavior if they wish to provide autobinding.

void Conexus::NSPR::Socket::bind ( Conexus::Address a  )  throw ( bind_exception ) [virtual]

Binds the socket to the provided address.

The socket should already be in the OPENED state before this call.

If the socket is in the CLOSED state, then set_state(OPENED) will be automatically called.

void Conexus::NSPR::Socket::connect (  )  throw ( connect_exception ) [virtual]

Connecting without an address (autoconnecting) is a child specific action.

By default an attempt to connect without providing an address will result in a thrown exception condition. Therefore children should modify this behavior if they wish to provide autoconnection.

Reimplemented in Conexus::NSPR::UDP, Conexus::NSPR::UDP, and Conexus::NSPR::UDP.

void Conexus::NSPR::Socket::connect ( Address a  )  throw ( connect_exception ) [virtual]

Connects the socket to the provided address.

If the socket is in the CLOSED state, then set_state(OPENED) will be automatically called.

If the provided address is a broadcast address, will also set the broadcast socket option.

void Conexus::NSPR::Socket::listen ( int  backlog = 0  )  [virtual]

Places the socket in a listening mode; nearly identical to calling listen() on the socket.

The socket should already be in the BOUND state before this call.

If the socket is in the CLOSED or OPENED states, then set_state(BOUND) will be automatically called.

virtual void Conexus::NSPR::Socket::bind (  )  throw ( bind_exception ) [virtual]

Binding without an address (autobinding) is a child specific action.

By default an attempt to bind without providing an address will result in a thrown exception condition. Therefore children should modify this behavior if they wish to provide autobinding.

virtual void Conexus::NSPR::Socket::bind ( Conexus::Address a  )  throw ( bind_exception ) [virtual]

Binds the socket to the provided address.

The socket should already be in the OPENED state before this call.

If the socket is in the CLOSED state, then set_state(OPENED) will be automatically called.

virtual void Conexus::NSPR::Socket::connect (  )  throw ( connect_exception ) [virtual]

Connecting without an address (autoconnecting) is a child specific action.

By default an attempt to connect without providing an address will result in a thrown exception condition. Therefore children should modify this behavior if they wish to provide autoconnection.

Reimplemented in Conexus::NSPR::UDP, Conexus::NSPR::UDP, and Conexus::NSPR::UDP.

virtual void Conexus::NSPR::Socket::connect ( Address a  )  throw ( connect_exception ) [virtual]

Connects the socket to the provided address.

If the socket is in the CLOSED state, then set_state(OPENED) will be automatically called.

If the provided address is a broadcast address, will also set the broadcast socket option.

virtual void Conexus::NSPR::Socket::listen ( int  backlog = 0  )  [virtual]

Places the socket in a listening mode; nearly identical to calling listen() on the socket.

The socket should already be in the BOUND state before this call.

If the socket is in the CLOSED or OPENED states, then set_state(BOUND) will be automatically called.

virtual void Conexus::NSPR::Socket::bind (  )  throw ( bind_exception ) [virtual]

Binding without an address (autobinding) is a child specific action.

By default an attempt to bind without providing an address will result in a thrown exception condition. Therefore children should modify this behavior if they wish to provide autobinding.

virtual void Conexus::NSPR::Socket::bind ( Conexus::Address a  )  throw ( bind_exception ) [virtual]

Binds the socket to the provided address.

The socket should already be in the OPENED state before this call.

If the socket is in the CLOSED state, then set_state(OPENED) will be automatically called.

virtual void Conexus::NSPR::Socket::connect (  )  throw ( connect_exception ) [virtual]

Connecting without an address (autoconnecting) is a child specific action.

By default an attempt to connect without providing an address will result in a thrown exception condition. Therefore children should modify this behavior if they wish to provide autoconnection.

Reimplemented in Conexus::NSPR::UDP, Conexus::NSPR::UDP, and Conexus::NSPR::UDP.

virtual void Conexus::NSPR::Socket::connect ( Address a  )  throw ( connect_exception ) [virtual]

Connects the socket to the provided address.

If the socket is in the CLOSED state, then set_state(OPENED) will be automatically called.

If the provided address is a broadcast address, will also set the broadcast socket option.

virtual void Conexus::NSPR::Socket::listen ( int  backlog = 0  )  [virtual]

Places the socket in a listening mode; nearly identical to calling listen() on the socket.

The socket should already be in the BOUND state before this call.

If the socket is in the CLOSED or OPENED states, then set_state(BOUND) will be automatically called.


The documentation for this class was generated from the following files:
Generated on Tue Mar 13 19:55:14 2007 by  doxygen 1.5.1