address.hpp   address.hpp 
skipping to change at line 29 skipping to change at line 29
#ifndef _NET6_ADDRESS_HPP_ #ifndef _NET6_ADDRESS_HPP_
#define _NET6_ADDRESS_HPP_ #define _NET6_ADDRESS_HPP_
#include <inttypes.h> #include <inttypes.h>
#ifdef WIN32 #ifdef WIN32
#include <winsock2.h> #include <winsock2.h>
#include <ws2tcpip.h> #include <ws2tcpip.h>
#else #else
#include <sys/socket.h> #include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/in_systm.h> #include <netinet/in_systm.h>
#include <netinet/in.h>
#include <netinet/ip.h> #include <netinet/ip.h>
#endif #endif
#include <list> #include <list>
#include <string> #include <string>
namespace net6 namespace net6
{ {
/** Abstract base class representing an internet address /** Abstract base class representing an internet address
 End of changes. 2 change blocks. 
1 lines changed or deleted 1 lines changed or added


 connection.hpp   connection.hpp 
skipping to change at line 56 skipping to change at line 56
ENCRYPTED, ENCRYPTED,
CLOSED CLOSED
}; };
enum keepalive_state { enum keepalive_state {
KEEPALIVE_DISABLED, KEEPALIVE_DISABLED,
KEEPALIVE_ENABLED, KEEPALIVE_ENABLED,
KEEPALIVE_WAITING KEEPALIVE_WAITING
}; };
class fatal: public std::runtime_error
{
public:
fatal(const std::string& error_message):
std::runtime_error(error_message) {}
};
typedef sigc::signal<void, const packet&> signal_recv_type; typedef sigc::signal<void, const packet&> signal_recv_type;
typedef sigc::signal<void> signal_send_type; typedef sigc::signal<void> signal_send_type;
typedef sigc::signal<void> signal_close_type; typedef sigc::signal<void> signal_close_type;
typedef sigc::signal<void> signal_encrypted_type; typedef sigc::signal<void> signal_encrypted_type;
typedef sigc::signal<void> signal_encryption_failed_type; typedef sigc::signal<void> signal_encryption_failed_type;
/** @brief Creates a new connection that is initially in closed /** @brief Creates a new connection that is initially in closed
* state. * state.
*/ */
connection_base(); connection_base();
 End of changes. 1 change blocks. 
0 lines changed or deleted 7 lines changed or added


 host.hpp   host.hpp 
skipping to change at line 39 skipping to change at line 39
*/ */
template<typename selector_type = net6::selector> template<typename selector_type = net6::selector>
class basic_host class basic_host
: virtual public basic_local<selector_type>, : virtual public basic_local<selector_type>,
virtual public basic_server<selector_type> virtual public basic_server<selector_type>
{ {
public: public:
/** Creates a new basic_host object. /** Creates a new basic_host object.
* @param username user name to use for the local user. * @param username user name to use for the local user.
* @param ipv6 Whether to use IPv6. * @param ipv6 Whether to use IPv6 when no parameter is given to
* reopen.
*/ */
basic_host(const std::string& username, bool ipv6 = true); basic_host(const std::string& username, bool ipv6 = true);
/** Creates a new basic_host object which will accept incoming /** Creates a new basic_host object which will accept incoming
* connections on port <em>port</em> and use the user name * connections on port <em>port</em> and use the user name
* <em>username</em> for the local user. * <em>username</em> for the local user.
*/ */
basic_host(unsigned int port, const std::string& username, basic_host(unsigned int port, const std::string& username,
bool ipv6 = true); bool ipv6 = true);
 End of changes. 1 change blocks. 
1 lines changed or deleted 2 lines changed or added


 server.hpp   server.hpp 
skipping to change at line 86 skipping to change at line 86
typedef sigc::signal<void, const user&, const packet&> typedef sigc::signal<void, const user&, const packet&>
signal_login_type; signal_login_type;
typedef sigc::signal<void, const user&, packet&> typedef sigc::signal<void, const user&, packet&>
signal_login_extend_type; signal_login_extend_type;
typedef sigc::signal<void, const user&, const packet&> typedef sigc::signal<void, const user&, const packet&>
signal_data_type; signal_data_type;
/** Creates a new basic_server object. /** Creates a new basic_server object.
* @param ipv6 Whether to use IPv6. * @param ipv6 Whether to use IPv6 when no ipv6 parameter is given
* to reopen.
*/ */
basic_server(bool ipv6 = true); basic_server(bool ipv6 = true);
/** Creates a new basic_server which will be opened on port /** Creates a new basic_server which will be opened on port
* <em>port</em>. * <em>port</em>.
*/ */
basic_server(unsigned int port, bool ipv6 = true); basic_server(unsigned int port, bool ipv6 = true);
virtual ~basic_server(); virtual ~basic_server();
void reopen(unsigned int port) { reopen(port, use_ipv6); }
/** (re)opens the server socket on port <em>port</em>, if it has /** (re)opens the server socket on port <em>port</em>, if it has
* been shut down before. * been shut down before.
*/ */
virtual void reopen(unsigned int port); virtual void reopen(unsigned int port, bool ipv6);
/** Shuts down the server socket. New connections will no longer be /** Shuts down the server socket. New connections will no longer be
* accepted, but already established connections stay open. * accepted, but already established connections stay open.
*/ */
virtual void shutdown(); virtual void shutdown();
/** Returns whether the server socket has been opened. Note that the /** Returns whether the server socket has been opened. Note that the
* socket may not be open but there are still client connections if the * socket may not be open but there are still client connections if the
* server has been shut down when clients were connected. * server has been shut down when clients were connected.
*/ */
skipping to change at line 240 skipping to change at line 243
signal_disconnect_type signal_disconnect; signal_disconnect_type signal_disconnect;
signal_join_type signal_join; signal_join_type signal_join;
signal_part_type signal_part; signal_part_type signal_part;
signal_login_auth_type signal_login_auth; signal_login_auth_type signal_login_auth;
signal_login_type signal_login; signal_login_type signal_login;
signal_login_extend_type signal_login_extend; signal_login_extend_type signal_login_extend;
signal_data_type signal_data; signal_data_type signal_data;
private: private:
void shutdown_impl(); void shutdown_impl();
void reopen_impl(unsigned int port); void reopen_impl(unsigned int port, bool use_ipv6);
}; };
typedef basic_server<selector> server; typedef basic_server<selector> server;
template<typename selector_type> template<typename selector_type>
basic_server<selector_type>::basic_server(bool ipv6) basic_server<selector_type>::basic_server(bool ipv6)
: use_ipv6(ipv6), id_counter(0) : id_counter(0), use_ipv6(ipv6)
{ {
} }
template<typename selector_type> template<typename selector_type>
basic_server<selector_type>::basic_server(unsigned int port, bool ipv6) basic_server<selector_type>::basic_server(unsigned int port, bool ipv6)
: use_ipv6(ipv6), id_counter(0) : id_counter(0), use_ipv6(ipv6)
{ {
reopen_impl(port); reopen_impl(port, ipv6);
} }
template<typename selector_type> template<typename selector_type>
basic_server<selector_type>::~basic_server() basic_server<selector_type>::~basic_server()
{ {
// TODO: Call user_clear first to remove user connections first? // TODO: Call user_clear first to remove user connections first?
if(is_open() ) if(is_open() )
shutdown_impl(); shutdown_impl();
} }
template<typename selector_type> template<typename selector_type>
void basic_server<selector_type>::reopen(unsigned int port) void basic_server<selector_type>::reopen(unsigned int port, bool ipv6)
{ {
reopen_impl(port); reopen_impl(port, ipv6);
} }
template<typename selector_type> template<typename selector_type>
void basic_server<selector_type>::shutdown() void basic_server<selector_type>::shutdown()
{ {
shutdown_impl(); shutdown_impl();
} }
template<typename selector_type> template<typename selector_type>
bool basic_server<selector_type>::is_open() const bool basic_server<selector_type>::is_open() const
skipping to change at line 649 skipping to change at line 652
} }
if(serv6_sock.get() != NULL) if(serv6_sock.get() != NULL)
{ {
selector.set(*serv6_sock, IO_NONE); selector.set(*serv6_sock, IO_NONE);
serv6_sock.reset(NULL); serv6_sock.reset(NULL);
} }
} }
template<typename selector_type> template<typename selector_type>
void basic_server<selector_type>::reopen_impl(unsigned int port) void basic_server<selector_type>::reopen_impl(unsigned int port, bool ipv6)
{ {
selector_type& selector = basic_object<selector_type>::get_selector( ); selector_type& selector = basic_object<selector_type>::get_selector( );
// Open IPv4 socket on local port // Open IPv4 socket on local port
if(!use_ipv6) if(!ipv6)
{ {
ipv4_address bind_addr(port); ipv4_address bind_addr(port);
serv_sock.reset(new tcp_server_socket(bind_addr) ); serv_sock.reset(new tcp_server_socket(bind_addr) );
selector.set(*serv_sock, selector.set(*serv_sock,
selector.get(*serv_sock) | IO_INCOMING selector.get(*serv_sock) | IO_INCOMING
); );
serv_sock->io_event().connect( serv_sock->io_event().connect(
sigc::bind<0>( sigc::bind<0>(
 End of changes. 11 change blocks. 
10 lines changed or deleted 13 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/