Merge lp:~abychko/percona-xtradb-cluster/galera-2.x-relocation into lp:percona-xtradb-cluster/percona-xtradb-cluster-5.5

Proposed by Alexey Bychko
Status: Merged
Merge reported by: Raghavendra D Prabhu
Merged at revision: not available
Proposed branch: lp:~abychko/percona-xtradb-cluster/galera-2.x-relocation
Merge into: lp:percona-xtradb-cluster/percona-xtradb-cluster-5.5
Diff against target: 176056 lines (+171508/-0) (has conflicts)
876 files modified
.bzrignore (+78/-0)
AUTHORS (+1/-0)
COPYING (+9/-0)
GALERA-REVISION (+1/-0)
LICENSE (+674/-0)
README (+64/-0)
SConscript (+16/-0)
SConstruct (+454/-0)
asio/LICENSE_1_0.txt (+23/-0)
asio/asio.hpp (+101/-0)
asio/asio/basic_datagram_socket.hpp (+800/-0)
asio/asio/basic_deadline_timer.hpp (+442/-0)
asio/asio/basic_io_object.hpp (+98/-0)
asio/asio/basic_raw_socket.hpp (+795/-0)
asio/asio/basic_serial_port.hpp (+620/-0)
asio/asio/basic_socket.hpp (+1060/-0)
asio/asio/basic_socket_acceptor.hpp (+825/-0)
asio/asio/basic_socket_iostream.hpp (+151/-0)
asio/asio/basic_socket_streambuf.hpp (+290/-0)
asio/asio/basic_stream_socket.hpp (+715/-0)
asio/asio/basic_streambuf.hpp (+366/-0)
asio/asio/basic_streambuf_fwd.hpp (+33/-0)
asio/asio/buffer.hpp (+1042/-0)
asio/asio/buffered_read_stream.hpp (+458/-0)
asio/asio/buffered_read_stream_fwd.hpp (+25/-0)
asio/asio/buffered_stream.hpp (+253/-0)
asio/asio/buffered_stream_fwd.hpp (+25/-0)
asio/asio/buffered_write_stream.hpp (+412/-0)
asio/asio/buffered_write_stream_fwd.hpp (+25/-0)
asio/asio/buffers_iterator.hpp (+453/-0)
asio/asio/completion_condition.hpp (+162/-0)
asio/asio/datagram_socket_service.hpp (+311/-0)
asio/asio/deadline_timer.hpp (+33/-0)
asio/asio/deadline_timer_service.hpp (+146/-0)
asio/asio/detail/array_fwd.hpp (+25/-0)
asio/asio/detail/base_from_completion_cond.hpp (+68/-0)
asio/asio/detail/bind_handler.hpp (+360/-0)
asio/asio/detail/buffer_resize_guard.hpp (+68/-0)
asio/asio/detail/buffer_sequence_adapter.hpp (+254/-0)
asio/asio/detail/buffered_stream_storage.hpp (+125/-0)
asio/asio/detail/call_stack.hpp (+91/-0)
asio/asio/detail/completion_handler.hpp (+75/-0)
asio/asio/detail/config.hpp (+205/-0)
asio/asio/detail/consuming_buffers.hpp (+278/-0)
asio/asio/detail/deadline_timer_service.hpp (+186/-0)
asio/asio/detail/descriptor_ops.hpp (+105/-0)
asio/asio/detail/descriptor_read_op.hpp (+114/-0)
asio/asio/detail/descriptor_write_op.hpp (+114/-0)
asio/asio/detail/dev_poll_reactor.hpp (+185/-0)
asio/asio/detail/dev_poll_reactor_fwd.hpp (+32/-0)
asio/asio/detail/epoll_reactor.hpp (+197/-0)
asio/asio/detail/epoll_reactor_fwd.hpp (+32/-0)
asio/asio/detail/event.hpp (+44/-0)
asio/asio/detail/eventfd_select_interrupter.hpp (+74/-0)
asio/asio/detail/fd_set_adapter.hpp (+34/-0)
asio/asio/detail/fenced_block.hpp (+82/-0)
asio/asio/detail/gcc_arm_fenced_block.hpp (+76/-0)
asio/asio/detail/gcc_fenced_block.hpp (+63/-0)
asio/asio/detail/gcc_hppa_fenced_block.hpp (+58/-0)
asio/asio/detail/gcc_sync_fenced_block.hpp (+61/-0)
asio/asio/detail/gcc_x86_fenced_block.hpp (+59/-0)
asio/asio/detail/handler_alloc_helpers.hpp (+85/-0)
asio/asio/detail/handler_invoke_helpers.hpp (+47/-0)
asio/asio/detail/hash_map.hpp (+329/-0)
asio/asio/detail/impl/descriptor_ops.ipp (+370/-0)
asio/asio/detail/impl/dev_poll_reactor.hpp (+77/-0)
asio/asio/detail/impl/dev_poll_reactor.ipp (+338/-0)
asio/asio/detail/impl/epoll_reactor.hpp (+75/-0)
asio/asio/detail/impl/epoll_reactor.ipp (+390/-0)
asio/asio/detail/impl/eventfd_select_interrupter.ipp (+125/-0)
asio/asio/detail/impl/kqueue_reactor.hpp (+79/-0)
asio/asio/detail/impl/kqueue_reactor.ipp (+385/-0)
asio/asio/detail/impl/pipe_select_interrupter.ipp (+96/-0)
asio/asio/detail/impl/posix_event.ipp (+46/-0)
asio/asio/detail/impl/posix_mutex.ipp (+46/-0)
asio/asio/detail/impl/posix_thread.ipp (+74/-0)
asio/asio/detail/impl/posix_tss_ptr.ipp (+46/-0)
asio/asio/detail/impl/reactive_descriptor_service.ipp (+136/-0)
asio/asio/detail/impl/reactive_serial_port_service.ipp (+151/-0)
asio/asio/detail/impl/reactive_socket_service_base.ipp (+212/-0)
asio/asio/detail/impl/resolver_service_base.ipp (+106/-0)
asio/asio/detail/impl/select_reactor.hpp (+84/-0)
asio/asio/detail/impl/select_reactor.ipp (+273/-0)
asio/asio/detail/impl/service_registry.hpp (+70/-0)
asio/asio/detail/impl/service_registry.ipp (+164/-0)
asio/asio/detail/impl/socket_ops.ipp (+2863/-0)
asio/asio/detail/impl/socket_select_interrupter.ipp (+151/-0)
asio/asio/detail/impl/strand_service.hpp (+140/-0)
asio/asio/detail/impl/strand_service.ipp (+106/-0)
asio/asio/detail/impl/task_io_service.hpp (+60/-0)
asio/asio/detail/impl/task_io_service.ipp (+354/-0)
asio/asio/detail/impl/throw_error.ipp (+45/-0)
asio/asio/detail/impl/timer_queue.ipp (+85/-0)
asio/asio/detail/impl/timer_queue_set.ipp (+101/-0)
asio/asio/detail/impl/win_event.ipp (+50/-0)
asio/asio/detail/impl/win_iocp_handle_service.ipp (+452/-0)
asio/asio/detail/impl/win_iocp_io_service.hpp (+115/-0)
asio/asio/detail/impl/win_iocp_io_service.ipp (+496/-0)
asio/asio/detail/impl/win_iocp_serial_port_service.ipp (+180/-0)
asio/asio/detail/impl/win_iocp_socket_service_base.ipp (+575/-0)
asio/asio/detail/impl/win_mutex.ipp (+78/-0)
asio/asio/detail/impl/win_thread.ipp (+138/-0)
asio/asio/detail/impl/win_tss_ptr.ipp (+57/-0)
asio/asio/detail/impl/winsock_init.ipp (+69/-0)
asio/asio/detail/io_control.hpp (+137/-0)
asio/asio/detail/kqueue_reactor.hpp (+191/-0)
asio/asio/detail/kqueue_reactor_fwd.hpp (+33/-0)
asio/asio/detail/local_free_on_block_exit.hpp (+57/-0)
asio/asio/detail/macos_fenced_block.hpp (+53/-0)
asio/asio/detail/mutex.hpp (+44/-0)
asio/asio/detail/noncopyable.hpp (+53/-0)
asio/asio/detail/null_buffers_op.hpp (+77/-0)
asio/asio/detail/null_event.hpp (+75/-0)
asio/asio/detail/null_fenced_block.hpp (+43/-0)
asio/asio/detail/null_mutex.hpp (+64/-0)
asio/asio/detail/null_signal_blocker.hpp (+69/-0)
asio/asio/detail/null_thread.hpp (+61/-0)
asio/asio/detail/null_tss_ptr.hpp (+68/-0)
asio/asio/detail/object_pool.hpp (+146/-0)
asio/asio/detail/old_win_sdk_compat.hpp (+338/-0)
asio/asio/detail/op_queue.hpp (+156/-0)
asio/asio/detail/operation.hpp (+38/-0)
asio/asio/detail/pipe_select_interrupter.hpp (+78/-0)
asio/asio/detail/pop_options.hpp (+98/-0)
asio/asio/detail/posix_event.hpp (+98/-0)
asio/asio/detail/posix_fd_set_adapter.hpp (+80/-0)
asio/asio/detail/posix_mutex.hpp (+76/-0)
asio/asio/detail/posix_signal_blocker.hpp (+85/-0)
asio/asio/detail/posix_thread.hpp (+105/-0)
asio/asio/detail/posix_tss_ptr.hpp (+80/-0)
asio/asio/detail/push_options.hpp (+126/-0)
asio/asio/detail/reactive_descriptor_service.hpp (+253/-0)
asio/asio/detail/reactive_null_buffers_op.hpp (+83/-0)
asio/asio/detail/reactive_serial_port_service.hpp (+217/-0)
asio/asio/detail/reactive_socket_accept_op.hpp (+131/-0)
asio/asio/detail/reactive_socket_connect_op.hpp (+101/-0)
asio/asio/detail/reactive_socket_recv_op.hpp (+118/-0)
asio/asio/detail/reactive_socket_recvfrom_op.hpp (+128/-0)
asio/asio/detail/reactive_socket_send_op.hpp (+115/-0)
asio/asio/detail/reactive_socket_sendto_op.hpp (+118/-0)
asio/asio/detail/reactive_socket_service.hpp (+390/-0)
asio/asio/detail/reactive_socket_service_base.hpp (+298/-0)
asio/asio/detail/reactor.hpp (+30/-0)
asio/asio/detail/reactor_fwd.hpp (+50/-0)
asio/asio/detail/reactor_op.hpp (+61/-0)
asio/asio/detail/reactor_op_queue.hpp (+200/-0)
asio/asio/detail/regex_fwd.hpp (+31/-0)
asio/asio/detail/resolve_endpoint_op.hpp (+116/-0)
asio/asio/detail/resolve_op.hpp (+126/-0)
asio/asio/detail/resolver_service.hpp (+119/-0)
asio/asio/detail/resolver_service_base.hpp (+123/-0)
asio/asio/detail/scoped_lock.hpp (+91/-0)
asio/asio/detail/select_interrupter.hpp (+42/-0)
asio/asio/detail/select_reactor.hpp (+194/-0)
asio/asio/detail/select_reactor_fwd.hpp (+26/-0)
asio/asio/detail/service_base.hpp (+49/-0)
asio/asio/detail/service_id.hpp (+37/-0)
asio/asio/detail/service_registry.hpp (+152/-0)
asio/asio/detail/service_registry_fwd.hpp (+26/-0)
asio/asio/detail/shared_ptr.hpp (+38/-0)
asio/asio/detail/signal_blocker.hpp (+42/-0)
asio/asio/detail/signal_init.hpp (+47/-0)
asio/asio/detail/socket_holder.hpp (+98/-0)
asio/asio/detail/socket_ops.hpp (+289/-0)
asio/asio/detail/socket_option.hpp (+317/-0)
asio/asio/detail/socket_select_interrupter.hpp (+78/-0)
asio/asio/detail/socket_types.hpp (+174/-0)
asio/asio/detail/solaris_fenced_block.hpp (+53/-0)
asio/asio/detail/strand_service.hpp (+120/-0)
asio/asio/detail/task_io_service.hpp (+176/-0)
asio/asio/detail/task_io_service_fwd.hpp (+26/-0)
asio/asio/detail/task_io_service_operation.hpp (+69/-0)
asio/asio/detail/thread.hpp (+52/-0)
asio/asio/detail/throw_error.hpp (+53/-0)
asio/asio/detail/timer_op.hpp (+45/-0)
asio/asio/detail/timer_queue.hpp (+371/-0)
asio/asio/detail/timer_queue_base.hpp (+65/-0)
asio/asio/detail/timer_queue_fwd.hpp (+27/-0)
asio/asio/detail/timer_queue_set.hpp (+66/-0)
asio/asio/detail/timer_scheduler.hpp (+33/-0)
asio/asio/detail/timer_scheduler_fwd.hpp (+50/-0)
asio/asio/detail/tss_ptr.hpp (+63/-0)
asio/asio/detail/wait_handler.hpp (+76/-0)
asio/asio/detail/weak_ptr.hpp (+39/-0)
asio/asio/detail/win_event.hpp (+96/-0)
asio/asio/detail/win_fd_set_adapter.hpp (+90/-0)
asio/asio/detail/win_fenced_block.hpp (+79/-0)
asio/asio/detail/win_iocp_handle_read_op.hpp (+101/-0)
asio/asio/detail/win_iocp_handle_service.hpp (+284/-0)
asio/asio/detail/win_iocp_handle_write_op.hpp (+97/-0)
asio/asio/detail/win_iocp_io_service.hpp (+265/-0)
asio/asio/detail/win_iocp_io_service_fwd.hpp (+33/-0)
asio/asio/detail/win_iocp_null_buffers_op.hpp (+112/-0)
asio/asio/detail/win_iocp_operation.hpp (+90/-0)
asio/asio/detail/win_iocp_overlapped_op.hpp (+84/-0)
asio/asio/detail/win_iocp_overlapped_ptr.hpp (+140/-0)
asio/asio/detail/win_iocp_serial_port_service.hpp (+212/-0)
asio/asio/detail/win_iocp_socket_accept_op.hpp (+158/-0)
asio/asio/detail/win_iocp_socket_recv_op.hpp (+108/-0)
asio/asio/detail/win_iocp_socket_recvfrom_op.hpp (+116/-0)
asio/asio/detail/win_iocp_socket_send_op.hpp (+102/-0)
asio/asio/detail/win_iocp_socket_service.hpp (+460/-0)
asio/asio/detail/win_iocp_socket_service_base.hpp (+385/-0)
asio/asio/detail/win_mutex.hpp (+78/-0)
asio/asio/detail/win_signal_blocker.hpp (+67/-0)
asio/asio/detail/win_thread.hpp (+139/-0)
asio/asio/detail/win_tss_ptr.hpp (+79/-0)
asio/asio/detail/wince_thread.hpp (+116/-0)
asio/asio/detail/winsock_init.hpp (+90/-0)
asio/asio/detail/wrapped_handler.hpp (+203/-0)
asio/asio/error.hpp (+276/-0)
asio/asio/error_code.hpp (+162/-0)
asio/asio/handler_alloc_hook.hpp (+86/-0)
asio/asio/handler_invoke_hook.hpp (+70/-0)
asio/asio/impl/error.ipp (+33/-0)
asio/asio/impl/error_code.ipp (+112/-0)
asio/asio/impl/io_service.hpp (+132/-0)
asio/asio/impl/io_service.ipp (+139/-0)
asio/asio/impl/read.hpp (+386/-0)
asio/asio/impl/read.ipp (+401/-0)
asio/asio/impl/read_at.hpp (+410/-0)
asio/asio/impl/read_at.ipp (+373/-0)
asio/asio/impl/read_until.hpp (+902/-0)
asio/asio/impl/read_until.ipp (+987/-0)
asio/asio/impl/serial_port_base.hpp (+59/-0)
asio/asio/impl/serial_port_base.ipp (+555/-0)
asio/asio/impl/src.cpp (+25/-0)
asio/asio/impl/src.hpp (+65/-0)
asio/asio/impl/write.hpp (+396/-0)
asio/asio/impl/write.ipp (+402/-0)
asio/asio/impl/write_at.hpp (+417/-0)
asio/asio/impl/write_at.ipp (+319/-0)
asio/asio/io_service.hpp (+687/-0)
asio/asio/ip/address.hpp (+181/-0)
asio/asio/ip/address_v4.hpp (+210/-0)
asio/asio/ip/address_v6.hpp (+228/-0)
asio/asio/ip/basic_endpoint.hpp (+245/-0)
asio/asio/ip/basic_resolver.hpp (+249/-0)
asio/asio/ip/basic_resolver_entry.hpp (+94/-0)
asio/asio/ip/basic_resolver_iterator.hpp (+186/-0)
asio/asio/ip/basic_resolver_query.hpp (+245/-0)
asio/asio/ip/detail/endpoint.hpp (+140/-0)
asio/asio/ip/detail/impl/endpoint.ipp (+195/-0)
asio/asio/ip/detail/socket_option.hpp (+595/-0)
asio/asio/ip/host_name.hpp (+42/-0)
asio/asio/ip/icmp.hpp (+119/-0)
asio/asio/ip/impl/address.hpp (+53/-0)
asio/asio/ip/impl/address.ipp (+186/-0)
asio/asio/ip/impl/address_v4.hpp (+53/-0)
asio/asio/ip/impl/address_v4.ipp (+162/-0)
asio/asio/ip/impl/address_v6.hpp (+53/-0)
asio/asio/ip/impl/address_v6.ipp (+292/-0)
asio/asio/ip/impl/basic_endpoint.hpp (+55/-0)
asio/asio/ip/impl/host_name.ipp (+54/-0)
asio/asio/ip/multicast.hpp (+178/-0)
asio/asio/ip/resolver_query_base.hpp (+155/-0)
asio/asio/ip/resolver_service.hpp (+143/-0)
asio/asio/ip/tcp.hpp (+161/-0)
asio/asio/ip/udp.hpp (+117/-0)
asio/asio/ip/unicast.hpp (+67/-0)
asio/asio/ip/v6_only.hpp (+69/-0)
asio/asio/is_read_buffered.hpp (+59/-0)
asio/asio/is_write_buffered.hpp (+59/-0)
asio/asio/local/basic_endpoint.hpp (+222/-0)
asio/asio/local/connect_pair.hpp (+104/-0)
asio/asio/local/datagram_protocol.hpp (+80/-0)
asio/asio/local/detail/endpoint.hpp (+133/-0)
asio/asio/local/detail/impl/endpoint.ipp (+128/-0)
asio/asio/local/stream_protocol.hpp (+90/-0)
asio/asio/placeholders.hpp (+106/-0)
asio/asio/posix/basic_descriptor.hpp (+298/-0)
asio/asio/posix/basic_stream_descriptor.hpp (+302/-0)
asio/asio/posix/descriptor_base.hpp (+96/-0)
asio/asio/posix/stream_descriptor.hpp (+37/-0)
asio/asio/posix/stream_descriptor_service.hpp (+177/-0)
asio/asio/raw_socket_service.hpp (+311/-0)
asio/asio/read.hpp (+540/-0)
asio/asio/read_at.hpp (+573/-0)
asio/asio/read_until.hpp (+918/-0)
asio/asio/serial_port.hpp (+36/-0)
asio/asio/serial_port_base.hpp (+174/-0)
asio/asio/serial_port_service.hpp (+204/-0)
asio/asio/socket_acceptor_service.hpp (+217/-0)
asio/asio/socket_base.hpp (+512/-0)
asio/asio/ssl.hpp (+26/-0)
asio/asio/ssl/basic_context.hpp (+432/-0)
asio/asio/ssl/context.hpp (+32/-0)
asio/asio/ssl/context_base.hpp (+161/-0)
asio/asio/ssl/context_service.hpp (+172/-0)
asio/asio/ssl/detail/openssl_context_service.hpp (+377/-0)
asio/asio/ssl/detail/openssl_init.hpp (+152/-0)
asio/asio/ssl/detail/openssl_operation.hpp (+521/-0)
asio/asio/ssl/detail/openssl_stream_service.hpp (+569/-0)
asio/asio/ssl/detail/openssl_types.hpp (+25/-0)
asio/asio/ssl/stream.hpp (+513/-0)
asio/asio/ssl/stream_base.hpp (+59/-0)
asio/asio/ssl/stream_service.hpp (+182/-0)
asio/asio/strand.hpp (+227/-0)
asio/asio/stream_socket_service.hpp (+274/-0)
asio/asio/streambuf.hpp (+33/-0)
asio/asio/system_error.hpp (+118/-0)
asio/asio/thread.hpp (+92/-0)
asio/asio/time_traits.hpp (+82/-0)
asio/asio/version.hpp (+23/-0)
asio/asio/windows/basic_handle.hpp (+231/-0)
asio/asio/windows/basic_random_access_handle.hpp (+318/-0)
asio/asio/windows/basic_stream_handle.hpp (+300/-0)
asio/asio/windows/overlapped_ptr.hpp (+114/-0)
asio/asio/windows/random_access_handle.hpp (+37/-0)
asio/asio/windows/random_access_handle_service.hpp (+172/-0)
asio/asio/windows/stream_handle.hpp (+37/-0)
asio/asio/windows/stream_handle_service.hpp (+169/-0)
asio/asio/write.hpp (+537/-0)
asio/asio/write_at.hpp (+560/-0)
asio/version.txt (+1/-0)
common/common.h (+21/-0)
debian/README.Debian (+6/-0)
debian/README.source (+9/-0)
debian/changelog (+11/-0)
debian/compat (+1/-0)
debian/control (+16/-0)
debian/copyright (+25/-0)
debian/docs (+1/-0)
debian/percona-xtradb-cluster-galera-2.x.install (+2/-0)
debian/rules (+16/-0)
debian/source/format (+1/-0)
galera/SConscript (+2/-0)
galera/src/SConscript (+47/-0)
galera/src/action_source.hpp (+19/-0)
galera/src/certification.cpp (+731/-0)
galera/src/certification.hpp (+190/-0)
galera/src/fsm.hpp (+196/-0)
galera/src/galera_common.hpp (+47/-0)
galera/src/galera_exception.hpp (+63/-0)
galera/src/galera_info.c (+63/-0)
galera/src/galera_info.h (+17/-0)
galera/src/galera_service_thd.cpp (+102/-0)
galera/src/galera_service_thd.hpp (+52/-0)
galera/src/gcs.hpp (+354/-0)
galera/src/gcs_action_source.cpp (+171/-0)
galera/src/gcs_action_source.hpp (+63/-0)
galera/src/gcs_dummy.cpp (+253/-0)
galera/src/ist.cpp (+842/-0)
galera/src/ist.hpp (+147/-0)
galera/src/ist_proto.hpp (+570/-0)
galera/src/key.hpp (+335/-0)
galera/src/key_entry.cpp (+69/-0)
galera/src/key_entry.hpp (+179/-0)
galera/src/mapped_buffer.cpp (+167/-0)
galera/src/mapped_buffer.hpp (+59/-0)
galera/src/monitor.hpp (+510/-0)
galera/src/replicator.cpp (+14/-0)
galera/src/replicator.hpp (+114/-0)
galera/src/replicator_smm.cpp (+1625/-0)
galera/src/replicator_smm.hpp (+469/-0)
galera/src/replicator_smm_params.cpp (+145/-0)
galera/src/replicator_smm_stats.cpp (+247/-0)
galera/src/replicator_str.cpp (+768/-0)
galera/src/saved_state.cpp (+252/-0)
galera/src/saved_state.hpp (+67/-0)
galera/src/trx_handle.cpp (+247/-0)
galera/src/trx_handle.hpp (+428/-0)
galera/src/uuid.hpp (+88/-0)
galera/src/write_set.cpp (+108/-0)
galera/src/write_set.hpp (+82/-0)
galera/src/wsdb.cpp (+188/-0)
galera/src/wsdb.hpp (+97/-0)
galera/src/wsrep_api.h (+875/-0)
galera/src/wsrep_params.cpp (+61/-0)
galera/src/wsrep_params.hpp (+16/-0)
galera/src/wsrep_provider.cpp (+919/-0)
galera/tests/SConscript (+26/-0)
galera/tests/galera_check.cpp (+68/-0)
galera/tests/ist_check.cpp (+329/-0)
galera/tests/saved_state_check.cpp (+220/-0)
galera/tests/service_thd_check.cpp (+75/-0)
galera/tests/trx_handle_check.cpp (+194/-0)
galera/tests/write_set_check.cpp (+619/-0)
galerautils/ChangeLog (+48/-0)
galerautils/README (+12/-0)
galerautils/SConscript (+3/-0)
galerautils/doc/Doxyfile (+1237/-0)
galerautils/src/SConscript (+56/-0)
galerautils/src/avalanche.c (+97/-0)
galerautils/src/galerautils.h (+31/-0)
galerautils/src/galerautils.hpp (+42/-0)
galerautils/src/gu_abort.c (+36/-0)
galerautils/src/gu_abort.h (+25/-0)
galerautils/src/gu_arch.h (+61/-0)
galerautils/src/gu_assert.h (+25/-0)
galerautils/src/gu_assert.hpp (+29/-0)
galerautils/src/gu_atomic.hpp (+77/-0)
galerautils/src/gu_backtrace.c (+31/-0)
galerautils/src/gu_backtrace.h (+28/-0)
galerautils/src/gu_backtrace.hpp (+65/-0)
galerautils/src/gu_buffer.cpp (+6/-0)
galerautils/src/gu_buffer.hpp (+23/-0)
galerautils/src/gu_byteswap.h (+130/-0)
galerautils/src/gu_byteswap.hpp (+53/-0)
galerautils/src/gu_cond.hpp (+72/-0)
galerautils/src/gu_conf.h (+23/-0)
galerautils/src/gu_config.cpp (+421/-0)
galerautils/src/gu_config.h (+69/-0)
galerautils/src/gu_config.hpp (+207/-0)
galerautils/src/gu_convert.hpp (+121/-0)
galerautils/src/gu_datetime.cpp (+124/-0)
galerautils/src/gu_datetime.hpp (+223/-0)
galerautils/src/gu_dbug.c (+2171/-0)
galerautils/src/gu_dbug.h (+188/-0)
galerautils/src/gu_errno.h (+21/-0)
galerautils/src/gu_exception.cpp (+23/-0)
galerautils/src/gu_exception.hpp (+57/-0)
galerautils/src/gu_fifo.c (+534/-0)
galerautils/src/gu_fifo.h (+62/-0)
galerautils/src/gu_fnv.h (+191/-0)
galerautils/src/gu_fnv_bench.c (+224/-0)
galerautils/src/gu_hash.h (+151/-0)
galerautils/src/gu_int128.h (+183/-0)
galerautils/src/gu_limits.c (+80/-0)
galerautils/src/gu_limits.h (+58/-0)
galerautils/src/gu_lock.hpp (+74/-0)
galerautils/src/gu_lock_step.c (+138/-0)
galerautils/src/gu_lock_step.h (+45/-0)
galerautils/src/gu_log.c (+181/-0)
galerautils/src/gu_log.h (+111/-0)
galerautils/src/gu_logger.cpp (+153/-0)
galerautils/src/gu_logger.hpp (+127/-0)
galerautils/src/gu_macros.h (+70/-0)
galerautils/src/gu_macros.hpp (+22/-0)
galerautils/src/gu_mem.c (+161/-0)
galerautils/src/gu_mem.h (+68/-0)
galerautils/src/gu_mmh3.c (+137/-0)
galerautils/src/gu_mmh3.h (+383/-0)
galerautils/src/gu_monitor.hpp (+104/-0)
galerautils/src/gu_mutex.c (+315/-0)
galerautils/src/gu_mutex.h (+117/-0)
galerautils/src/gu_mutex.hpp (+96/-0)
galerautils/src/gu_print_buf.c (+80/-0)
galerautils/src/gu_print_buf.h (+37/-0)
galerautils/src/gu_prodcons.cpp (+90/-0)
galerautils/src/gu_prodcons.hpp (+185/-0)
galerautils/src/gu_profile.hpp (+318/-0)
galerautils/src/gu_rand.c (+45/-0)
galerautils/src/gu_rand.h (+35/-0)
galerautils/src/gu_regex.cpp (+56/-0)
galerautils/src/gu_regex.hpp (+84/-0)
galerautils/src/gu_resolver.cpp (+545/-0)
galerautils/src/gu_resolver.hpp (+327/-0)
galerautils/src/gu_serialize.hpp (+293/-0)
galerautils/src/gu_spooky.c (+15/-0)
galerautils/src/gu_spooky.h (+420/-0)
galerautils/src/gu_str.h (+198/-0)
galerautils/src/gu_string.cpp (+107/-0)
galerautils/src/gu_string.hpp (+34/-0)
galerautils/src/gu_system.h (+36/-0)
galerautils/src/gu_throw.hpp (+120/-0)
galerautils/src/gu_time.c (+194/-0)
galerautils/src/gu_time.h (+137/-0)
galerautils/src/gu_to.c (+443/-0)
galerautils/src/gu_to.h (+125/-0)
galerautils/src/gu_types.h (+16/-0)
galerautils/src/gu_unordered.hpp (+170/-0)
galerautils/src/gu_uri.cpp (+334/-0)
galerautils/src/gu_uri.hpp (+268/-0)
galerautils/src/gu_utils++.cpp (+50/-0)
galerautils/src/gu_utils.c (+108/-0)
galerautils/src/gu_utils.h (+43/-0)
galerautils/src/gu_utils.hpp (+162/-0)
galerautils/src/gu_uuid.c (+196/-0)
galerautils/src/gu_uuid.h (+103/-0)
galerautils/src/gu_vlq.hpp (+239/-0)
galerautils/tests/SConscript (+46/-0)
galerautils/tests/gu_bswap_test.c (+66/-0)
galerautils/tests/gu_bswap_test.h (+10/-0)
galerautils/tests/gu_datetime_test.cpp (+126/-0)
galerautils/tests/gu_datetime_test.hpp (+13/-0)
galerautils/tests/gu_dbug_test.c (+87/-0)
galerautils/tests/gu_dbug_test.h (+10/-0)
galerautils/tests/gu_fifo_test.c (+218/-0)
galerautils/tests/gu_fifo_test.h (+10/-0)
galerautils/tests/gu_fnv_test.c (+65/-0)
galerautils/tests/gu_fnv_test.h (+12/-0)
galerautils/tests/gu_hash_test.c (+251/-0)
galerautils/tests/gu_hash_test.h (+12/-0)
galerautils/tests/gu_lock_step_test.c (+139/-0)
galerautils/tests/gu_lock_step_test.h (+12/-0)
galerautils/tests/gu_mem_test.c (+78/-0)
galerautils/tests/gu_mem_test.h (+10/-0)
galerautils/tests/gu_mmh3_test.c (+244/-0)
galerautils/tests/gu_mmh3_test.h (+12/-0)
galerautils/tests/gu_net_test.cpp (+93/-0)
galerautils/tests/gu_net_test.hpp (+12/-0)
galerautils/tests/gu_spooky_test.c (+205/-0)
galerautils/tests/gu_spooky_test.h (+12/-0)
galerautils/tests/gu_str_test.c (+128/-0)
galerautils/tests/gu_str_test.h (+10/-0)
galerautils/tests/gu_string_test.cpp (+115/-0)
galerautils/tests/gu_string_test.hpp (+12/-0)
galerautils/tests/gu_tests++.cpp (+44/-0)
galerautils/tests/gu_tests++.hpp (+31/-0)
galerautils/tests/gu_tests.c (+75/-0)
galerautils/tests/gu_time_test.c (+34/-0)
galerautils/tests/gu_time_test.h (+10/-0)
galerautils/tests/gu_to_test.c (+250/-0)
galerautils/tests/gu_uri_test.cpp (+484/-0)
galerautils/tests/gu_uri_test.hpp (+12/-0)
galerautils/tests/gu_utils_test.c (+128/-0)
galerautils/tests/gu_utils_test.h (+10/-0)
galerautils/tests/gu_uuid_test.c (+46/-0)
galerautils/tests/gu_uuid_test.h (+12/-0)
galerautils/tests/gu_vlq_test.cpp (+272/-0)
galerautils/tests/gu_vlq_test.hpp (+12/-0)
garb/SConscript (+30/-0)
garb/files/freebsd/garb.sh (+98/-0)
garb/files/garb.cnf (+16/-0)
garb/files/garb.sh (+174/-0)
garb/garb_config.cpp (+137/-0)
garb/garb_config.hpp (+49/-0)
garb/garb_gcs.cpp (+159/-0)
garb/garb_gcs.hpp (+45/-0)
garb/garb_logger.cpp (+46/-0)
garb/garb_logger.hpp (+16/-0)
garb/garb_main.cpp (+108/-0)
garb/garb_recv_loop.cpp (+116/-0)
garb/garb_recv_loop.hpp (+35/-0)
gcache/AUTHORS (+1/-0)
gcache/Makefile.am (+12/-0)
gcache/README (+18/-0)
gcache/SConscript (+3/-0)
gcache/bootstrap.sh (+34/-0)
gcache/configure.ac (+106/-0)
gcache/src/GCache.cpp (+127/-0)
gcache/src/GCache.hpp (+229/-0)
gcache/src/GCache_memops.cpp (+132/-0)
gcache/src/GCache_seqno.cpp (+234/-0)
gcache/src/Makefile.am (+37/-0)
gcache/src/SConscript (+29/-0)
gcache/src/SeqnoNone.hpp (+17/-0)
gcache/src/gcache.h (+38/-0)
gcache/src/gcache_bh.hpp (+69/-0)
gcache/src/gcache_fd.cpp (+204/-0)
gcache/src/gcache_fd.hpp (+55/-0)
gcache/src/gcache_mem_store.cpp (+59/-0)
gcache/src/gcache_mem_store.hpp (+157/-0)
gcache/src/gcache_memops.hpp (+39/-0)
gcache/src/gcache_mmap.cpp (+89/-0)
gcache/src/gcache_mmap.hpp (+39/-0)
gcache/src/gcache_page.cpp (+145/-0)
gcache/src/gcache_page.hpp (+66/-0)
gcache/src/gcache_page_store.cpp (+263/-0)
gcache/src/gcache_page_store.hpp (+82/-0)
gcache/src/gcache_params.cpp (+148/-0)
gcache/src/gcache_rb_store.cpp (+380/-0)
gcache/src/gcache_rb_store.hpp (+98/-0)
gcache/src/pasture/Cond.hpp (+48/-0)
gcache/src/pasture/Exception.cpp (+26/-0)
gcache/src/pasture/Exception.hpp (+33/-0)
gcache/src/pasture/Lock.hpp (+58/-0)
gcache/src/pasture/Logger.cpp (+91/-0)
gcache/src/pasture/Logger.hpp (+100/-0)
gcache/src/pasture/Mutex.hpp (+46/-0)
gcache/src/pasture/gcache_rb_header.cpp (+178/-0)
gcache/src/test.cpp (+44/-0)
gcache/tests/SConscript (+20/-0)
gcache/tests/gcache_mem_test.cpp (+82/-0)
gcache/tests/gcache_mem_test.hpp (+15/-0)
gcache/tests/gcache_page_test.cpp (+104/-0)
gcache/tests/gcache_page_test.hpp (+15/-0)
gcache/tests/gcache_rb_test.cpp (+94/-0)
gcache/tests/gcache_rb_test.hpp (+15/-0)
gcache/tests/gcache_tests.cpp (+44/-0)
gcache/tests/gcache_tests.hpp (+31/-0)
gcomm/SConscript (+3/-0)
gcomm/doc/Doxyfile (+1237/-0)
gcomm/src/SConscript (+39/-0)
gcomm/src/asio_addr.hpp (+65/-0)
gcomm/src/asio_protonet.cpp (+277/-0)
gcomm/src/asio_protonet.hpp (+72/-0)
gcomm/src/asio_tcp.cpp (+855/-0)
gcomm/src/asio_tcp.hpp (+111/-0)
gcomm/src/asio_udp.cpp (+249/-0)
gcomm/src/asio_udp.hpp (+46/-0)
gcomm/src/conf.cpp (+104/-0)
gcomm/src/defaults.cpp (+38/-0)
gcomm/src/defaults.hpp (+45/-0)
gcomm/src/evs_consensus.cpp (+497/-0)
gcomm/src/evs_consensus.hpp (+70/-0)
gcomm/src/evs_input_map2.cpp (+398/-0)
gcomm/src/evs_input_map2.hpp (+381/-0)
gcomm/src/evs_message2.cpp (+447/-0)
gcomm/src/evs_message2.hpp (+673/-0)
gcomm/src/evs_node.cpp (+100/-0)
gcomm/src/evs_node.hpp (+192/-0)
gcomm/src/evs_proto.cpp (+3777/-0)
gcomm/src/evs_proto.hpp (+430/-0)
gcomm/src/evs_seqno.hpp (+78/-0)
gcomm/src/gcomm/common.hpp (+39/-0)
gcomm/src/gcomm/conf.hpp (+534/-0)
gcomm/src/gcomm/datagram.hpp (+295/-0)
gcomm/src/gcomm/exception.hpp (+24/-0)
gcomm/src/gcomm/map.hpp (+268/-0)
gcomm/src/gcomm/order.hpp (+56/-0)
gcomm/src/gcomm/protolay.hpp (+370/-0)
gcomm/src/gcomm/protonet.hpp (+135/-0)
gcomm/src/gcomm/protostack.hpp (+43/-0)
gcomm/src/gcomm/transport.hpp (+97/-0)
gcomm/src/gcomm/types.hpp (+87/-0)
gcomm/src/gcomm/util.hpp (+107/-0)
gcomm/src/gcomm/uuid.hpp (+149/-0)
gcomm/src/gcomm/view.hpp (+194/-0)
gcomm/src/gmcast.cpp (+1516/-0)
gcomm/src/gmcast.hpp (+223/-0)
gcomm/src/gmcast_link.hpp (+96/-0)
gcomm/src/gmcast_message.hpp (+330/-0)
gcomm/src/gmcast_node.hpp (+70/-0)
gcomm/src/gmcast_proto.cpp (+227/-0)
gcomm/src/gmcast_proto.hpp (+160/-0)
gcomm/src/histogram.cpp (+101/-0)
gcomm/src/histogram.hpp (+29/-0)
gcomm/src/pc.cpp (+247/-0)
gcomm/src/pc.hpp (+55/-0)
gcomm/src/pc_message.hpp (+378/-0)
gcomm/src/pc_proto.cpp (+1513/-0)
gcomm/src/pc_proto.hpp (+223/-0)
gcomm/src/profile.hpp (+279/-0)
gcomm/src/protonet.cpp (+87/-0)
gcomm/src/protostack.cpp (+75/-0)
gcomm/src/socket.cpp (+13/-0)
gcomm/src/socket.hpp (+99/-0)
gcomm/src/transport.cpp (+84/-0)
gcomm/src/uuid.cpp (+11/-0)
gcomm/src/view.cpp (+210/-0)
gcomm/test/SConscript (+27/-0)
gcomm/test/check_evs2.cpp (+1819/-0)
gcomm/test/check_gcomm.cpp (+95/-0)
gcomm/test/check_gcomm.hpp (+35/-0)
gcomm/test/check_gmcast.cpp (+435/-0)
gcomm/test/check_pc.cpp (+2935/-0)
gcomm/test/check_templ.hpp (+77/-0)
gcomm/test/check_trace.cpp (+345/-0)
gcomm/test/check_trace.hpp (+555/-0)
gcomm/test/check_types.cpp (+153/-0)
gcomm/test/check_util.cpp (+224/-0)
gcomm/test/ssl_test.cpp (+189/-0)
gcs/ChangeLog (+77/-0)
gcs/README (+13/-0)
gcs/SConscript (+1/-0)
gcs/doc/Coding_conventions.txt (+56/-0)
gcs/doc/Doxyfile (+1237/-0)
gcs/doc/GCS_connection_states.txt (+59/-0)
gcs/src/SConscript (+62/-0)
gcs/src/gcs.c (+2065/-0)
gcs/src/gcs.h (+400/-0)
gcs/src/gcs_act.h (+27/-0)
gcs/src/gcs_act_proto.c (+123/-0)
gcs/src/gcs_act_proto.h (+72/-0)
gcs/src/gcs_backend.c (+90/-0)
gcs/src/gcs_backend.h (+182/-0)
gcs/src/gcs_comp_msg.c (+161/-0)
gcs/src/gcs_comp_msg.h (+98/-0)
gcs/src/gcs_conf.c (+24/-0)
gcs/src/gcs_core.c (+1312/-0)
gcs/src/gcs_core.h (+180/-0)
gcs/src/gcs_defrag.c (+158/-0)
gcs/src/gcs_defrag.h (+89/-0)
gcs/src/gcs_dummy.c (+387/-0)
gcs/src/gcs_dummy.h (+45/-0)
gcs/src/gcs_fc.c (+206/-0)
gcs/src/gcs_fc.h (+59/-0)
gcs/src/gcs_fifo_lite.c (+161/-0)
gcs/src/gcs_fifo_lite.h (+197/-0)
gcs/src/gcs_gcache.h (+32/-0)
gcs/src/gcs_gcomm.cpp (+862/-0)
gcs/src/gcs_gcomm.h (+14/-0)
gcs/src/gcs_group.c (+1159/-0)
gcs/src/gcs_group.h (+230/-0)
gcs/src/gcs_msg_type.c (+20/-0)
gcs/src/gcs_msg_type.h (+46/-0)
gcs/src/gcs_node.c (+206/-0)
gcs/src/gcs_node.h (+142/-0)
gcs/src/gcs_params.c (+205/-0)
gcs/src/gcs_params.h (+42/-0)
gcs/src/gcs_priv.h (+18/-0)
gcs/src/gcs_recv_msg.h (+26/-0)
gcs/src/gcs_seqno.h (+22/-0)
gcs/src/gcs_sm.c (+177/-0)
gcs/src/gcs_sm.h (+416/-0)
gcs/src/gcs_spread.c (+731/-0)
gcs/src/gcs_spread.h (+17/-0)
gcs/src/gcs_state_msg.c (+768/-0)
gcs/src/gcs_state_msg.h (+162/-0)
gcs/src/gcs_test.c (+827/-0)
gcs/src/gcs_test.h (+55/-0)
gcs/src/gcs_test.sh (+20/-0)
gcs/src/unit_tests/SConscript (+54/-0)
gcs/src/unit_tests/gcs_backend_test.c (+108/-0)
gcs/src/unit_tests/gcs_backend_test.h (+12/-0)
gcs/src/unit_tests/gcs_comp_test.c (+152/-0)
gcs/src/unit_tests/gcs_comp_test.h (+12/-0)
gcs/src/unit_tests/gcs_core_test.c (+664/-0)
gcs/src/unit_tests/gcs_core_test.h (+12/-0)
gcs/src/unit_tests/gcs_defrag_test.c (+175/-0)
gcs/src/unit_tests/gcs_defrag_test.h (+12/-0)
gcs/src/unit_tests/gcs_fc_test.c (+134/-0)
gcs/src/unit_tests/gcs_fc_test.h (+12/-0)
gcs/src/unit_tests/gcs_fifo_test.c (+97/-0)
gcs/src/unit_tests/gcs_fifo_test.h (+10/-0)
gcs/src/unit_tests/gcs_group_test.c (+510/-0)
gcs/src/unit_tests/gcs_group_test.h (+12/-0)
gcs/src/unit_tests/gcs_memb_test.c (+476/-0)
gcs/src/unit_tests/gcs_memb_test.h (+12/-0)
gcs/src/unit_tests/gcs_node_test.c (+67/-0)
gcs/src/unit_tests/gcs_node_test.h (+12/-0)
gcs/src/unit_tests/gcs_proto_test.c (+117/-0)
gcs/src/unit_tests/gcs_proto_test.h (+12/-0)
gcs/src/unit_tests/gcs_sm_test.c (+493/-0)
gcs/src/unit_tests/gcs_sm_test.h (+10/-0)
gcs/src/unit_tests/gcs_state_msg_test.c (+427/-0)
gcs/src/unit_tests/gcs_state_msg_test.h (+10/-0)
gcs/src/unit_tests/gcs_tests.c (+90/-0)
scripts/build.sh (+404/-0)
scripts/mysql/LICENSE (+1/-0)
scripts/mysql/LICENSE.mysql (+352/-0)
scripts/mysql/QUICK_START (+95/-0)
scripts/mysql/README (+616/-0)
scripts/mysql/build.sh (+819/-0)
scripts/mysql/centos/init.centos (+152/-0)
scripts/mysql/centos/init.oracle (+444/-0)
scripts/mysql/centos/my.cnf (+18/-0)
scripts/mysql/centos/mysql-wsrep.list (+128/-0)
scripts/mysql/centos/mysqld_safe (+678/-0)
scripts/mysql/debian/5.1.list (+165/-0)
scripts/mysql/debian/5.5.list (+183/-0)
scripts/mysql/debian/common.list (+139/-0)
scripts/mysql/debian/debian-start.inc.sh (+72/-0)
scripts/mysql/debian/echo_stderr (+2/-0)
scripts/mysql/debian/etc/init.d/mysql (+187/-0)
scripts/mysql/debian/etc/logcheck/ignore.d.paranoid/mysql-server-5_1 (+9/-0)
scripts/mysql/debian/etc/logcheck/ignore.d.server/mysql-server-5_1 (+32/-0)
scripts/mysql/debian/etc/logcheck/ignore.d.workstation/mysql-server-5_1 (+32/-0)
scripts/mysql/debian/etc/logrotate.d/mysql-server (+27/-0)
scripts/mysql/debian/etc/mysql/conf.d/mysqld_safe_syslog.cnf (+2/-0)
scripts/mysql/debian/etc/mysql/debian-start (+31/-0)
scripts/mysql/debian/my.cnf (+138/-0)
scripts/mysql/debian/mysql (+205/-0)
scripts/mysql/debian/mysql-server-wsrep.list (+6/-0)
scripts/mysql/debian/mysqld_safe-5.1 (+655/-0)
scripts/mysql/debian/mysqld_safe-5.5 (+933/-0)
scripts/mysql/freebsd.sh (+73/-0)
scripts/mysql/freebsd/LICENSE (+1/-0)
scripts/mysql/freebsd/catalog.mk (+5/-0)
scripts/mysql/freebsd/client-comment (+1/-0)
scripts/mysql/freebsd/client-descr (+8/-0)
scripts/mysql/freebsd/client-ldconfig (+1/-0)
scripts/mysql/freebsd/client-mtree (+956/-0)
scripts/mysql/freebsd/client-plist (+124/-0)
scripts/mysql/freebsd/mysql-server.sh (+93/-0)
scripts/mysql/freebsd/server-comment (+1/-0)
scripts/mysql/freebsd/server-descr (+8/-0)
scripts/mysql/freebsd/server-message (+6/-0)
scripts/mysql/freebsd/server-mtree (+956/-0)
scripts/mysql/freebsd/server-plist (+239/-0)
scripts/mysql/get_patch.sh (+73/-0)
scripts/mysql/my-5.1.cnf (+20/-0)
scripts/mysql/my-5.5.cnf (+8/-0)
scripts/mysql/mysql-galera (+644/-0)
scripts/mysql/mysql-plain (+155/-0)
scripts/mysql/rpm.sh (+202/-0)
scripts/mysql/rpm_wc.sh (+132/-0)
scripts/openrep/common (+5/-0)
scripts/openrep/not_supported (+6/-0)
scripts/openrep/plugin.cnf (+30/-0)
scripts/openrep/redundant (+6/-0)
scripts/openrep/service (+262/-0)
scripts/packages/README (+563/-0)
scripts/packages/README-MySQL (+159/-0)
scripts/packages/freebsd.sh (+54/-0)
scripts/packages/freebsd/LICENSE (+1/-0)
scripts/packages/freebsd/catalog.mk (+5/-0)
scripts/packages/freebsd/galera-comment (+1/-0)
scripts/packages/freebsd/galera-descr (+6/-0)
scripts/packages/freebsd/galera-ldconfig (+1/-0)
scripts/packages/freebsd/galera-message (+16/-0)
scripts/packages/freebsd/galera-mtree (+956/-0)
scripts/packages/freebsd/galera-plist (+40/-0)
scripts/packages/galera-common.inc (+44/-0)
scripts/packages/galera-dev.list (+30/-0)
scripts/packages/galera.list (+43/-0)
scripts/packages/galera.spec (+112/-0)
scripts/packages/percona-xtradb-cluster-galera.spec (+91/-0)
scripts/packages/rpm.sh (+56/-0)
scripts/source/COPYING (+674/-0)
scripts/source/README (+13/-0)
scripts/source/build.sh (+92/-0)
scripts/source/package.sh (+117/-0)
tests/conf/cluster.conf.tmpl (+64/-0)
tests/conf/dummy.conf (+3/-0)
tests/conf/galera_cert.pem (+19/-0)
tests/conf/galera_key.pem (+15/-0)
tests/conf/main.conf (+55/-0)
tests/conf/nodes.conf.tmpl (+73/-0)
tests/conf/sqlgen.conf (+3/-0)
tests/regressions/lp1003929/run.sh (+128/-0)
tests/regressions/lp1013978/run.sh (+400/-0)
tests/regressions/lp1026181/run.sh (+201/-0)
tests/regressions/lp1055961/run.sh (+183/-0)
tests/regressions/lp1073220/run.sh (+62/-0)
tests/regressions/lp1089490/run.sh (+163/-0)
tests/regressions/lp1179361/run.sh (+130/-0)
tests/regressions/lp1184034/run.sh (+37/-0)
tests/regressions/lp1206129/run.sh (+65/-0)
tests/regressions/lp518749/mysqlfs.sql (+110/-0)
tests/regressions/lp518749/run.sh (+33/-0)
tests/regressions/lp847353/run.sh (+89/-0)
tests/regressions/lp861212/run.sh (+55/-0)
tests/regressions/lp900816/run.sh (+32/-0)
tests/regressions/lp909155/run.sh (+163/-0)
tests/regressions/lp917416/run.sh (+190/-0)
tests/regressions/lp922757/run.sh (+190/-0)
tests/regressions/lp928150/run.sh (+52/-0)
tests/regressions/lp930221/run.sh (+74/-0)
tests/regressions/lp959512/run.sh (+63/-0)
tests/regressions/lp963734/run.sh (+94/-0)
tests/regressions/lp966950/run.sh (+52/-0)
tests/regressions/lp967134/run.sh (+79/-0)
tests/regressions/lp970714/lp.sql (+1652/-0)
tests/regressions/lp970714/run.sh (+147/-0)
tests/regressions/lp994579/run.sh (+245/-0)
tests/regressions/run-all.sh (+42/-0)
tests/regressions/t281/run.sh (+63/-0)
tests/regressions/t285/run.sh (+65/-0)
tests/run.sh (+53/-0)
tests/run_test_set.sh (+31/-0)
tests/scripts/README (+56/-0)
tests/scripts/action.sh (+312/-0)
tests/scripts/command.sh (+33/-0)
tests/scripts/install.sh (+72/-0)
tests/scripts/jobs.sh (+129/-0)
tests/scripts/kill.sh (+31/-0)
tests/scripts/misc.sh (+27/-0)
tests/scripts/remove.sh (+18/-0)
tests/scripts/signal.sh (+26/-0)
tests/t/dummy.sh (+38/-0)
tests/tap/README (+8/-0)
tests/tap/run_test_set.pl (+174/-0)
tests/tap/tap-functions (+453/-0)
tests/test_causal/SConstruct (+5/-0)
tests/test_causal/causal.cpp (+382/-0)
tests/test_causal/causal.sh (+51/-0)
tests/test_causal/hard_causal.sh (+213/-0)
tests/test_cppcheck/run.sh (+21/-0)
tests/test_dbt2/run.sh (+4/-0)
tests/test_dots/run.sh (+4/-0)
tests/test_drupal/README (+93/-0)
tests/test_drupal/drupal.jmx (+2389/-0)
tests/test_drupal/drupal5.diff (+167/-0)
tests/test_drupal/drupal6.jmx (+3231/-0)
tests/test_drupal/drupal6_8080.jmx (+3360/-0)
tests/test_drupal/loaddb.sh (+33/-0)
tests/test_drupal/run.sh (+145/-0)
tests/test_insert/create_big.sql (+8/-0)
tests/test_insert/create_small.sql (+8/-0)
tests/test_insert/insert_big.sql (+20/-0)
tests/test_insert/insert_small.sql (+8/-0)
tests/test_insert/run.sh (+38/-0)
tests/test_mtr/innodb.suite (+258/-0)
tests/test_mtr/run.sh (+133/-0)
tests/test_overhead/run.sh (+92/-0)
tests/test_seesaw/README (+19/-0)
tests/test_seesaw/run.sh (+113/-0)
tests/test_sqlgen/run.sh (+44/-0)
tests/test_startstop/run.sh (+29/-0)
tests/test_stopcont/README (+14/-0)
tests/test_stopcont/run.sh (+84/-0)
tests/test_upgrade/README (+12/-0)
tests/test_upgrade/run.sh (+92/-0)
Conflict adding file .bzrignore.  Moved existing file to .bzrignore.moved.
Conflict adding file tests.  Moved existing file to tests.moved.
To merge this branch: bzr merge lp:~abychko/percona-xtradb-cluster/galera-2.x-relocation
Reviewer Review Type Date Requested Status
Raghavendra D Prabhu Pending
Review via email: mp+194164@code.launchpad.net

Description of the change

added Relocation for %{_prefix}

/usr/bin/garbd
/usr/lib/libgalera_smm.so
Name : Percona-XtraDB-Cluster-galera Relocations: /usr

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file '.bzrignore'
2--- .bzrignore 1970-01-01 00:00:00 +0000
3+++ .bzrignore 2013-11-06 15:11:01 +0000
4@@ -0,0 +1,78 @@
5+#*#
6+*$
7+*,v
8+*.BAK
9+*.a
10+*.bak
11+*.elc
12+*.exe
13+*.la
14+*.lo
15+*.o
16+*.obj
17+*.orig
18+*.py[oc]
19+*.so
20+*.os
21+*.tmp
22+*.log
23+*.passed
24+*~
25+.#*
26+.*.sw[nop]
27+.*.tmp
28+./.python-eggs
29+.DS_Store
30+.arch-ids
31+.arch-inventory
32+.bzr.log
33+.del-*
34+.git
35+.hg
36+.jamdeps.libs
37+.make.state
38+.sconsign*
39+.svn
40+.sw[nop]
41+.tmp*
42+BitKeeper
43+CVS
44+CVS.adm
45+RCS
46+SCCS
47+TAGS
48+_darcs
49+aclocal.m4
50+autom4te*
51+config.h
52+config.h.in
53+config.log
54+config.status
55+config.sub
56+stamp-h
57+stamp-h.in
58+stamp-h1
59+scons*
60+.sconf*
61+{arch}
62+galera_check
63+gu_tests
64+gu_tests++
65+check_gcomm
66+gcs_test
67+gcs_tests
68+cluster.conf
69+nodes.conf
70+tests/conf/*.cnf
71+tests/run
72+tests/out
73+tests/bin/*
74+gcache/src/test
75+gcache/tests/gcache_tests
76+Makefile
77+Makefile.in
78+.deps
79+.libs
80+garb/garbd
81+gcs/src/.garb
82+
83
84=== renamed file '.bzrignore' => '.bzrignore.moved'
85=== added file 'AUTHORS'
86--- AUTHORS 1970-01-01 00:00:00 +0000
87+++ AUTHORS 2013-11-06 15:11:01 +0000
88@@ -0,0 +1,1 @@
89+Codership Oy <info@codership.com>
90
91=== added file 'COPYING'
92--- COPYING 1970-01-01 00:00:00 +0000
93+++ COPYING 2013-11-06 15:11:01 +0000
94@@ -0,0 +1,9 @@
95+
96+Copyright (C) 2007-2013 Codership Oy <info@codership.com>
97+
98+Distributed under the GNU General Public Licence v3.0
99+as shown in LICENSE.txt or at http://www.gnu.org/copyleft/gpl.html)
100+
101+Exceptions: asio/ and tests/test_sysbench
102+See asio/COPYING and tests/test_sysbench/COPYING for respective details.
103+
104
105=== added file 'GALERA-REVISION'
106--- GALERA-REVISION 1970-01-01 00:00:00 +0000
107+++ GALERA-REVISION 2013-11-06 15:11:01 +0000
108@@ -0,0 +1,1 @@
109+162
110
111=== added file 'LICENSE'
112--- LICENSE 1970-01-01 00:00:00 +0000
113+++ LICENSE 2013-11-06 15:11:01 +0000
114@@ -0,0 +1,674 @@
115+ GNU GENERAL PUBLIC LICENSE
116+ Version 3, 29 June 2007
117+
118+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
119+ Everyone is permitted to copy and distribute verbatim copies
120+ of this license document, but changing it is not allowed.
121+
122+ Preamble
123+
124+ The GNU General Public License is a free, copyleft license for
125+software and other kinds of works.
126+
127+ The licenses for most software and other practical works are designed
128+to take away your freedom to share and change the works. By contrast,
129+the GNU General Public License is intended to guarantee your freedom to
130+share and change all versions of a program--to make sure it remains free
131+software for all its users. We, the Free Software Foundation, use the
132+GNU General Public License for most of our software; it applies also to
133+any other work released this way by its authors. You can apply it to
134+your programs, too.
135+
136+ When we speak of free software, we are referring to freedom, not
137+price. Our General Public Licenses are designed to make sure that you
138+have the freedom to distribute copies of free software (and charge for
139+them if you wish), that you receive source code or can get it if you
140+want it, that you can change the software or use pieces of it in new
141+free programs, and that you know you can do these things.
142+
143+ To protect your rights, we need to prevent others from denying you
144+these rights or asking you to surrender the rights. Therefore, you have
145+certain responsibilities if you distribute copies of the software, or if
146+you modify it: responsibilities to respect the freedom of others.
147+
148+ For example, if you distribute copies of such a program, whether
149+gratis or for a fee, you must pass on to the recipients the same
150+freedoms that you received. You must make sure that they, too, receive
151+or can get the source code. And you must show them these terms so they
152+know their rights.
153+
154+ Developers that use the GNU GPL protect your rights with two steps:
155+(1) assert copyright on the software, and (2) offer you this License
156+giving you legal permission to copy, distribute and/or modify it.
157+
158+ For the developers' and authors' protection, the GPL clearly explains
159+that there is no warranty for this free software. For both users' and
160+authors' sake, the GPL requires that modified versions be marked as
161+changed, so that their problems will not be attributed erroneously to
162+authors of previous versions.
163+
164+ Some devices are designed to deny users access to install or run
165+modified versions of the software inside them, although the manufacturer
166+can do so. This is fundamentally incompatible with the aim of
167+protecting users' freedom to change the software. The systematic
168+pattern of such abuse occurs in the area of products for individuals to
169+use, which is precisely where it is most unacceptable. Therefore, we
170+have designed this version of the GPL to prohibit the practice for those
171+products. If such problems arise substantially in other domains, we
172+stand ready to extend this provision to those domains in future versions
173+of the GPL, as needed to protect the freedom of users.
174+
175+ Finally, every program is threatened constantly by software patents.
176+States should not allow patents to restrict development and use of
177+software on general-purpose computers, but in those that do, we wish to
178+avoid the special danger that patents applied to a free program could
179+make it effectively proprietary. To prevent this, the GPL assures that
180+patents cannot be used to render the program non-free.
181+
182+ The precise terms and conditions for copying, distribution and
183+modification follow.
184+
185+ TERMS AND CONDITIONS
186+
187+ 0. Definitions.
188+
189+ "This License" refers to version 3 of the GNU General Public License.
190+
191+ "Copyright" also means copyright-like laws that apply to other kinds of
192+works, such as semiconductor masks.
193+
194+ "The Program" refers to any copyrightable work licensed under this
195+License. Each licensee is addressed as "you". "Licensees" and
196+"recipients" may be individuals or organizations.
197+
198+ To "modify" a work means to copy from or adapt all or part of the work
199+in a fashion requiring copyright permission, other than the making of an
200+exact copy. The resulting work is called a "modified version" of the
201+earlier work or a work "based on" the earlier work.
202+
203+ A "covered work" means either the unmodified Program or a work based
204+on the Program.
205+
206+ To "propagate" a work means to do anything with it that, without
207+permission, would make you directly or secondarily liable for
208+infringement under applicable copyright law, except executing it on a
209+computer or modifying a private copy. Propagation includes copying,
210+distribution (with or without modification), making available to the
211+public, and in some countries other activities as well.
212+
213+ To "convey" a work means any kind of propagation that enables other
214+parties to make or receive copies. Mere interaction with a user through
215+a computer network, with no transfer of a copy, is not conveying.
216+
217+ An interactive user interface displays "Appropriate Legal Notices"
218+to the extent that it includes a convenient and prominently visible
219+feature that (1) displays an appropriate copyright notice, and (2)
220+tells the user that there is no warranty for the work (except to the
221+extent that warranties are provided), that licensees may convey the
222+work under this License, and how to view a copy of this License. If
223+the interface presents a list of user commands or options, such as a
224+menu, a prominent item in the list meets this criterion.
225+
226+ 1. Source Code.
227+
228+ The "source code" for a work means the preferred form of the work
229+for making modifications to it. "Object code" means any non-source
230+form of a work.
231+
232+ A "Standard Interface" means an interface that either is an official
233+standard defined by a recognized standards body, or, in the case of
234+interfaces specified for a particular programming language, one that
235+is widely used among developers working in that language.
236+
237+ The "System Libraries" of an executable work include anything, other
238+than the work as a whole, that (a) is included in the normal form of
239+packaging a Major Component, but which is not part of that Major
240+Component, and (b) serves only to enable use of the work with that
241+Major Component, or to implement a Standard Interface for which an
242+implementation is available to the public in source code form. A
243+"Major Component", in this context, means a major essential component
244+(kernel, window system, and so on) of the specific operating system
245+(if any) on which the executable work runs, or a compiler used to
246+produce the work, or an object code interpreter used to run it.
247+
248+ The "Corresponding Source" for a work in object code form means all
249+the source code needed to generate, install, and (for an executable
250+work) run the object code and to modify the work, including scripts to
251+control those activities. However, it does not include the work's
252+System Libraries, or general-purpose tools or generally available free
253+programs which are used unmodified in performing those activities but
254+which are not part of the work. For example, Corresponding Source
255+includes interface definition files associated with source files for
256+the work, and the source code for shared libraries and dynamically
257+linked subprograms that the work is specifically designed to require,
258+such as by intimate data communication or control flow between those
259+subprograms and other parts of the work.
260+
261+ The Corresponding Source need not include anything that users
262+can regenerate automatically from other parts of the Corresponding
263+Source.
264+
265+ The Corresponding Source for a work in source code form is that
266+same work.
267+
268+ 2. Basic Permissions.
269+
270+ All rights granted under this License are granted for the term of
271+copyright on the Program, and are irrevocable provided the stated
272+conditions are met. This License explicitly affirms your unlimited
273+permission to run the unmodified Program. The output from running a
274+covered work is covered by this License only if the output, given its
275+content, constitutes a covered work. This License acknowledges your
276+rights of fair use or other equivalent, as provided by copyright law.
277+
278+ You may make, run and propagate covered works that you do not
279+convey, without conditions so long as your license otherwise remains
280+in force. You may convey covered works to others for the sole purpose
281+of having them make modifications exclusively for you, or provide you
282+with facilities for running those works, provided that you comply with
283+the terms of this License in conveying all material for which you do
284+not control copyright. Those thus making or running the covered works
285+for you must do so exclusively on your behalf, under your direction
286+and control, on terms that prohibit them from making any copies of
287+your copyrighted material outside their relationship with you.
288+
289+ Conveying under any other circumstances is permitted solely under
290+the conditions stated below. Sublicensing is not allowed; section 10
291+makes it unnecessary.
292+
293+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
294+
295+ No covered work shall be deemed part of an effective technological
296+measure under any applicable law fulfilling obligations under article
297+11 of the WIPO copyright treaty adopted on 20 December 1996, or
298+similar laws prohibiting or restricting circumvention of such
299+measures.
300+
301+ When you convey a covered work, you waive any legal power to forbid
302+circumvention of technological measures to the extent such circumvention
303+is effected by exercising rights under this License with respect to
304+the covered work, and you disclaim any intention to limit operation or
305+modification of the work as a means of enforcing, against the work's
306+users, your or third parties' legal rights to forbid circumvention of
307+technological measures.
308+
309+ 4. Conveying Verbatim Copies.
310+
311+ You may convey verbatim copies of the Program's source code as you
312+receive it, in any medium, provided that you conspicuously and
313+appropriately publish on each copy an appropriate copyright notice;
314+keep intact all notices stating that this License and any
315+non-permissive terms added in accord with section 7 apply to the code;
316+keep intact all notices of the absence of any warranty; and give all
317+recipients a copy of this License along with the Program.
318+
319+ You may charge any price or no price for each copy that you convey,
320+and you may offer support or warranty protection for a fee.
321+
322+ 5. Conveying Modified Source Versions.
323+
324+ You may convey a work based on the Program, or the modifications to
325+produce it from the Program, in the form of source code under the
326+terms of section 4, provided that you also meet all of these conditions:
327+
328+ a) The work must carry prominent notices stating that you modified
329+ it, and giving a relevant date.
330+
331+ b) The work must carry prominent notices stating that it is
332+ released under this License and any conditions added under section
333+ 7. This requirement modifies the requirement in section 4 to
334+ "keep intact all notices".
335+
336+ c) You must license the entire work, as a whole, under this
337+ License to anyone who comes into possession of a copy. This
338+ License will therefore apply, along with any applicable section 7
339+ additional terms, to the whole of the work, and all its parts,
340+ regardless of how they are packaged. This License gives no
341+ permission to license the work in any other way, but it does not
342+ invalidate such permission if you have separately received it.
343+
344+ d) If the work has interactive user interfaces, each must display
345+ Appropriate Legal Notices; however, if the Program has interactive
346+ interfaces that do not display Appropriate Legal Notices, your
347+ work need not make them do so.
348+
349+ A compilation of a covered work with other separate and independent
350+works, which are not by their nature extensions of the covered work,
351+and which are not combined with it such as to form a larger program,
352+in or on a volume of a storage or distribution medium, is called an
353+"aggregate" if the compilation and its resulting copyright are not
354+used to limit the access or legal rights of the compilation's users
355+beyond what the individual works permit. Inclusion of a covered work
356+in an aggregate does not cause this License to apply to the other
357+parts of the aggregate.
358+
359+ 6. Conveying Non-Source Forms.
360+
361+ You may convey a covered work in object code form under the terms
362+of sections 4 and 5, provided that you also convey the
363+machine-readable Corresponding Source under the terms of this License,
364+in one of these ways:
365+
366+ a) Convey the object code in, or embodied in, a physical product
367+ (including a physical distribution medium), accompanied by the
368+ Corresponding Source fixed on a durable physical medium
369+ customarily used for software interchange.
370+
371+ b) Convey the object code in, or embodied in, a physical product
372+ (including a physical distribution medium), accompanied by a
373+ written offer, valid for at least three years and valid for as
374+ long as you offer spare parts or customer support for that product
375+ model, to give anyone who possesses the object code either (1) a
376+ copy of the Corresponding Source for all the software in the
377+ product that is covered by this License, on a durable physical
378+ medium customarily used for software interchange, for a price no
379+ more than your reasonable cost of physically performing this
380+ conveying of source, or (2) access to copy the
381+ Corresponding Source from a network server at no charge.
382+
383+ c) Convey individual copies of the object code with a copy of the
384+ written offer to provide the Corresponding Source. This
385+ alternative is allowed only occasionally and noncommercially, and
386+ only if you received the object code with such an offer, in accord
387+ with subsection 6b.
388+
389+ d) Convey the object code by offering access from a designated
390+ place (gratis or for a charge), and offer equivalent access to the
391+ Corresponding Source in the same way through the same place at no
392+ further charge. You need not require recipients to copy the
393+ Corresponding Source along with the object code. If the place to
394+ copy the object code is a network server, the Corresponding Source
395+ may be on a different server (operated by you or a third party)
396+ that supports equivalent copying facilities, provided you maintain
397+ clear directions next to the object code saying where to find the
398+ Corresponding Source. Regardless of what server hosts the
399+ Corresponding Source, you remain obligated to ensure that it is
400+ available for as long as needed to satisfy these requirements.
401+
402+ e) Convey the object code using peer-to-peer transmission, provided
403+ you inform other peers where the object code and Corresponding
404+ Source of the work are being offered to the general public at no
405+ charge under subsection 6d.
406+
407+ A separable portion of the object code, whose source code is excluded
408+from the Corresponding Source as a System Library, need not be
409+included in conveying the object code work.
410+
411+ A "User Product" is either (1) a "consumer product", which means any
412+tangible personal property which is normally used for personal, family,
413+or household purposes, or (2) anything designed or sold for incorporation
414+into a dwelling. In determining whether a product is a consumer product,
415+doubtful cases shall be resolved in favor of coverage. For a particular
416+product received by a particular user, "normally used" refers to a
417+typical or common use of that class of product, regardless of the status
418+of the particular user or of the way in which the particular user
419+actually uses, or expects or is expected to use, the product. A product
420+is a consumer product regardless of whether the product has substantial
421+commercial, industrial or non-consumer uses, unless such uses represent
422+the only significant mode of use of the product.
423+
424+ "Installation Information" for a User Product means any methods,
425+procedures, authorization keys, or other information required to install
426+and execute modified versions of a covered work in that User Product from
427+a modified version of its Corresponding Source. The information must
428+suffice to ensure that the continued functioning of the modified object
429+code is in no case prevented or interfered with solely because
430+modification has been made.
431+
432+ If you convey an object code work under this section in, or with, or
433+specifically for use in, a User Product, and the conveying occurs as
434+part of a transaction in which the right of possession and use of the
435+User Product is transferred to the recipient in perpetuity or for a
436+fixed term (regardless of how the transaction is characterized), the
437+Corresponding Source conveyed under this section must be accompanied
438+by the Installation Information. But this requirement does not apply
439+if neither you nor any third party retains the ability to install
440+modified object code on the User Product (for example, the work has
441+been installed in ROM).
442+
443+ The requirement to provide Installation Information does not include a
444+requirement to continue to provide support service, warranty, or updates
445+for a work that has been modified or installed by the recipient, or for
446+the User Product in which it has been modified or installed. Access to a
447+network may be denied when the modification itself materially and
448+adversely affects the operation of the network or violates the rules and
449+protocols for communication across the network.
450+
451+ Corresponding Source conveyed, and Installation Information provided,
452+in accord with this section must be in a format that is publicly
453+documented (and with an implementation available to the public in
454+source code form), and must require no special password or key for
455+unpacking, reading or copying.
456+
457+ 7. Additional Terms.
458+
459+ "Additional permissions" are terms that supplement the terms of this
460+License by making exceptions from one or more of its conditions.
461+Additional permissions that are applicable to the entire Program shall
462+be treated as though they were included in this License, to the extent
463+that they are valid under applicable law. If additional permissions
464+apply only to part of the Program, that part may be used separately
465+under those permissions, but the entire Program remains governed by
466+this License without regard to the additional permissions.
467+
468+ When you convey a copy of a covered work, you may at your option
469+remove any additional permissions from that copy, or from any part of
470+it. (Additional permissions may be written to require their own
471+removal in certain cases when you modify the work.) You may place
472+additional permissions on material, added by you to a covered work,
473+for which you have or can give appropriate copyright permission.
474+
475+ Notwithstanding any other provision of this License, for material you
476+add to a covered work, you may (if authorized by the copyright holders of
477+that material) supplement the terms of this License with terms:
478+
479+ a) Disclaiming warranty or limiting liability differently from the
480+ terms of sections 15 and 16 of this License; or
481+
482+ b) Requiring preservation of specified reasonable legal notices or
483+ author attributions in that material or in the Appropriate Legal
484+ Notices displayed by works containing it; or
485+
486+ c) Prohibiting misrepresentation of the origin of that material, or
487+ requiring that modified versions of such material be marked in
488+ reasonable ways as different from the original version; or
489+
490+ d) Limiting the use for publicity purposes of names of licensors or
491+ authors of the material; or
492+
493+ e) Declining to grant rights under trademark law for use of some
494+ trade names, trademarks, or service marks; or
495+
496+ f) Requiring indemnification of licensors and authors of that
497+ material by anyone who conveys the material (or modified versions of
498+ it) with contractual assumptions of liability to the recipient, for
499+ any liability that these contractual assumptions directly impose on
500+ those licensors and authors.
501+
502+ All other non-permissive additional terms are considered "further
503+restrictions" within the meaning of section 10. If the Program as you
504+received it, or any part of it, contains a notice stating that it is
505+governed by this License along with a term that is a further
506+restriction, you may remove that term. If a license document contains
507+a further restriction but permits relicensing or conveying under this
508+License, you may add to a covered work material governed by the terms
509+of that license document, provided that the further restriction does
510+not survive such relicensing or conveying.
511+
512+ If you add terms to a covered work in accord with this section, you
513+must place, in the relevant source files, a statement of the
514+additional terms that apply to those files, or a notice indicating
515+where to find the applicable terms.
516+
517+ Additional terms, permissive or non-permissive, may be stated in the
518+form of a separately written license, or stated as exceptions;
519+the above requirements apply either way.
520+
521+ 8. Termination.
522+
523+ You may not propagate or modify a covered work except as expressly
524+provided under this License. Any attempt otherwise to propagate or
525+modify it is void, and will automatically terminate your rights under
526+this License (including any patent licenses granted under the third
527+paragraph of section 11).
528+
529+ However, if you cease all violation of this License, then your
530+license from a particular copyright holder is reinstated (a)
531+provisionally, unless and until the copyright holder explicitly and
532+finally terminates your license, and (b) permanently, if the copyright
533+holder fails to notify you of the violation by some reasonable means
534+prior to 60 days after the cessation.
535+
536+ Moreover, your license from a particular copyright holder is
537+reinstated permanently if the copyright holder notifies you of the
538+violation by some reasonable means, this is the first time you have
539+received notice of violation of this License (for any work) from that
540+copyright holder, and you cure the violation prior to 30 days after
541+your receipt of the notice.
542+
543+ Termination of your rights under this section does not terminate the
544+licenses of parties who have received copies or rights from you under
545+this License. If your rights have been terminated and not permanently
546+reinstated, you do not qualify to receive new licenses for the same
547+material under section 10.
548+
549+ 9. Acceptance Not Required for Having Copies.
550+
551+ You are not required to accept this License in order to receive or
552+run a copy of the Program. Ancillary propagation of a covered work
553+occurring solely as a consequence of using peer-to-peer transmission
554+to receive a copy likewise does not require acceptance. However,
555+nothing other than this License grants you permission to propagate or
556+modify any covered work. These actions infringe copyright if you do
557+not accept this License. Therefore, by modifying or propagating a
558+covered work, you indicate your acceptance of this License to do so.
559+
560+ 10. Automatic Licensing of Downstream Recipients.
561+
562+ Each time you convey a covered work, the recipient automatically
563+receives a license from the original licensors, to run, modify and
564+propagate that work, subject to this License. You are not responsible
565+for enforcing compliance by third parties with this License.
566+
567+ An "entity transaction" is a transaction transferring control of an
568+organization, or substantially all assets of one, or subdividing an
569+organization, or merging organizations. If propagation of a covered
570+work results from an entity transaction, each party to that
571+transaction who receives a copy of the work also receives whatever
572+licenses to the work the party's predecessor in interest had or could
573+give under the previous paragraph, plus a right to possession of the
574+Corresponding Source of the work from the predecessor in interest, if
575+the predecessor has it or can get it with reasonable efforts.
576+
577+ You may not impose any further restrictions on the exercise of the
578+rights granted or affirmed under this License. For example, you may
579+not impose a license fee, royalty, or other charge for exercise of
580+rights granted under this License, and you may not initiate litigation
581+(including a cross-claim or counterclaim in a lawsuit) alleging that
582+any patent claim is infringed by making, using, selling, offering for
583+sale, or importing the Program or any portion of it.
584+
585+ 11. Patents.
586+
587+ A "contributor" is a copyright holder who authorizes use under this
588+License of the Program or a work on which the Program is based. The
589+work thus licensed is called the contributor's "contributor version".
590+
591+ A contributor's "essential patent claims" are all patent claims
592+owned or controlled by the contributor, whether already acquired or
593+hereafter acquired, that would be infringed by some manner, permitted
594+by this License, of making, using, or selling its contributor version,
595+but do not include claims that would be infringed only as a
596+consequence of further modification of the contributor version. For
597+purposes of this definition, "control" includes the right to grant
598+patent sublicenses in a manner consistent with the requirements of
599+this License.
600+
601+ Each contributor grants you a non-exclusive, worldwide, royalty-free
602+patent license under the contributor's essential patent claims, to
603+make, use, sell, offer for sale, import and otherwise run, modify and
604+propagate the contents of its contributor version.
605+
606+ In the following three paragraphs, a "patent license" is any express
607+agreement or commitment, however denominated, not to enforce a patent
608+(such as an express permission to practice a patent or covenant not to
609+sue for patent infringement). To "grant" such a patent license to a
610+party means to make such an agreement or commitment not to enforce a
611+patent against the party.
612+
613+ If you convey a covered work, knowingly relying on a patent license,
614+and the Corresponding Source of the work is not available for anyone
615+to copy, free of charge and under the terms of this License, through a
616+publicly available network server or other readily accessible means,
617+then you must either (1) cause the Corresponding Source to be so
618+available, or (2) arrange to deprive yourself of the benefit of the
619+patent license for this particular work, or (3) arrange, in a manner
620+consistent with the requirements of this License, to extend the patent
621+license to downstream recipients. "Knowingly relying" means you have
622+actual knowledge that, but for the patent license, your conveying the
623+covered work in a country, or your recipient's use of the covered work
624+in a country, would infringe one or more identifiable patents in that
625+country that you have reason to believe are valid.
626+
627+ If, pursuant to or in connection with a single transaction or
628+arrangement, you convey, or propagate by procuring conveyance of, a
629+covered work, and grant a patent license to some of the parties
630+receiving the covered work authorizing them to use, propagate, modify
631+or convey a specific copy of the covered work, then the patent license
632+you grant is automatically extended to all recipients of the covered
633+work and works based on it.
634+
635+ A patent license is "discriminatory" if it does not include within
636+the scope of its coverage, prohibits the exercise of, or is
637+conditioned on the non-exercise of one or more of the rights that are
638+specifically granted under this License. You may not convey a covered
639+work if you are a party to an arrangement with a third party that is
640+in the business of distributing software, under which you make payment
641+to the third party based on the extent of your activity of conveying
642+the work, and under which the third party grants, to any of the
643+parties who would receive the covered work from you, a discriminatory
644+patent license (a) in connection with copies of the covered work
645+conveyed by you (or copies made from those copies), or (b) primarily
646+for and in connection with specific products or compilations that
647+contain the covered work, unless you entered into that arrangement,
648+or that patent license was granted, prior to 28 March 2007.
649+
650+ Nothing in this License shall be construed as excluding or limiting
651+any implied license or other defenses to infringement that may
652+otherwise be available to you under applicable patent law.
653+
654+ 12. No Surrender of Others' Freedom.
655+
656+ If conditions are imposed on you (whether by court order, agreement or
657+otherwise) that contradict the conditions of this License, they do not
658+excuse you from the conditions of this License. If you cannot convey a
659+covered work so as to satisfy simultaneously your obligations under this
660+License and any other pertinent obligations, then as a consequence you may
661+not convey it at all. For example, if you agree to terms that obligate you
662+to collect a royalty for further conveying from those to whom you convey
663+the Program, the only way you could satisfy both those terms and this
664+License would be to refrain entirely from conveying the Program.
665+
666+ 13. Use with the GNU Affero General Public License.
667+
668+ Notwithstanding any other provision of this License, you have
669+permission to link or combine any covered work with a work licensed
670+under version 3 of the GNU Affero General Public License into a single
671+combined work, and to convey the resulting work. The terms of this
672+License will continue to apply to the part which is the covered work,
673+but the special requirements of the GNU Affero General Public License,
674+section 13, concerning interaction through a network will apply to the
675+combination as such.
676+
677+ 14. Revised Versions of this License.
678+
679+ The Free Software Foundation may publish revised and/or new versions of
680+the GNU General Public License from time to time. Such new versions will
681+be similar in spirit to the present version, but may differ in detail to
682+address new problems or concerns.
683+
684+ Each version is given a distinguishing version number. If the
685+Program specifies that a certain numbered version of the GNU General
686+Public License "or any later version" applies to it, you have the
687+option of following the terms and conditions either of that numbered
688+version or of any later version published by the Free Software
689+Foundation. If the Program does not specify a version number of the
690+GNU General Public License, you may choose any version ever published
691+by the Free Software Foundation.
692+
693+ If the Program specifies that a proxy can decide which future
694+versions of the GNU General Public License can be used, that proxy's
695+public statement of acceptance of a version permanently authorizes you
696+to choose that version for the Program.
697+
698+ Later license versions may give you additional or different
699+permissions. However, no additional obligations are imposed on any
700+author or copyright holder as a result of your choosing to follow a
701+later version.
702+
703+ 15. Disclaimer of Warranty.
704+
705+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
706+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
707+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
708+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
709+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
710+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
711+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
712+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
713+
714+ 16. Limitation of Liability.
715+
716+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
717+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
718+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
719+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
720+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
721+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
722+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
723+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
724+SUCH DAMAGES.
725+
726+ 17. Interpretation of Sections 15 and 16.
727+
728+ If the disclaimer of warranty and limitation of liability provided
729+above cannot be given local legal effect according to their terms,
730+reviewing courts shall apply local law that most closely approximates
731+an absolute waiver of all civil liability in connection with the
732+Program, unless a warranty or assumption of liability accompanies a
733+copy of the Program in return for a fee.
734+
735+ END OF TERMS AND CONDITIONS
736+
737+ How to Apply These Terms to Your New Programs
738+
739+ If you develop a new program, and you want it to be of the greatest
740+possible use to the public, the best way to achieve this is to make it
741+free software which everyone can redistribute and change under these terms.
742+
743+ To do so, attach the following notices to the program. It is safest
744+to attach them to the start of each source file to most effectively
745+state the exclusion of warranty; and each file should have at least
746+the "copyright" line and a pointer to where the full notice is found.
747+
748+ <one line to give the program's name and a brief idea of what it does.>
749+ Copyright (C) <year> <name of author>
750+
751+ This program is free software: you can redistribute it and/or modify
752+ it under the terms of the GNU General Public License as published by
753+ the Free Software Foundation, either version 3 of the License, or
754+ (at your option) any later version.
755+
756+ This program is distributed in the hope that it will be useful,
757+ but WITHOUT ANY WARRANTY; without even the implied warranty of
758+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
759+ GNU General Public License for more details.
760+
761+ You should have received a copy of the GNU General Public License
762+ along with this program. If not, see <http://www.gnu.org/licenses/>.
763+
764+Also add information on how to contact you by electronic and paper mail.
765+
766+ If the program does terminal interaction, make it output a short
767+notice like this when it starts in an interactive mode:
768+
769+ <program> Copyright (C) <year> <name of author>
770+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
771+ This is free software, and you are welcome to redistribute it
772+ under certain conditions; type `show c' for details.
773+
774+The hypothetical commands `show w' and `show c' should show the appropriate
775+parts of the General Public License. Of course, your program's commands
776+might be different; for a GUI interface, you would use an "about box".
777+
778+ You should also get your employer (if you work as a programmer) or school,
779+if any, to sign a "copyright disclaimer" for the program, if necessary.
780+For more information on this, and how to apply and follow the GNU GPL, see
781+<http://www.gnu.org/licenses/>.
782+
783+ The GNU General Public License does not permit incorporating your program
784+into proprietary programs. If your program is a subroutine library, you
785+may consider it more useful to permit linking proprietary applications with
786+the library. If this is what you want to do, use the GNU Lesser General
787+Public License instead of this License. But first, please read
788+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
789
790=== added file 'README'
791--- README 1970-01-01 00:00:00 +0000
792+++ README 2013-11-06 15:11:01 +0000
793@@ -0,0 +1,64 @@
794+Codership Oy
795+http://www.codership.com
796+<info@codership.com>
797+
798+This is Galera - Codership's implementation of wsrep interface
799+(https://launchpad.net/wsrep/). The software and other files in this directory
800+unless otherwise noted are distributed under GPLv3, see COPYING for details.
801+
802+
803+BUILDING - general
804+
805+Build Requirements:
806+* Scons build system http://www.scons.org/
807+* Check unit test library http://check.sourceforge.net/
808+* Boost devel package http://www.boost.org/
809+* OpenSSL devel package
810+
811+To compile, in Galera root directory do either:
812+ $ scons
813+(default optimized build)
814+or
815+ $ ./scripts/build.sh
816+(see ./scripts/build.sh --help for information on options)
817+
818+To build MySQL/Galera demo distribution, branch lp:codership-mysql into
819+some directory (hereafter <MYSQL_DIR>) and run build script from this
820+directory (hereafter <GALERA_DIR>):
821+
822+ $ cd <MYSQL_DIR>
823+ $ bzr branch lp:codership-mysql
824+ $ cd <GALERA_DIR>
825+ $ MYSQL_SRC=<MYSQL_DIR>/codership-mysql ./scripts/mysql/build.sh -b -s -o -t
826+
827+After successful build, demo package can be found under scripts/mysql.
828+
829+
830+BUILDING on CentOS/RHEL 5
831+
832+CentOS/RHEL by default uses a very old version of GCC and a likewise ancient
833+version of BOOST that lacks important features. In order to build Galera on
834+CentOS/RHEL one needs to:
835+
836+ 1) Install gcc44 and gcc44-c++ packages and set CC and CXX variables
837+ accordingly:
838+ # yum install gcc44 gcc44-c++
839+ # export CC=gcc44
840+ # export CXX=g++44
841+ 2) Remove standard boost and boost-devel packages (if present)
842+ 3) Install boost141-devel package:
843+ # yum install boost141-devel
844+ 4) Make link from /usr/include/boost to /usr/include/boost141:
845+ # cd /usr/include
846+ # ln -sf boost141/boost boost
847+ 5) Install scons check-devel openssl-devel
848+ # yum install scons check-devel openssl-devel
849+
850+Then proceeed as described above.
851+
852+
853+For more information, see:
854+* Codership mailing list: http://groups.google.com/group/codership-team
855+* https://launchpad.net/galera/
856+* Codership home page: http://www.codership.com
857+
858
859=== added file 'SConscript'
860--- SConscript 1970-01-01 00:00:00 +0000
861+++ SConscript 2013-11-06 15:11:01 +0000
862@@ -0,0 +1,16 @@
863+SConscript(['galerautils/SConscript',
864+ 'gcache/SConscript',
865+ 'gcomm/SConscript',
866+ 'gcs/SConscript',
867+ 'galera/SConscript',
868+ 'garb/SConscript'])
869+
870+Import('env', 'sysname')
871+
872+libmmgalera_objs = env['LIBGALERA_OBJS']
873+libmmgalera_objs.extend(env['LIBMMGALERA_OBJS'])
874+
875+if sysname == 'darwin':
876+ env.SharedLibrary('galera_smm', libmmgalera_objs, SHLIBSUFFIX='.so')
877+else:
878+ env.SharedLibrary('galera_smm', libmmgalera_objs)
879
880=== added file 'SConstruct'
881--- SConstruct 1970-01-01 00:00:00 +0000
882+++ SConstruct 2013-11-06 15:11:01 +0000
883@@ -0,0 +1,454 @@
884+###################################################################
885+#
886+# Copyright (C) 2010-2012 Codership Oy <info@codership.com>
887+#
888+# SCons build script to build galera libraries
889+#
890+# Script structure:
891+# - Help message
892+# - Default parameters
893+# - Read commandline options
894+# - Set up and configure default build environment
895+# - Set up and configure check unit test build environment
896+# - Run root SConscript with variant_dir
897+#
898+####################################################################
899+
900+import os
901+import platform
902+import string
903+
904+sysname = os.uname()[0].lower()
905+machine = platform.machine()
906+print 'Host: ' + sysname + ' ' + machine
907+
908+#
909+# Print Help
910+#
911+
912+Help('''
913+Build targets: build tests check install all
914+Default target: all
915+
916+Commandline Options:
917+ debug=n debug build with optimization level n
918+ arch=str target architecture [i686|x86_64]
919+ build_dir=dir build directory, default: '.'
920+ boost=[0|1] disable or enable boost libraries
921+ boost_pool=[0|1] use or not use boost pool allocator
922+ revno=XXXX source code revision number
923+ bpostatic=path a path to static libboost_program_options.a
924+ extra_sysroot=path a path to extra development environment (Fink, Homebrew, MacPorts, MinGW)
925+''')
926+# bpostatic option added on Percona request
927+
928+#
929+# Default params
930+#
931+
932+build_target = 'all'
933+
934+# Optimization level
935+opt_flags = ' -g -O3 -DNDEBUG'
936+
937+# Architecture (defaults to build host type)
938+compile_arch = ''
939+link_arch = ''
940+
941+# Build directory
942+build_dir = ''
943+
944+
945+#
946+# Read commandline options
947+#
948+
949+build_dir = ARGUMENTS.get('build_dir', '')
950+
951+# Debug/dbug flags
952+debug = ARGUMENTS.get('debug', -1)
953+dbug = ARGUMENTS.get('dbug', False)
954+
955+if int(debug) >= 0 and int(debug) < 3:
956+ opt_flags = ' -g -O%d -fno-inline' % int(debug)
957+ dbug = True
958+elif int(debug) == 3:
959+ opt_flags = ' -g -O3'
960+
961+if dbug:
962+ opt_flags = opt_flags + ' -DGU_DBUG_ON'
963+
964+# Target arch
965+arch = ARGUMENTS.get('arch', machine)
966+print 'Target: ' + sysname + ' ' + arch
967+
968+if arch == 'i386' or arch == 'i686':
969+ compile_arch = ' -m32 -march=i686'
970+ link_arth = compile_arch
971+ if sysname != 'darwin' and sysname != 'freebsd':
972+ link_arch = compile_arch + ' -Wl,-melf_i386'
973+elif arch == 'x86_64' or arch == 'amd64':
974+ compile_arch = ' -m64'
975+ link_arth = compile_arch
976+ if sysname != 'darwin' and sysname != 'freebsd':
977+ link_arch = compile_arch + ' -Wl,-melf_x86_64'
978+elif arch == 'ppc64':
979+ compile_arch = ' -mtune=native'
980+ link_arch = ''
981+elif sysname == 'sunos':
982+ compile_arch = ''
983+ link_arch = ''
984+else:
985+ compile_arch = ''
986+ link_arch = ''
987+
988+boost = int(ARGUMENTS.get('boost', 1))
989+boost_pool = int(ARGUMENTS.get('boost_pool', 0))
990+ssl = int(ARGUMENTS.get('ssl', 1))
991+tests = int(ARGUMENTS.get('tests', 1))
992+strict_build_flags = int(ARGUMENTS.get('strict_build_flags', 1))
993+
994+
995+GALERA_VER = ARGUMENTS.get('version', '2.8')
996+GALERA_REV = ARGUMENTS.get('revno', 'XXXX')
997+# export to any module that might have use of those
998+Export('GALERA_VER', 'GALERA_REV')
999+print 'Signature: version: ' + GALERA_VER + ', revision: ' + GALERA_REV
1000+
1001+LIBBOOST_PROGRAM_OPTIONS_A = ARGUMENTS.get('bpostatic', '')
1002+LIBBOOST_SYSTEM_A = string.replace(LIBBOOST_PROGRAM_OPTIONS_A, 'boost_program_options', 'boost_system')
1003+
1004+#
1005+# Set up and export default build environment
1006+#
1007+
1008+env = Environment(ENV = {'PATH' : os.environ['PATH'], 'HOME' : os.environ['HOME']})
1009+
1010+# Set up environment for ccache and distcc
1011+# env['ENV']['HOME'] = os.environ['HOME']
1012+#env['ENV']['DISTCC_HOSTS'] = os.environ['DISTCC_HOSTS']
1013+#env['ENV']['CCACHE_PREFIX'] = os.environ['CCACHE_PREFIX']
1014+if 'CCACHE_DIR' in os.environ:
1015+ env['ENV']['CCACHE_DIR'] = os.environ['CCACHE_DIR']
1016+if 'CCACHE_CPP2' in os.environ:
1017+ env['ENV']['CCACHE_CPP2'] = os.environ['CCACHE_CPP2']
1018+
1019+# Set CC and CXX compilers
1020+cc = os.getenv('CC', 'default')
1021+if cc != 'default':
1022+ env.Replace(CC = cc)
1023+cxx = os.getenv('CXX', 'default')
1024+if cxx != 'default':
1025+ env.Replace(CXX = cxx)
1026+link = os.getenv('LINK', 'default')
1027+if link != 'default':
1028+ env.Replace(LINK = link)
1029+
1030+# Initialize CPPFLAGS and LIBPATH from environment to get user preferences
1031+env.Replace(CPPFLAGS = os.getenv('CPPFLAGS', ''))
1032+env.Replace(LIBPATH = [os.getenv('LIBPATH', '')])
1033+
1034+# Set -pthread flag explicitly to make sure that pthreads are
1035+# enabled on all platforms.
1036+env.Append(CPPFLAGS = ' -pthread')
1037+
1038+# Freebsd ports are installed under /usr/local
1039+if sysname == 'freebsd' or sysname == 'sunos':
1040+ env.Append(LIBPATH = ['/usr/local/lib'])
1041+ env.Append(CPPFLAGS = ' -I/usr/local/include ')
1042+if sysname == 'sunos':
1043+ env.Replace(SHLINKFLAGS = '-shared ')
1044+
1045+# Add paths is extra_sysroot argument was specified
1046+extra_sysroot = ARGUMENTS.get('extra_sysroot', '')
1047+if sysname == 'darwin' and extra_sysroot == '':
1048+ # common developer environments and paths
1049+ if os.system('which -s port') == 0 and os.path.isfile('/opt/local/bin/port'):
1050+ extra_sysroot = '/opt/local'
1051+ elif os.system('which -s brew') == 0 and os.path.isfile('/usr/local/bin/brew'):
1052+ extra_sysroot = '/usr/local'
1053+ elif os.system('which -s fink') == 0 and os.path.isfile('/sw/bin/fink'):
1054+ extra_sysroot = '/sw'
1055+if extra_sysroot != '':
1056+ env.Append(LIBPATH = [extra_sysroot + '/lib'])
1057+ env.Append(CPPFLAGS = ' -I' + extra_sysroot + '/include')
1058+
1059+# print env.Dump()
1060+#
1061+# Set up build and link paths
1062+#
1063+
1064+# Include paths
1065+env.Append(CPPPATH = Split('''#/common
1066+ #/asio
1067+ #/galerautils/src
1068+ #/gcomm/src
1069+ #/gcomm/src/gcomm
1070+ #/gcache/src
1071+ #/gcs/src
1072+ #/wsdb/src
1073+ #/galera/src
1074+ '''))
1075+
1076+# Library paths
1077+#env.Append(LIBPATH = Split('''#/galerautils/src
1078+# #/gcomm/src
1079+# #/gcs/src
1080+# #/wsdb/src
1081+# #/galera/src
1082+# '''))
1083+
1084+# Preprocessor flags
1085+if sysname != 'sunos' and sysname != 'darwin' and sysname != 'freebsd':
1086+ env.Append(CPPFLAGS = ' -D_XOPEN_SOURCE=600')
1087+if sysname == 'sunos':
1088+ env.Append(CPPFLAGS = ' -D__EXTENSIONS__')
1089+env.Append(CPPFLAGS = ' -DHAVE_COMMON_H')
1090+
1091+# Common C/CXX flags
1092+# These should be kept minimal as they are appended after C/CXX specific flags
1093+env.Replace(CCFLAGS = opt_flags + compile_arch +
1094+ ' -Wall -Wextra -Wno-unused-parameter')
1095+
1096+# C-specific flags
1097+env.Replace(CFLAGS = ' -std=c99 -fno-strict-aliasing -pipe')
1098+
1099+# CXX-specific flags
1100+# Note: not all 3rd-party libs like '-Wold-style-cast -Weffc++'
1101+# adding those after checks
1102+env.Replace(CXXFLAGS = ' -Wno-long-long -Wno-deprecated -ansi')
1103+if sysname != 'sunos':
1104+ env.Append(CXXFLAGS = ' -pipe')
1105+
1106+
1107+# Linker flags
1108+# TODO: enable '-Wl,--warn-common -Wl,--fatal-warnings' after warnings from
1109+# static linking have beed addressed
1110+#
1111+env.Append(LINKFLAGS = link_arch)
1112+
1113+#
1114+# Check required headers and libraries (autoconf functionality)
1115+#
1116+
1117+conf = Configure(env)
1118+
1119+# System headers and libraries
1120+
1121+if not conf.CheckLib('pthread'):
1122+ print 'Error: pthread library not found'
1123+ Exit(1)
1124+
1125+if sysname != 'darwin':
1126+ if not conf.CheckLib('rt'):
1127+ print 'Error: rt library not found'
1128+ Exit(1)
1129+
1130+if sysname == 'freebsd':
1131+ if not conf.CheckLib('execinfo'):
1132+ print 'Error: execinfo library not found'
1133+ Exit(1)
1134+
1135+if sysname == 'sunos':
1136+ if not conf.CheckLib('socket'):
1137+ print 'Error: socket library not found'
1138+ Exit(1)
1139+ if not conf.CheckLib('crypto'):
1140+ print 'Error: crypto library not found'
1141+ Exit(1)
1142+ if not conf.CheckLib('nsl'):
1143+ print 'Error: nsl library not found'
1144+ Exit(1)
1145+
1146+if conf.CheckHeader('sys/epoll.h'):
1147+ conf.env.Append(CPPFLAGS = ' -DGALERA_USE_GU_NETWORK')
1148+
1149+if conf.CheckHeader('byteswap.h'):
1150+ conf.env.Append(CPPFLAGS = ' -DHAVE_BYTESWAP_H')
1151+
1152+if conf.CheckHeader('endian.h'):
1153+ conf.env.Append(CPPFLAGS = ' -DHAVE_ENDIAN_H')
1154+elif conf.CheckHeader('sys/endian.h'):
1155+ conf.env.Append(CPPFLAGS = ' -DHAVE_SYS_ENDIAN_H')
1156+elif conf.CheckHeader('sys/byteorder.h'):
1157+ conf.env.Append(CPPFLAGS = ' -DHAVE_SYS_BYTEORDER_H')
1158+elif sysname != 'darwin':
1159+ print 'can\'t find byte order information'
1160+ Exit(1)
1161+
1162+# Additional C headers and libraries
1163+
1164+# boost headers
1165+
1166+if not conf.CheckCXXHeader('boost/shared_ptr.hpp'):
1167+ print 'boost/shared_ptr.hpp not found or not usable'
1168+ Exit(1)
1169+conf.env.Append(CPPFLAGS = ' -DHAVE_BOOST_SHARED_PTR_HPP')
1170+
1171+if conf.CheckCXXHeader('tr1/unordered_map'):
1172+ conf.env.Append(CPPFLAGS = ' -DHAVE_TR1_UNORDERED_MAP')
1173+else:
1174+ if conf.CheckCXXHeader('boost/unordered_map.hpp'):
1175+ conf.env.Append(CPPFLAGS = ' -DHAVE_BOOST_UNORDERED_MAP_HPP')
1176+ else:
1177+ print 'no unordered map header available'
1178+ Exit(1)
1179+
1180+# pool allocator
1181+if boost == 1:
1182+ # Default suffix for boost multi-threaded libraries
1183+ if sysname == 'darwin':
1184+ boost_library_suffix = '-mt'
1185+ else:
1186+ boost_library_suffix = ''
1187+ if sysname == 'darwin' and extra_sysroot != '':
1188+ boost_library_path = extra_sysroot + '/lib'
1189+ else:
1190+ boost_library_path = ''
1191+ # Use nanosecond time precision
1192+ conf.env.Append(CPPFLAGS = ' -DBOOST_DATE_TIME_POSIX_TIME_STD_CONFIG=1')
1193+ # Common procedure to find boost static library
1194+ boost_libpaths = [ boost_library_path, '/usr/local/lib', '/usr/local/lib64', '/usr/lib', '/usr/lib64' ]
1195+ def check_boost_library(libBaseName, header, configuredLibPath, autoadd = 1):
1196+ libName = libBaseName + boost_library_suffix
1197+ if configuredLibPath != '' and not os.path.isfile(configuredLibPath):
1198+ print "Error: file '%s' does not exist" % configuredLibPath
1199+ Exit(1)
1200+ if configuredLibPath == '':
1201+ for libpath in boost_libpaths:
1202+ libname = libpath + '/lib%s.a' % libName
1203+ if os.path.isfile(libname):
1204+ configuredLibPath = libname
1205+ break
1206+ if configuredLibPath != '':
1207+ if not conf.CheckCXXHeader(header):
1208+ print "Error: header '%s' does not exist" % header
1209+ Exit (1)
1210+ if autoadd:
1211+ conf.env.Append(LIBS=File(configuredLibPath))
1212+ else:
1213+ return File(configuredLibPath)
1214+ else:
1215+ if not conf.CheckLibWithHeader(libs=[libName],
1216+ header=header,
1217+ language='CXX',
1218+ autoadd=autoadd):
1219+ print 'Error: library %s does not exist' % libName
1220+ Exit (1)
1221+ return [libName]
1222+ # Required boost headers/libraries
1223+ #
1224+ if boost_pool == 1:
1225+ if conf.CheckCXXHeader('boost/pool/pool_alloc.hpp'):
1226+ print 'Using boost pool alloc'
1227+ conf.env.Append(CPPFLAGS = ' -DGALERA_USE_BOOST_POOL_ALLOC=1')
1228+ # due to a bug in boost >= 1.50 we need to link with boost_system
1229+ # - should be a noop with no boost_pool.
1230+ if sysname == 'darwin':
1231+ if conf.CheckLib('boost_system' + boost_library_suffix):
1232+ conf.env.Append(LIBS=['boost_system' + boost_library_suffix])
1233+ check_boost_library('boost_system',
1234+ 'boost/system/error_code.hpp',
1235+ LIBBOOST_SYSTEM_A)
1236+ else:
1237+ print 'Error: boost/pool/pool_alloc.hpp not found or not usable'
1238+ Exit(1)
1239+
1240+ libboost_program_options = check_boost_library('boost_program_options',
1241+ 'boost/program_options.hpp',
1242+ LIBBOOST_PROGRAM_OPTIONS_A,
1243+ autoadd = 0)
1244+else:
1245+ print 'Not using boost'
1246+
1247+# asio
1248+if conf.CheckCXXHeader('asio.hpp'):
1249+ conf.env.Append(CPPFLAGS = ' -DHAVE_ASIO_HPP')
1250+else:
1251+ print 'asio headers not found or not usable'
1252+ Exit(1)
1253+
1254+# asio/ssl
1255+if ssl == 1:
1256+ if conf.CheckCXXHeader('asio/ssl.hpp'):
1257+ conf.env.Append(CPPFLAGS = ' -DHAVE_ASIO_SSL_HPP')
1258+ else:
1259+ print 'ssl support required but asio/ssl.hpp not found or not usable'
1260+ print 'compile with ssl=0 or check that openssl devel headers are usable'
1261+ Exit(1)
1262+ if conf.CheckLib('ssl'):
1263+ conf.CheckLib('crypto')
1264+ else:
1265+ print 'ssl support required but openssl library not found'
1266+ print 'compile with ssl=0 or check that openssl library is usable'
1267+ Exit(1)
1268+
1269+# these will be used only with our softaware
1270+if strict_build_flags == 1:
1271+ conf.env.Append(CPPFLAGS = ' -Werror ')
1272+ conf.env.Append(CCFLAGS = ' -pedantic')
1273+ conf.env.Append(CXXFLAGS = ' -Weffc++ -Wold-style-cast')
1274+
1275+env = conf.Finish()
1276+Export('env', 'sysname', 'libboost_program_options')
1277+
1278+#
1279+# Actions to build .dSYM directories, containing debugging information for Darwin
1280+#
1281+
1282+if sysname == 'darwin' and int(debug) >= 0 and int(debug) < 3:
1283+ env['LINKCOM'] = [env['LINKCOM'], 'dsymutil $TARGET']
1284+ env['SHLINKCOM'] = [env['SHLINKCOM'], 'dsymutil $TARGET']
1285+
1286+#
1287+# Set up and export environment for check unit tests
1288+#
1289+
1290+# Clone base from default environment
1291+check_env = env.Clone()
1292+
1293+conf = Configure(check_env)
1294+
1295+# Check header and library
1296+
1297+if not conf.CheckHeader('check.h'):
1298+ print 'Error: check header file not found or not usable'
1299+ Exit(1)
1300+
1301+if not conf.CheckLib('check'):
1302+ print 'Error: check library not found or not usable'
1303+ Exit(1)
1304+
1305+conf.Finish()
1306+
1307+# Note: Don't do this, glibc does not like static linking
1308+# Link unit tests statically
1309+# check_env.Append(LINKFLAGS = ' -static')
1310+
1311+#
1312+# this follows recipes from http://www.scons.org/wiki/UnitTests
1313+#
1314+
1315+def builder_unit_test(target, source, env):
1316+ app = str(source[0].abspath)
1317+ if os.spawnl(os.P_WAIT, app, app)==0:
1318+ open(str(target[0]),'w').write("PASSED\n")
1319+ else:
1320+ return 1
1321+
1322+def builder_unit_test_dummy(target, source, env):
1323+ return 0
1324+
1325+# Create a builder for tests
1326+if tests == 1:
1327+ bld = Builder(action = builder_unit_test)
1328+else:
1329+ bld = Builder(action = builder_unit_test_dummy)
1330+check_env.Append(BUILDERS = {'Test' : bld})
1331+
1332+Export('check_env')
1333+
1334+#
1335+# Run root SConscript with variant_dir
1336+#
1337+SConscript('SConscript', variant_dir=build_dir)
1338
1339=== added directory 'asio'
1340=== added file 'asio/LICENSE_1_0.txt'
1341--- asio/LICENSE_1_0.txt 1970-01-01 00:00:00 +0000
1342+++ asio/LICENSE_1_0.txt 2013-11-06 15:11:01 +0000
1343@@ -0,0 +1,23 @@
1344+Boost Software License - Version 1.0 - August 17th, 2003
1345+
1346+Permission is hereby granted, free of charge, to any person or organization
1347+obtaining a copy of the software and accompanying documentation covered by
1348+this license (the "Software") to use, reproduce, display, distribute,
1349+execute, and transmit the Software, and to prepare derivative works of the
1350+Software, and to permit third-parties to whom the Software is furnished to
1351+do so, all subject to the following:
1352+
1353+The copyright notices in the Software and this entire statement, including
1354+the above license grant, this restriction and the following disclaimer,
1355+must be included in all copies of the Software, in whole or in part, and
1356+all derivative works of the Software, unless such copies or derivative
1357+works are solely in the form of machine-executable object code generated by
1358+a source language processor.
1359+
1360+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1361+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1362+FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
1363+SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
1364+FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
1365+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
1366+DEALINGS IN THE SOFTWARE.
1367
1368=== added directory 'asio/asio'
1369=== added file 'asio/asio.hpp'
1370--- asio/asio.hpp 1970-01-01 00:00:00 +0000
1371+++ asio/asio.hpp 2013-11-06 15:11:01 +0000
1372@@ -0,0 +1,101 @@
1373+//
1374+// asio.hpp
1375+// ~~~~~~~~
1376+//
1377+// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
1378+//
1379+// Distributed under the Boost Software License, Version 1.0. (See accompanying
1380+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
1381+//
1382+
1383+#ifndef ASIO_HPP
1384+#define ASIO_HPP
1385+
1386+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
1387+# pragma once
1388+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
1389+
1390+#include "asio/basic_datagram_socket.hpp"
1391+#include "asio/basic_deadline_timer.hpp"
1392+#include "asio/basic_io_object.hpp"
1393+#include "asio/basic_raw_socket.hpp"
1394+#include "asio/basic_serial_port.hpp"
1395+#include "asio/basic_socket_acceptor.hpp"
1396+#include "asio/basic_socket_iostream.hpp"
1397+#include "asio/basic_socket_streambuf.hpp"
1398+#include "asio/basic_stream_socket.hpp"
1399+#include "asio/basic_streambuf.hpp"
1400+#include "asio/buffer.hpp"
1401+#include "asio/buffered_read_stream_fwd.hpp"
1402+#include "asio/buffered_read_stream.hpp"
1403+#include "asio/buffered_stream_fwd.hpp"
1404+#include "asio/buffered_stream.hpp"
1405+#include "asio/buffered_write_stream_fwd.hpp"
1406+#include "asio/buffered_write_stream.hpp"
1407+#include "asio/buffers_iterator.hpp"
1408+#include "asio/completion_condition.hpp"
1409+#include "asio/datagram_socket_service.hpp"
1410+#include "asio/deadline_timer_service.hpp"
1411+#include "asio/deadline_timer.hpp"
1412+#include "asio/error.hpp"
1413+#include "asio/error_code.hpp"
1414+#include "asio/handler_alloc_hook.hpp"
1415+#include "asio/handler_invoke_hook.hpp"
1416+#include "asio/io_service.hpp"
1417+#include "asio/ip/address.hpp"
1418+#include "asio/ip/address_v4.hpp"
1419+#include "asio/ip/address_v6.hpp"
1420+#include "asio/ip/basic_endpoint.hpp"
1421+#include "asio/ip/basic_resolver.hpp"
1422+#include "asio/ip/basic_resolver_entry.hpp"
1423+#include "asio/ip/basic_resolver_iterator.hpp"
1424+#include "asio/ip/basic_resolver_query.hpp"
1425+#include "asio/ip/host_name.hpp"
1426+#include "asio/ip/icmp.hpp"
1427+#include "asio/ip/multicast.hpp"
1428+#include "asio/ip/resolver_query_base.hpp"
1429+#include "asio/ip/resolver_service.hpp"
1430+#include "asio/ip/tcp.hpp"
1431+#include "asio/ip/udp.hpp"
1432+#include "asio/ip/unicast.hpp"
1433+#include "asio/ip/v6_only.hpp"
1434+#include "asio/is_read_buffered.hpp"
1435+#include "asio/is_write_buffered.hpp"
1436+#include "asio/local/basic_endpoint.hpp"
1437+#include "asio/local/connect_pair.hpp"
1438+#include "asio/local/datagram_protocol.hpp"
1439+#include "asio/local/stream_protocol.hpp"
1440+#include "asio/placeholders.hpp"
1441+#include "asio/posix/basic_descriptor.hpp"
1442+#include "asio/posix/basic_stream_descriptor.hpp"
1443+#include "asio/posix/descriptor_base.hpp"
1444+#include "asio/posix/stream_descriptor.hpp"
1445+#include "asio/posix/stream_descriptor_service.hpp"
1446+#include "asio/raw_socket_service.hpp"
1447+#include "asio/read.hpp"
1448+#include "asio/read_at.hpp"
1449+#include "asio/read_until.hpp"
1450+#include "asio/serial_port.hpp"
1451+#include "asio/serial_port_base.hpp"
1452+#include "asio/serial_port_service.hpp"
1453+#include "asio/socket_acceptor_service.hpp"
1454+#include "asio/socket_base.hpp"
1455+#include "asio/strand.hpp"
1456+#include "asio/stream_socket_service.hpp"
1457+#include "asio/streambuf.hpp"
1458+#include "asio/system_error.hpp"
1459+#include "asio/thread.hpp"
1460+#include "asio/time_traits.hpp"
1461+#include "asio/version.hpp"
1462+#include "asio/windows/basic_handle.hpp"
1463+#include "asio/windows/basic_random_access_handle.hpp"
1464+#include "asio/windows/basic_stream_handle.hpp"
1465+#include "asio/windows/overlapped_ptr.hpp"
1466+#include "asio/windows/random_access_handle.hpp"
1467+#include "asio/windows/random_access_handle_service.hpp"
1468+#include "asio/windows/stream_handle.hpp"
1469+#include "asio/windows/stream_handle_service.hpp"
1470+#include "asio/write.hpp"
1471+#include "asio/write_at.hpp"
1472+
1473+#endif // ASIO_HPP
1474
1475=== added file 'asio/asio/basic_datagram_socket.hpp'
1476--- asio/asio/basic_datagram_socket.hpp 1970-01-01 00:00:00 +0000
1477+++ asio/asio/basic_datagram_socket.hpp 2013-11-06 15:11:01 +0000
1478@@ -0,0 +1,800 @@
1479+//
1480+// basic_datagram_socket.hpp
1481+// ~~~~~~~~~~~~~~~~~~~~~~~~~
1482+//
1483+// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
1484+//
1485+// Distributed under the Boost Software License, Version 1.0. (See accompanying
1486+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
1487+//
1488+
1489+#ifndef ASIO_BASIC_DATAGRAM_SOCKET_HPP
1490+#define ASIO_BASIC_DATAGRAM_SOCKET_HPP
1491+
1492+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
1493+# pragma once
1494+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
1495+
1496+#include "asio/detail/config.hpp"
1497+#include <cstddef>
1498+#include "asio/basic_socket.hpp"
1499+#include "asio/datagram_socket_service.hpp"
1500+#include "asio/detail/throw_error.hpp"
1501+#include "asio/error.hpp"
1502+
1503+#include "asio/detail/push_options.hpp"
1504+
1505+namespace asio {
1506+
1507+/// Provides datagram-oriented socket functionality.
1508+/**
1509+ * The basic_datagram_socket class template provides asynchronous and blocking
1510+ * datagram-oriented socket functionality.
1511+ *
1512+ * @par Thread Safety
1513+ * @e Distinct @e objects: Safe.@n
1514+ * @e Shared @e objects: Unsafe.
1515+ */
1516+template <typename Protocol,
1517+ typename DatagramSocketService = datagram_socket_service<Protocol> >
1518+class basic_datagram_socket
1519+ : public basic_socket<Protocol, DatagramSocketService>
1520+{
1521+public:
1522+ /// The native representation of a socket.
1523+ typedef typename DatagramSocketService::native_type native_type;
1524+
1525+ /// The protocol type.
1526+ typedef Protocol protocol_type;
1527+
1528+ /// The endpoint type.
1529+ typedef typename Protocol::endpoint endpoint_type;
1530+
1531+ /// Construct a basic_datagram_socket without opening it.
1532+ /**
1533+ * This constructor creates a datagram socket without opening it. The open()
1534+ * function must be called before data can be sent or received on the socket.
1535+ *
1536+ * @param io_service The io_service object that the datagram socket will use
1537+ * to dispatch handlers for any asynchronous operations performed on the
1538+ * socket.
1539+ */
1540+ explicit basic_datagram_socket(asio::io_service& io_service)
1541+ : basic_socket<Protocol, DatagramSocketService>(io_service)
1542+ {
1543+ }
1544+
1545+ /// Construct and open a basic_datagram_socket.
1546+ /**
1547+ * This constructor creates and opens a datagram socket.
1548+ *
1549+ * @param io_service The io_service object that the datagram socket will use
1550+ * to dispatch handlers for any asynchronous operations performed on the
1551+ * socket.
1552+ *
1553+ * @param protocol An object specifying protocol parameters to be used.
1554+ *
1555+ * @throws asio::system_error Thrown on failure.
1556+ */
1557+ basic_datagram_socket(asio::io_service& io_service,
1558+ const protocol_type& protocol)
1559+ : basic_socket<Protocol, DatagramSocketService>(io_service, protocol)
1560+ {
1561+ }
1562+
1563+ /// Construct a basic_datagram_socket, opening it and binding it to the given
1564+ /// local endpoint.
1565+ /**
1566+ * This constructor creates a datagram socket and automatically opens it bound
1567+ * to the specified endpoint on the local machine. The protocol used is the
1568+ * protocol associated with the given endpoint.
1569+ *
1570+ * @param io_service The io_service object that the datagram socket will use
1571+ * to dispatch handlers for any asynchronous operations performed on the
1572+ * socket.
1573+ *
1574+ * @param endpoint An endpoint on the local machine to which the datagram
1575+ * socket will be bound.
1576+ *
1577+ * @throws asio::system_error Thrown on failure.
1578+ */
1579+ basic_datagram_socket(asio::io_service& io_service,
1580+ const endpoint_type& endpoint)
1581+ : basic_socket<Protocol, DatagramSocketService>(io_service, endpoint)
1582+ {
1583+ }
1584+
1585+ /// Construct a basic_datagram_socket on an existing native socket.
1586+ /**
1587+ * This constructor creates a datagram socket object to hold an existing
1588+ * native socket.
1589+ *
1590+ * @param io_service The io_service object that the datagram socket will use
1591+ * to dispatch handlers for any asynchronous operations performed on the
1592+ * socket.
1593+ *
1594+ * @param protocol An object specifying protocol parameters to be used.
1595+ *
1596+ * @param native_socket The new underlying socket implementation.
1597+ *
1598+ * @throws asio::system_error Thrown on failure.
1599+ */
1600+ basic_datagram_socket(asio::io_service& io_service,
1601+ const protocol_type& protocol, const native_type& native_socket)
1602+ : basic_socket<Protocol, DatagramSocketService>(
1603+ io_service, protocol, native_socket)
1604+ {
1605+ }
1606+
1607+ /// Send some data on a connected socket.
1608+ /**
1609+ * This function is used to send data on the datagram socket. The function
1610+ * call will block until the data has been sent successfully or an error
1611+ * occurs.
1612+ *
1613+ * @param buffers One ore more data buffers to be sent on the socket.
1614+ *
1615+ * @returns The number of bytes sent.
1616+ *
1617+ * @throws asio::system_error Thrown on failure.
1618+ *
1619+ * @note The send operation can only be used with a connected socket. Use
1620+ * the send_to function to send data on an unconnected datagram socket.
1621+ *
1622+ * @par Example
1623+ * To send a single data buffer use the @ref buffer function as follows:
1624+ * @code socket.send(asio::buffer(data, size)); @endcode
1625+ * See the @ref buffer documentation for information on sending multiple
1626+ * buffers in one go, and how to use it with arrays, boost::array or
1627+ * std::vector.
1628+ */
1629+ template <typename ConstBufferSequence>
1630+ std::size_t send(const ConstBufferSequence& buffers)
1631+ {
1632+ asio::error_code ec;
1633+ std::size_t s = this->service.send(this->implementation, buffers, 0, ec);
1634+ asio::detail::throw_error(ec);
1635+ return s;
1636+ }
1637+
1638+ /// Send some data on a connected socket.
1639+ /**
1640+ * This function is used to send data on the datagram socket. The function
1641+ * call will block until the data has been sent successfully or an error
1642+ * occurs.
1643+ *
1644+ * @param buffers One ore more data buffers to be sent on the socket.
1645+ *
1646+ * @param flags Flags specifying how the send call is to be made.
1647+ *
1648+ * @returns The number of bytes sent.
1649+ *
1650+ * @throws asio::system_error Thrown on failure.
1651+ *
1652+ * @note The send operation can only be used with a connected socket. Use
1653+ * the send_to function to send data on an unconnected datagram socket.
1654+ */
1655+ template <typename ConstBufferSequence>
1656+ std::size_t send(const ConstBufferSequence& buffers,
1657+ socket_base::message_flags flags)
1658+ {
1659+ asio::error_code ec;
1660+ std::size_t s = this->service.send(
1661+ this->implementation, buffers, flags, ec);
1662+ asio::detail::throw_error(ec);
1663+ return s;
1664+ }
1665+
1666+ /// Send some data on a connected socket.
1667+ /**
1668+ * This function is used to send data on the datagram socket. The function
1669+ * call will block until the data has been sent successfully or an error
1670+ * occurs.
1671+ *
1672+ * @param buffers One or more data buffers to be sent on the socket.
1673+ *
1674+ * @param flags Flags specifying how the send call is to be made.
1675+ *
1676+ * @param ec Set to indicate what error occurred, if any.
1677+ *
1678+ * @returns The number of bytes sent.
1679+ *
1680+ * @note The send operation can only be used with a connected socket. Use
1681+ * the send_to function to send data on an unconnected datagram socket.
1682+ */
1683+ template <typename ConstBufferSequence>
1684+ std::size_t send(const ConstBufferSequence& buffers,
1685+ socket_base::message_flags flags, asio::error_code& ec)
1686+ {
1687+ return this->service.send(this->implementation, buffers, flags, ec);
1688+ }
1689+
1690+ /// Start an asynchronous send on a connected socket.
1691+ /**
1692+ * This function is used to send data on the datagram socket. The function
1693+ * call will block until the data has been sent successfully or an error
1694+ * occurs.
1695+ *
1696+ * @param buffers One or more data buffers to be sent on the socket. Although
1697+ * the buffers object may be copied as necessary, ownership of the underlying
1698+ * memory blocks is retained by the caller, which must guarantee that they
1699+ * remain valid until the handler is called.
1700+ *
1701+ * @param handler The handler to be called when the send operation completes.
1702+ * Copies will be made of the handler as required. The function signature of
1703+ * the handler must be:
1704+ * @code void handler(
1705+ * const asio::error_code& error, // Result of operation.
1706+ * std::size_t bytes_transferred // Number of bytes sent.
1707+ * ); @endcode
1708+ * Regardless of whether the asynchronous operation completes immediately or
1709+ * not, the handler will not be invoked from within this function. Invocation
1710+ * of the handler will be performed in a manner equivalent to using
1711+ * asio::io_service::post().
1712+ *
1713+ * @note The async_send operation can only be used with a connected socket.
1714+ * Use the async_send_to function to send data on an unconnected datagram
1715+ * socket.
1716+ *
1717+ * @par Example
1718+ * To send a single data buffer use the @ref buffer function as follows:
1719+ * @code
1720+ * socket.async_send(asio::buffer(data, size), handler);
1721+ * @endcode
1722+ * See the @ref buffer documentation for information on sending multiple
1723+ * buffers in one go, and how to use it with arrays, boost::array or
1724+ * std::vector.
1725+ */
1726+ template <typename ConstBufferSequence, typename WriteHandler>
1727+ void async_send(const ConstBufferSequence& buffers, WriteHandler handler)
1728+ {
1729+ this->service.async_send(this->implementation, buffers, 0, handler);
1730+ }
1731+
1732+ /// Start an asynchronous send on a connected socket.
1733+ /**
1734+ * This function is used to send data on the datagram socket. The function
1735+ * call will block until the data has been sent successfully or an error
1736+ * occurs.
1737+ *
1738+ * @param buffers One or more data buffers to be sent on the socket. Although
1739+ * the buffers object may be copied as necessary, ownership of the underlying
1740+ * memory blocks is retained by the caller, which must guarantee that they
1741+ * remain valid until the handler is called.
1742+ *
1743+ * @param flags Flags specifying how the send call is to be made.
1744+ *
1745+ * @param handler The handler to be called when the send operation completes.
1746+ * Copies will be made of the handler as required. The function signature of
1747+ * the handler must be:
1748+ * @code void handler(
1749+ * const asio::error_code& error, // Result of operation.
1750+ * std::size_t bytes_transferred // Number of bytes sent.
1751+ * ); @endcode
1752+ * Regardless of whether the asynchronous operation completes immediately or
1753+ * not, the handler will not be invoked from within this function. Invocation
1754+ * of the handler will be performed in a manner equivalent to using
1755+ * asio::io_service::post().
1756+ *
1757+ * @note The async_send operation can only be used with a connected socket.
1758+ * Use the async_send_to function to send data on an unconnected datagram
1759+ * socket.
1760+ */
1761+ template <typename ConstBufferSequence, typename WriteHandler>
1762+ void async_send(const ConstBufferSequence& buffers,
1763+ socket_base::message_flags flags, WriteHandler handler)
1764+ {
1765+ this->service.async_send(this->implementation, buffers, flags, handler);
1766+ }
1767+
1768+ /// Send a datagram to the specified endpoint.
1769+ /**
1770+ * This function is used to send a datagram to the specified remote endpoint.
1771+ * The function call will block until the data has been sent successfully or
1772+ * an error occurs.
1773+ *
1774+ * @param buffers One or more data buffers to be sent to the remote endpoint.
1775+ *
1776+ * @param destination The remote endpoint to which the data will be sent.
1777+ *
1778+ * @returns The number of bytes sent.
1779+ *
1780+ * @throws asio::system_error Thrown on failure.
1781+ *
1782+ * @par Example
1783+ * To send a single data buffer use the @ref buffer function as follows:
1784+ * @code
1785+ * asio::ip::udp::endpoint destination(
1786+ * asio::ip::address::from_string("1.2.3.4"), 12345);
1787+ * socket.send_to(asio::buffer(data, size), destination);
1788+ * @endcode
1789+ * See the @ref buffer documentation for information on sending multiple
1790+ * buffers in one go, and how to use it with arrays, boost::array or
1791+ * std::vector.
1792+ */
1793+ template <typename ConstBufferSequence>
1794+ std::size_t send_to(const ConstBufferSequence& buffers,
1795+ const endpoint_type& destination)
1796+ {
1797+ asio::error_code ec;
1798+ std::size_t s = this->service.send_to(
1799+ this->implementation, buffers, destination, 0, ec);
1800+ asio::detail::throw_error(ec);
1801+ return s;
1802+ }
1803+
1804+ /// Send a datagram to the specified endpoint.
1805+ /**
1806+ * This function is used to send a datagram to the specified remote endpoint.
1807+ * The function call will block until the data has been sent successfully or
1808+ * an error occurs.
1809+ *
1810+ * @param buffers One or more data buffers to be sent to the remote endpoint.
1811+ *
1812+ * @param destination The remote endpoint to which the data will be sent.
1813+ *
1814+ * @param flags Flags specifying how the send call is to be made.
1815+ *
1816+ * @returns The number of bytes sent.
1817+ *
1818+ * @throws asio::system_error Thrown on failure.
1819+ */
1820+ template <typename ConstBufferSequence>
1821+ std::size_t send_to(const ConstBufferSequence& buffers,
1822+ const endpoint_type& destination, socket_base::message_flags flags)
1823+ {
1824+ asio::error_code ec;
1825+ std::size_t s = this->service.send_to(
1826+ this->implementation, buffers, destination, flags, ec);
1827+ asio::detail::throw_error(ec);
1828+ return s;
1829+ }
1830+
1831+ /// Send a datagram to the specified endpoint.
1832+ /**
1833+ * This function is used to send a datagram to the specified remote endpoint.
1834+ * The function call will block until the data has been sent successfully or
1835+ * an error occurs.
1836+ *
1837+ * @param buffers One or more data buffers to be sent to the remote endpoint.
1838+ *
1839+ * @param destination The remote endpoint to which the data will be sent.
1840+ *
1841+ * @param flags Flags specifying how the send call is to be made.
1842+ *
1843+ * @param ec Set to indicate what error occurred, if any.
1844+ *
1845+ * @returns The number of bytes sent.
1846+ */
1847+ template <typename ConstBufferSequence>
1848+ std::size_t send_to(const ConstBufferSequence& buffers,
1849+ const endpoint_type& destination, socket_base::message_flags flags,
1850+ asio::error_code& ec)
1851+ {
1852+ return this->service.send_to(this->implementation,
1853+ buffers, destination, flags, ec);
1854+ }
1855+
1856+ /// Start an asynchronous send.
1857+ /**
1858+ * This function is used to asynchronously send a datagram to the specified
1859+ * remote endpoint. The function call always returns immediately.
1860+ *
1861+ * @param buffers One or more data buffers to be sent to the remote endpoint.
1862+ * Although the buffers object may be copied as necessary, ownership of the
1863+ * underlying memory blocks is retained by the caller, which must guarantee
1864+ * that they remain valid until the handler is called.
1865+ *
1866+ * @param destination The remote endpoint to which the data will be sent.
1867+ * Copies will be made of the endpoint as required.
1868+ *
1869+ * @param handler The handler to be called when the send operation completes.
1870+ * Copies will be made of the handler as required. The function signature of
1871+ * the handler must be:
1872+ * @code void handler(
1873+ * const asio::error_code& error, // Result of operation.
1874+ * std::size_t bytes_transferred // Number of bytes sent.
1875+ * ); @endcode
1876+ * Regardless of whether the asynchronous operation completes immediately or
1877+ * not, the handler will not be invoked from within this function. Invocation
1878+ * of the handler will be performed in a manner equivalent to using
1879+ * asio::io_service::post().
1880+ *
1881+ * @par Example
1882+ * To send a single data buffer use the @ref buffer function as follows:
1883+ * @code
1884+ * asio::ip::udp::endpoint destination(
1885+ * asio::ip::address::from_string("1.2.3.4"), 12345);
1886+ * socket.async_send_to(
1887+ * asio::buffer(data, size), destination, handler);
1888+ * @endcode
1889+ * See the @ref buffer documentation for information on sending multiple
1890+ * buffers in one go, and how to use it with arrays, boost::array or
1891+ * std::vector.
1892+ */
1893+ template <typename ConstBufferSequence, typename WriteHandler>
1894+ void async_send_to(const ConstBufferSequence& buffers,
1895+ const endpoint_type& destination, WriteHandler handler)
1896+ {
1897+ this->service.async_send_to(this->implementation, buffers, destination, 0,
1898+ handler);
1899+ }
1900+
1901+ /// Start an asynchronous send.
1902+ /**
1903+ * This function is used to asynchronously send a datagram to the specified
1904+ * remote endpoint. The function call always returns immediately.
1905+ *
1906+ * @param buffers One or more data buffers to be sent to the remote endpoint.
1907+ * Although the buffers object may be copied as necessary, ownership of the
1908+ * underlying memory blocks is retained by the caller, which must guarantee
1909+ * that they remain valid until the handler is called.
1910+ *
1911+ * @param flags Flags specifying how the send call is to be made.
1912+ *
1913+ * @param destination The remote endpoint to which the data will be sent.
1914+ * Copies will be made of the endpoint as required.
1915+ *
1916+ * @param handler The handler to be called when the send operation completes.
1917+ * Copies will be made of the handler as required. The function signature of
1918+ * the handler must be:
1919+ * @code void handler(
1920+ * const asio::error_code& error, // Result of operation.
1921+ * std::size_t bytes_transferred // Number of bytes sent.
1922+ * ); @endcode
1923+ * Regardless of whether the asynchronous operation completes immediately or
1924+ * not, the handler will not be invoked from within this function. Invocation
1925+ * of the handler will be performed in a manner equivalent to using
1926+ * asio::io_service::post().
1927+ */
1928+ template <typename ConstBufferSequence, typename WriteHandler>
1929+ void async_send_to(const ConstBufferSequence& buffers,
1930+ const endpoint_type& destination, socket_base::message_flags flags,
1931+ WriteHandler handler)
1932+ {
1933+ this->service.async_send_to(this->implementation, buffers, destination,
1934+ flags, handler);
1935+ }
1936+
1937+ /// Receive some data on a connected socket.
1938+ /**
1939+ * This function is used to receive data on the datagram socket. The function
1940+ * call will block until data has been received successfully or an error
1941+ * occurs.
1942+ *
1943+ * @param buffers One or more buffers into which the data will be received.
1944+ *
1945+ * @returns The number of bytes received.
1946+ *
1947+ * @throws asio::system_error Thrown on failure.
1948+ *
1949+ * @note The receive operation can only be used with a connected socket. Use
1950+ * the receive_from function to receive data on an unconnected datagram
1951+ * socket.
1952+ *
1953+ * @par Example
1954+ * To receive into a single data buffer use the @ref buffer function as
1955+ * follows:
1956+ * @code socket.receive(asio::buffer(data, size)); @endcode
1957+ * See the @ref buffer documentation for information on receiving into
1958+ * multiple buffers in one go, and how to use it with arrays, boost::array or
1959+ * std::vector.
1960+ */
1961+ template <typename MutableBufferSequence>
1962+ std::size_t receive(const MutableBufferSequence& buffers)
1963+ {
1964+ asio::error_code ec;
1965+ std::size_t s = this->service.receive(
1966+ this->implementation, buffers, 0, ec);
1967+ asio::detail::throw_error(ec);
1968+ return s;
1969+ }
1970+
1971+ /// Receive some data on a connected socket.
1972+ /**
1973+ * This function is used to receive data on the datagram socket. The function
1974+ * call will block until data has been received successfully or an error
1975+ * occurs.
1976+ *
1977+ * @param buffers One or more buffers into which the data will be received.
1978+ *
1979+ * @param flags Flags specifying how the receive call is to be made.
1980+ *
1981+ * @returns The number of bytes received.
1982+ *
1983+ * @throws asio::system_error Thrown on failure.
1984+ *
1985+ * @note The receive operation can only be used with a connected socket. Use
1986+ * the receive_from function to receive data on an unconnected datagram
1987+ * socket.
1988+ */
1989+ template <typename MutableBufferSequence>
1990+ std::size_t receive(const MutableBufferSequence& buffers,
1991+ socket_base::message_flags flags)
1992+ {
1993+ asio::error_code ec;
1994+ std::size_t s = this->service.receive(
1995+ this->implementation, buffers, flags, ec);
1996+ asio::detail::throw_error(ec);
1997+ return s;
1998+ }
1999+
2000+ /// Receive some data on a connected socket.
2001+ /**
2002+ * This function is used to receive data on the datagram socket. The function
2003+ * call will block until data has been received successfully or an error
2004+ * occurs.
2005+ *
2006+ * @param buffers One or more buffers into which the data will be received.
2007+ *
2008+ * @param flags Flags specifying how the receive call is to be made.
2009+ *
2010+ * @param ec Set to indicate what error occurred, if any.
2011+ *
2012+ * @returns The number of bytes received.
2013+ *
2014+ * @note The receive operation can only be used with a connected socket. Use
2015+ * the receive_from function to receive data on an unconnected datagram
2016+ * socket.
2017+ */
2018+ template <typename MutableBufferSequence>
2019+ std::size_t receive(const MutableBufferSequence& buffers,
2020+ socket_base::message_flags flags, asio::error_code& ec)
2021+ {
2022+ return this->service.receive(this->implementation, buffers, flags, ec);
2023+ }
2024+
2025+ /// Start an asynchronous receive on a connected socket.
2026+ /**
2027+ * This function is used to asynchronously receive data from the datagram
2028+ * socket. The function call always returns immediately.
2029+ *
2030+ * @param buffers One or more buffers into which the data will be received.
2031+ * Although the buffers object may be copied as necessary, ownership of the
2032+ * underlying memory blocks is retained by the caller, which must guarantee
2033+ * that they remain valid until the handler is called.
2034+ *
2035+ * @param handler The handler to be called when the receive operation
2036+ * completes. Copies will be made of the handler as required. The function
2037+ * signature of the handler must be:
2038+ * @code void handler(
2039+ * const asio::error_code& error, // Result of operation.
2040+ * std::size_t bytes_transferred // Number of bytes received.
2041+ * ); @endcode
2042+ * Regardless of whether the asynchronous operation completes immediately or
2043+ * not, the handler will not be invoked from within this function. Invocation
2044+ * of the handler will be performed in a manner equivalent to using
2045+ * asio::io_service::post().
2046+ *
2047+ * @note The async_receive operation can only be used with a connected socket.
2048+ * Use the async_receive_from function to receive data on an unconnected
2049+ * datagram socket.
2050+ *
2051+ * @par Example
2052+ * To receive into a single data buffer use the @ref buffer function as
2053+ * follows:
2054+ * @code
2055+ * socket.async_receive(asio::buffer(data, size), handler);
2056+ * @endcode
2057+ * See the @ref buffer documentation for information on receiving into
2058+ * multiple buffers in one go, and how to use it with arrays, boost::array or
2059+ * std::vector.
2060+ */
2061+ template <typename MutableBufferSequence, typename ReadHandler>
2062+ void async_receive(const MutableBufferSequence& buffers, ReadHandler handler)
2063+ {
2064+ this->service.async_receive(this->implementation, buffers, 0, handler);
2065+ }
2066+
2067+ /// Start an asynchronous receive on a connected socket.
2068+ /**
2069+ * This function is used to asynchronously receive data from the datagram
2070+ * socket. The function call always returns immediately.
2071+ *
2072+ * @param buffers One or more buffers into which the data will be received.
2073+ * Although the buffers object may be copied as necessary, ownership of the
2074+ * underlying memory blocks is retained by the caller, which must guarantee
2075+ * that they remain valid until the handler is called.
2076+ *
2077+ * @param flags Flags specifying how the receive call is to be made.
2078+ *
2079+ * @param handler The handler to be called when the receive operation
2080+ * completes. Copies will be made of the handler as required. The function
2081+ * signature of the handler must be:
2082+ * @code void handler(
2083+ * const asio::error_code& error, // Result of operation.
2084+ * std::size_t bytes_transferred // Number of bytes received.
2085+ * ); @endcode
2086+ * Regardless of whether the asynchronous operation completes immediately or
2087+ * not, the handler will not be invoked from within this function. Invocation
2088+ * of the handler will be performed in a manner equivalent to using
2089+ * asio::io_service::post().
2090+ *
2091+ * @note The async_receive operation can only be used with a connected socket.
2092+ * Use the async_receive_from function to receive data on an unconnected
2093+ * datagram socket.
2094+ */
2095+ template <typename MutableBufferSequence, typename ReadHandler>
2096+ void async_receive(const MutableBufferSequence& buffers,
2097+ socket_base::message_flags flags, ReadHandler handler)
2098+ {
2099+ this->service.async_receive(this->implementation, buffers, flags, handler);
2100+ }
2101+
2102+ /// Receive a datagram with the endpoint of the sender.
2103+ /**
2104+ * This function is used to receive a datagram. The function call will block
2105+ * until data has been received successfully or an error occurs.
2106+ *
2107+ * @param buffers One or more buffers into which the data will be received.
2108+ *
2109+ * @param sender_endpoint An endpoint object that receives the endpoint of
2110+ * the remote sender of the datagram.
2111+ *
2112+ * @returns The number of bytes received.
2113+ *
2114+ * @throws asio::system_error Thrown on failure.
2115+ *
2116+ * @par Example
2117+ * To receive into a single data buffer use the @ref buffer function as
2118+ * follows:
2119+ * @code
2120+ * asio::ip::udp::endpoint sender_endpoint;
2121+ * socket.receive_from(
2122+ * asio::buffer(data, size), sender_endpoint);
2123+ * @endcode
2124+ * See the @ref buffer documentation for information on receiving into
2125+ * multiple buffers in one go, and how to use it with arrays, boost::array or
2126+ * std::vector.
2127+ */
2128+ template <typename MutableBufferSequence>
2129+ std::size_t receive_from(const MutableBufferSequence& buffers,
2130+ endpoint_type& sender_endpoint)
2131+ {
2132+ asio::error_code ec;
2133+ std::size_t s = this->service.receive_from(
2134+ this->implementation, buffers, sender_endpoint, 0, ec);
2135+ asio::detail::throw_error(ec);
2136+ return s;
2137+ }
2138+
2139+ /// Receive a datagram with the endpoint of the sender.
2140+ /**
2141+ * This function is used to receive a datagram. The function call will block
2142+ * until data has been received successfully or an error occurs.
2143+ *
2144+ * @param buffers One or more buffers into which the data will be received.
2145+ *
2146+ * @param sender_endpoint An endpoint object that receives the endpoint of
2147+ * the remote sender of the datagram.
2148+ *
2149+ * @param flags Flags specifying how the receive call is to be made.
2150+ *
2151+ * @returns The number of bytes received.
2152+ *
2153+ * @throws asio::system_error Thrown on failure.
2154+ */
2155+ template <typename MutableBufferSequence>
2156+ std::size_t receive_from(const MutableBufferSequence& buffers,
2157+ endpoint_type& sender_endpoint, socket_base::message_flags flags)
2158+ {
2159+ asio::error_code ec;
2160+ std::size_t s = this->service.receive_from(
2161+ this->implementation, buffers, sender_endpoint, flags, ec);
2162+ asio::detail::throw_error(ec);
2163+ return s;
2164+ }
2165+
2166+ /// Receive a datagram with the endpoint of the sender.
2167+ /**
2168+ * This function is used to receive a datagram. The function call will block
2169+ * until data has been received successfully or an error occurs.
2170+ *
2171+ * @param buffers One or more buffers into which the data will be received.
2172+ *
2173+ * @param sender_endpoint An endpoint object that receives the endpoint of
2174+ * the remote sender of the datagram.
2175+ *
2176+ * @param flags Flags specifying how the receive call is to be made.
2177+ *
2178+ * @param ec Set to indicate what error occurred, if any.
2179+ *
2180+ * @returns The number of bytes received.
2181+ */
2182+ template <typename MutableBufferSequence>
2183+ std::size_t receive_from(const MutableBufferSequence& buffers,
2184+ endpoint_type& sender_endpoint, socket_base::message_flags flags,
2185+ asio::error_code& ec)
2186+ {
2187+ return this->service.receive_from(this->implementation, buffers,
2188+ sender_endpoint, flags, ec);
2189+ }
2190+
2191+ /// Start an asynchronous receive.
2192+ /**
2193+ * This function is used to asynchronously receive a datagram. The function
2194+ * call always returns immediately.
2195+ *
2196+ * @param buffers One or more buffers into which the data will be received.
2197+ * Although the buffers object may be copied as necessary, ownership of the
2198+ * underlying memory blocks is retained by the caller, which must guarantee
2199+ * that they remain valid until the handler is called.
2200+ *
2201+ * @param sender_endpoint An endpoint object that receives the endpoint of
2202+ * the remote sender of the datagram. Ownership of the sender_endpoint object
2203+ * is retained by the caller, which must guarantee that it is valid until the
2204+ * handler is called.
2205+ *
2206+ * @param handler The handler to be called when the receive operation
2207+ * completes. Copies will be made of the handler as required. The function
2208+ * signature of the handler must be:
2209+ * @code void handler(
2210+ * const asio::error_code& error, // Result of operation.
2211+ * std::size_t bytes_transferred // Number of bytes received.
2212+ * ); @endcode
2213+ * Regardless of whether the asynchronous operation completes immediately or
2214+ * not, the handler will not be invoked from within this function. Invocation
2215+ * of the handler will be performed in a manner equivalent to using
2216+ * asio::io_service::post().
2217+ *
2218+ * @par Example
2219+ * To receive into a single data buffer use the @ref buffer function as
2220+ * follows:
2221+ * @code socket.async_receive_from(
2222+ * asio::buffer(data, size), 0, sender_endpoint, handler); @endcode
2223+ * See the @ref buffer documentation for information on receiving into
2224+ * multiple buffers in one go, and how to use it with arrays, boost::array or
2225+ * std::vector.
2226+ */
2227+ template <typename MutableBufferSequence, typename ReadHandler>
2228+ void async_receive_from(const MutableBufferSequence& buffers,
2229+ endpoint_type& sender_endpoint, ReadHandler handler)
2230+ {
2231+ this->service.async_receive_from(this->implementation, buffers,
2232+ sender_endpoint, 0, handler);
2233+ }
2234+
2235+ /// Start an asynchronous receive.
2236+ /**
2237+ * This function is used to asynchronously receive a datagram. The function
2238+ * call always returns immediately.
2239+ *
2240+ * @param buffers One or more buffers into which the data will be received.
2241+ * Although the buffers object may be copied as necessary, ownership of the
2242+ * underlying memory blocks is retained by the caller, which must guarantee
2243+ * that they remain valid until the handler is called.
2244+ *
2245+ * @param sender_endpoint An endpoint object that receives the endpoint of
2246+ * the remote sender of the datagram. Ownership of the sender_endpoint object
2247+ * is retained by the caller, which must guarantee that it is valid until the
2248+ * handler is called.
2249+ *
2250+ * @param flags Flags specifying how the receive call is to be made.
2251+ *
2252+ * @param handler The handler to be called when the receive operation
2253+ * completes. Copies will be made of the handler as required. The function
2254+ * signature of the handler must be:
2255+ * @code void handler(
2256+ * const asio::error_code& error, // Result of operation.
2257+ * std::size_t bytes_transferred // Number of bytes received.
2258+ * ); @endcode
2259+ * Regardless of whether the asynchronous operation completes immediately or
2260+ * not, the handler will not be invoked from within this function. Invocation
2261+ * of the handler will be performed in a manner equivalent to using
2262+ * asio::io_service::post().
2263+ */
2264+ template <typename MutableBufferSequence, typename ReadHandler>
2265+ void async_receive_from(const MutableBufferSequence& buffers,
2266+ endpoint_type& sender_endpoint, socket_base::message_flags flags,
2267+ ReadHandler handler)
2268+ {
2269+ this->service.async_receive_from(this->implementation, buffers,
2270+ sender_endpoint, flags, handler);
2271+ }
2272+};
2273+
2274+} // namespace asio
2275+
2276+#include "asio/detail/pop_options.hpp"
2277+
2278+#endif // ASIO_BASIC_DATAGRAM_SOCKET_HPP
2279
2280=== added file 'asio/asio/basic_deadline_timer.hpp'
2281--- asio/asio/basic_deadline_timer.hpp 1970-01-01 00:00:00 +0000
2282+++ asio/asio/basic_deadline_timer.hpp 2013-11-06 15:11:01 +0000
2283@@ -0,0 +1,442 @@
2284+//
2285+// basic_deadline_timer.hpp
2286+// ~~~~~~~~~~~~~~~~~~~~~~~~
2287+//
2288+// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
2289+//
2290+// Distributed under the Boost Software License, Version 1.0. (See accompanying
2291+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
2292+//
2293+
2294+#ifndef ASIO_BASIC_DEADLINE_TIMER_HPP
2295+#define ASIO_BASIC_DEADLINE_TIMER_HPP
2296+
2297+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
2298+# pragma once
2299+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
2300+
2301+#include "asio/detail/config.hpp"
2302+#include <cstddef>
2303+#include "asio/basic_io_object.hpp"
2304+#include "asio/deadline_timer_service.hpp"
2305+#include "asio/detail/throw_error.hpp"
2306+#include "asio/error.hpp"
2307+
2308+#include "asio/detail/push_options.hpp"
2309+
2310+namespace asio {
2311+
2312+/// Provides waitable timer functionality.
2313+/**
2314+ * The basic_deadline_timer class template provides the ability to perform a
2315+ * blocking or asynchronous wait for a timer to expire.
2316+ *
2317+ * A deadline timer is always in one of two states: "expired" or "not expired".
2318+ * If the wait() or async_wait() function is called on an expired timer, the
2319+ * wait operation will complete immediately.
2320+ *
2321+ * Most applications will use the asio::deadline_timer typedef.
2322+ *
2323+ * @par Thread Safety
2324+ * @e Distinct @e objects: Safe.@n
2325+ * @e Shared @e objects: Unsafe.
2326+ *
2327+ * @par Examples
2328+ * Performing a blocking wait:
2329+ * @code
2330+ * // Construct a timer without setting an expiry time.
2331+ * asio::deadline_timer timer(io_service);
2332+ *
2333+ * // Set an expiry time relative to now.
2334+ * timer.expires_from_now(boost::posix_time::seconds(5));
2335+ *
2336+ * // Wait for the timer to expire.
2337+ * timer.wait();
2338+ * @endcode
2339+ *
2340+ * @par
2341+ * Performing an asynchronous wait:
2342+ * @code
2343+ * void handler(const asio::error_code& error)
2344+ * {
2345+ * if (!error)
2346+ * {
2347+ * // Timer expired.
2348+ * }
2349+ * }
2350+ *
2351+ * ...
2352+ *
2353+ * // Construct a timer with an absolute expiry time.
2354+ * asio::deadline_timer timer(io_service,
2355+ * boost::posix_time::time_from_string("2005-12-07 23:59:59.000"));
2356+ *
2357+ * // Start an asynchronous wait.
2358+ * timer.async_wait(handler);
2359+ * @endcode
2360+ *
2361+ * @par Changing an active deadline_timer's expiry time
2362+ *
2363+ * Changing the expiry time of a timer while there are pending asynchronous
2364+ * waits causes those wait operations to be cancelled. To ensure that the action
2365+ * associated with the timer is performed only once, use something like this:
2366+ * used:
2367+ *
2368+ * @code
2369+ * void on_some_event()
2370+ * {
2371+ * if (my_timer.expires_from_now(seconds(5)) > 0)
2372+ * {
2373+ * // We managed to cancel the timer. Start new asynchronous wait.
2374+ * my_timer.async_wait(on_timeout);
2375+ * }
2376+ * else
2377+ * {
2378+ * // Too late, timer has already expired!
2379+ * }
2380+ * }
2381+ *
2382+ * void on_timeout(const asio::error_code& e)
2383+ * {
2384+ * if (e != asio::error::operation_aborted)
2385+ * {
2386+ * // Timer was not cancelled, take necessary action.
2387+ * }
2388+ * }
2389+ * @endcode
2390+ *
2391+ * @li The asio::basic_deadline_timer::expires_from_now() function
2392+ * cancels any pending asynchronous waits, and returns the number of
2393+ * asynchronous waits that were cancelled. If it returns 0 then you were too
2394+ * late and the wait handler has already been executed, or will soon be
2395+ * executed. If it returns 1 then the wait handler was successfully cancelled.
2396+ *
2397+ * @li If a wait handler is cancelled, the asio::error_code passed to
2398+ * it contains the value asio::error::operation_aborted.
2399+ */
2400+template <typename Time,
2401+ typename TimeTraits = asio::time_traits<Time>,
2402+ typename TimerService = deadline_timer_service<Time, TimeTraits> >
2403+class basic_deadline_timer
2404+ : public basic_io_object<TimerService>
2405+{
2406+public:
2407+ /// The time traits type.
2408+ typedef TimeTraits traits_type;
2409+
2410+ /// The time type.
2411+ typedef typename traits_type::time_type time_type;
2412+
2413+ /// The duration type.
2414+ typedef typename traits_type::duration_type duration_type;
2415+
2416+ /// Constructor.
2417+ /**
2418+ * This constructor creates a timer without setting an expiry time. The
2419+ * expires_at() or expires_from_now() functions must be called to set an
2420+ * expiry time before the timer can be waited on.
2421+ *
2422+ * @param io_service The io_service object that the timer will use to dispatch
2423+ * handlers for any asynchronous operations performed on the timer.
2424+ */
2425+ explicit basic_deadline_timer(asio::io_service& io_service)
2426+ : basic_io_object<TimerService>(io_service)
2427+ {
2428+ }
2429+
2430+ /// Constructor to set a particular expiry time as an absolute time.
2431+ /**
2432+ * This constructor creates a timer and sets the expiry time.
2433+ *
2434+ * @param io_service The io_service object that the timer will use to dispatch
2435+ * handlers for any asynchronous operations performed on the timer.
2436+ *
2437+ * @param expiry_time The expiry time to be used for the timer, expressed
2438+ * as an absolute time.
2439+ */
2440+ basic_deadline_timer(asio::io_service& io_service,
2441+ const time_type& expiry_time)
2442+ : basic_io_object<TimerService>(io_service)
2443+ {
2444+ asio::error_code ec;
2445+ this->service.expires_at(this->implementation, expiry_time, ec);
2446+ asio::detail::throw_error(ec);
2447+ }
2448+
2449+ /// Constructor to set a particular expiry time relative to now.
2450+ /**
2451+ * This constructor creates a timer and sets the expiry time.
2452+ *
2453+ * @param io_service The io_service object that the timer will use to dispatch
2454+ * handlers for any asynchronous operations performed on the timer.
2455+ *
2456+ * @param expiry_time The expiry time to be used for the timer, relative to
2457+ * now.
2458+ */
2459+ basic_deadline_timer(asio::io_service& io_service,
2460+ const duration_type& expiry_time)
2461+ : basic_io_object<TimerService>(io_service)
2462+ {
2463+ asio::error_code ec;
2464+ this->service.expires_from_now(this->implementation, expiry_time, ec);
2465+ asio::detail::throw_error(ec);
2466+ }
2467+
2468+ /// Cancel any asynchronous operations that are waiting on the timer.
2469+ /**
2470+ * This function forces the completion of any pending asynchronous wait
2471+ * operations against the timer. The handler for each cancelled operation will
2472+ * be invoked with the asio::error::operation_aborted error code.
2473+ *
2474+ * Cancelling the timer does not change the expiry time.
2475+ *
2476+ * @return The number of asynchronous operations that were cancelled.
2477+ *
2478+ * @throws asio::system_error Thrown on failure.
2479+ *
2480+ * @note If the timer has already expired when cancel() is called, then the
2481+ * handlers for asynchronous wait operations will:
2482+ *
2483+ * @li have already been invoked; or
2484+ *
2485+ * @li have been queued for invocation in the near future.
2486+ *
2487+ * These handlers can no longer be cancelled, and therefore are passed an
2488+ * error code that indicates the successful completion of the wait operation.
2489+ */
2490+ std::size_t cancel()
2491+ {
2492+ asio::error_code ec;
2493+ std::size_t s = this->service.cancel(this->implementation, ec);
2494+ asio::detail::throw_error(ec);
2495+ return s;
2496+ }
2497+
2498+ /// Cancel any asynchronous operations that are waiting on the timer.
2499+ /**
2500+ * This function forces the completion of any pending asynchronous wait
2501+ * operations against the timer. The handler for each cancelled operation will
2502+ * be invoked with the asio::error::operation_aborted error code.
2503+ *
2504+ * Cancelling the timer does not change the expiry time.
2505+ *
2506+ * @param ec Set to indicate what error occurred, if any.
2507+ *
2508+ * @return The number of asynchronous operations that were cancelled.
2509+ *
2510+ * @note If the timer has already expired when cancel() is called, then the
2511+ * handlers for asynchronous wait operations will:
2512+ *
2513+ * @li have already been invoked; or
2514+ *
2515+ * @li have been queued for invocation in the near future.
2516+ *
2517+ * These handlers can no longer be cancelled, and therefore are passed an
2518+ * error code that indicates the successful completion of the wait operation.
2519+ */
2520+ std::size_t cancel(asio::error_code& ec)
2521+ {
2522+ return this->service.cancel(this->implementation, ec);
2523+ }
2524+
2525+ /// Get the timer's expiry time as an absolute time.
2526+ /**
2527+ * This function may be used to obtain the timer's current expiry time.
2528+ * Whether the timer has expired or not does not affect this value.
2529+ */
2530+ time_type expires_at() const
2531+ {
2532+ return this->service.expires_at(this->implementation);
2533+ }
2534+
2535+ /// Set the timer's expiry time as an absolute time.
2536+ /**
2537+ * This function sets the expiry time. Any pending asynchronous wait
2538+ * operations will be cancelled. The handler for each cancelled operation will
2539+ * be invoked with the asio::error::operation_aborted error code.
2540+ *
2541+ * @param expiry_time The expiry time to be used for the timer.
2542+ *
2543+ * @return The number of asynchronous operations that were cancelled.
2544+ *
2545+ * @throws asio::system_error Thrown on failure.
2546+ *
2547+ * @note If the timer has already expired when expires_at() is called, then
2548+ * the handlers for asynchronous wait operations will:
2549+ *
2550+ * @li have already been invoked; or
2551+ *
2552+ * @li have been queued for invocation in the near future.
2553+ *
2554+ * These handlers can no longer be cancelled, and therefore are passed an
2555+ * error code that indicates the successful completion of the wait operation.
2556+ */
2557+ std::size_t expires_at(const time_type& expiry_time)
2558+ {
2559+ asio::error_code ec;
2560+ std::size_t s = this->service.expires_at(
2561+ this->implementation, expiry_time, ec);
2562+ asio::detail::throw_error(ec);
2563+ return s;
2564+ }
2565+
2566+ /// Set the timer's expiry time as an absolute time.
2567+ /**
2568+ * This function sets the expiry time. Any pending asynchronous wait
2569+ * operations will be cancelled. The handler for each cancelled operation will
2570+ * be invoked with the asio::error::operation_aborted error code.
2571+ *
2572+ * @param expiry_time The expiry time to be used for the timer.
2573+ *
2574+ * @param ec Set to indicate what error occurred, if any.
2575+ *
2576+ * @return The number of asynchronous operations that were cancelled.
2577+ *
2578+ * @note If the timer has already expired when expires_at() is called, then
2579+ * the handlers for asynchronous wait operations will:
2580+ *
2581+ * @li have already been invoked; or
2582+ *
2583+ * @li have been queued for invocation in the near future.
2584+ *
2585+ * These handlers can no longer be cancelled, and therefore are passed an
2586+ * error code that indicates the successful completion of the wait operation.
2587+ */
2588+ std::size_t expires_at(const time_type& expiry_time,
2589+ asio::error_code& ec)
2590+ {
2591+ return this->service.expires_at(this->implementation, expiry_time, ec);
2592+ }
2593+
2594+ /// Get the timer's expiry time relative to now.
2595+ /**
2596+ * This function may be used to obtain the timer's current expiry time.
2597+ * Whether the timer has expired or not does not affect this value.
2598+ */
2599+ duration_type expires_from_now() const
2600+ {
2601+ return this->service.expires_from_now(this->implementation);
2602+ }
2603+
2604+ /// Set the timer's expiry time relative to now.
2605+ /**
2606+ * This function sets the expiry time. Any pending asynchronous wait
2607+ * operations will be cancelled. The handler for each cancelled operation will
2608+ * be invoked with the asio::error::operation_aborted error code.
2609+ *
2610+ * @param expiry_time The expiry time to be used for the timer.
2611+ *
2612+ * @return The number of asynchronous operations that were cancelled.
2613+ *
2614+ * @throws asio::system_error Thrown on failure.
2615+ *
2616+ * @note If the timer has already expired when expires_from_now() is called,
2617+ * then the handlers for asynchronous wait operations will:
2618+ *
2619+ * @li have already been invoked; or
2620+ *
2621+ * @li have been queued for invocation in the near future.
2622+ *
2623+ * These handlers can no longer be cancelled, and therefore are passed an
2624+ * error code that indicates the successful completion of the wait operation.
2625+ */
2626+ std::size_t expires_from_now(const duration_type& expiry_time)
2627+ {
2628+ asio::error_code ec;
2629+ std::size_t s = this->service.expires_from_now(
2630+ this->implementation, expiry_time, ec);
2631+ asio::detail::throw_error(ec);
2632+ return s;
2633+ }
2634+
2635+ /// Set the timer's expiry time relative to now.
2636+ /**
2637+ * This function sets the expiry time. Any pending asynchronous wait
2638+ * operations will be cancelled. The handler for each cancelled operation will
2639+ * be invoked with the asio::error::operation_aborted error code.
2640+ *
2641+ * @param expiry_time The expiry time to be used for the timer.
2642+ *
2643+ * @param ec Set to indicate what error occurred, if any.
2644+ *
2645+ * @return The number of asynchronous operations that were cancelled.
2646+ *
2647+ * @note If the timer has already expired when expires_from_now() is called,
2648+ * then the handlers for asynchronous wait operations will:
2649+ *
2650+ * @li have already been invoked; or
2651+ *
2652+ * @li have been queued for invocation in the near future.
2653+ *
2654+ * These handlers can no longer be cancelled, and therefore are passed an
2655+ * error code that indicates the successful completion of the wait operation.
2656+ */
2657+ std::size_t expires_from_now(const duration_type& expiry_time,
2658+ asio::error_code& ec)
2659+ {
2660+ return this->service.expires_from_now(
2661+ this->implementation, expiry_time, ec);
2662+ }
2663+
2664+ /// Perform a blocking wait on the timer.
2665+ /**
2666+ * This function is used to wait for the timer to expire. This function
2667+ * blocks and does not return until the timer has expired.
2668+ *
2669+ * @throws asio::system_error Thrown on failure.
2670+ */
2671+ void wait()
2672+ {
2673+ asio::error_code ec;
2674+ this->service.wait(this->implementation, ec);
2675+ asio::detail::throw_error(ec);
2676+ }
2677+
2678+ /// Perform a blocking wait on the timer.
2679+ /**
2680+ * This function is used to wait for the timer to expire. This function
2681+ * blocks and does not return until the timer has expired.
2682+ *
2683+ * @param ec Set to indicate what error occurred, if any.
2684+ */
2685+ void wait(asio::error_code& ec)
2686+ {
2687+ this->service.wait(this->implementation, ec);
2688+ }
2689+
2690+ /// Start an asynchronous wait on the timer.
2691+ /**
2692+ * This function may be used to initiate an asynchronous wait against the
2693+ * timer. It always returns immediately.
2694+ *
2695+ * For each call to async_wait(), the supplied handler will be called exactly
2696+ * once. The handler will be called when:
2697+ *
2698+ * @li The timer has expired.
2699+ *
2700+ * @li The timer was cancelled, in which case the handler is passed the error
2701+ * code asio::error::operation_aborted.
2702+ *
2703+ * @param handler The handler to be called when the timer expires. Copies
2704+ * will be made of the handler as required. The function signature of the
2705+ * handler must be:
2706+ * @code void handler(
2707+ * const asio::error_code& error // Result of operation.
2708+ * ); @endcode
2709+ * Regardless of whether the asynchronous operation completes immediately or
2710+ * not, the handler will not be invoked from within this function. Invocation
2711+ * of the handler will be performed in a manner equivalent to using
2712+ * asio::io_service::post().
2713+ */
2714+ template <typename WaitHandler>
2715+ void async_wait(WaitHandler handler)
2716+ {
2717+ this->service.async_wait(this->implementation, handler);
2718+ }
2719+};
2720+
2721+} // namespace asio
2722+
2723+#include "asio/detail/pop_options.hpp"
2724+
2725+#endif // ASIO_BASIC_DEADLINE_TIMER_HPP
2726
2727=== added file 'asio/asio/basic_io_object.hpp'
2728--- asio/asio/basic_io_object.hpp 1970-01-01 00:00:00 +0000
2729+++ asio/asio/basic_io_object.hpp 2013-11-06 15:11:01 +0000
2730@@ -0,0 +1,98 @@
2731+//
2732+// basic_io_object.hpp
2733+// ~~~~~~~~~~~~~~~~~~~
2734+//
2735+// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
2736+//
2737+// Distributed under the Boost Software License, Version 1.0. (See accompanying
2738+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
2739+//
2740+
2741+#ifndef ASIO_BASIC_IO_OBJECT_HPP
2742+#define ASIO_BASIC_IO_OBJECT_HPP
2743+
2744+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
2745+# pragma once
2746+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
2747+
2748+#include "asio/detail/config.hpp"
2749+#include "asio/detail/noncopyable.hpp"
2750+#include "asio/io_service.hpp"
2751+
2752+#include "asio/detail/push_options.hpp"
2753+
2754+namespace asio {
2755+
2756+/// Base class for all I/O objects.
2757+template <typename IoObjectService>
2758+class basic_io_object
2759+ : private noncopyable
2760+{
2761+public:
2762+ /// The type of the service that will be used to provide I/O operations.
2763+ typedef IoObjectService service_type;
2764+
2765+ /// The underlying implementation type of I/O object.
2766+ typedef typename service_type::implementation_type implementation_type;
2767+
2768+ /// (Deprecated: use get_io_service().) Get the io_service associated with
2769+ /// the object.
2770+ /**
2771+ * This function may be used to obtain the io_service object that the I/O
2772+ * object uses to dispatch handlers for asynchronous operations.
2773+ *
2774+ * @return A reference to the io_service object that the I/O object will use
2775+ * to dispatch handlers. Ownership is not transferred to the caller.
2776+ */
2777+ asio::io_service& io_service()
2778+ {
2779+ return service.get_io_service();
2780+ }
2781+
2782+ /// Get the io_service associated with the object.
2783+ /**
2784+ * This function may be used to obtain the io_service object that the I/O
2785+ * object uses to dispatch handlers for asynchronous operations.
2786+ *
2787+ * @return A reference to the io_service object that the I/O object will use
2788+ * to dispatch handlers. Ownership is not transferred to the caller.
2789+ */
2790+ asio::io_service& get_io_service()
2791+ {
2792+ return service.get_io_service();
2793+ }
2794+
2795+protected:
2796+ /// Construct a basic_io_object.
2797+ /**
2798+ * Performs:
2799+ * @code service.construct(implementation); @endcode
2800+ */
2801+ explicit basic_io_object(asio::io_service& io_service)
2802+ : service(asio::use_service<IoObjectService>(io_service))
2803+ {
2804+ service.construct(implementation);
2805+ }
2806+
2807+ /// Protected destructor to prevent deletion through this type.
2808+ /**
2809+ * Performs:
2810+ * @code service.destroy(implementation); @endcode
2811+ */
2812+ ~basic_io_object()
2813+ {
2814+ service.destroy(implementation);
2815+ }
2816+
2817+ /// The service associated with the I/O object.
2818+ service_type& service;
2819+
2820+ /// The underlying implementation of the I/O object.
2821+ implementation_type implementation;
2822+};
2823+
2824+} // namespace asio
2825+
2826+#include "asio/detail/pop_options.hpp"
2827+
2828+#endif // ASIO_BASIC_IO_OBJECT_HPP
2829
2830=== added file 'asio/asio/basic_raw_socket.hpp'
2831--- asio/asio/basic_raw_socket.hpp 1970-01-01 00:00:00 +0000
2832+++ asio/asio/basic_raw_socket.hpp 2013-11-06 15:11:01 +0000
2833@@ -0,0 +1,795 @@
2834+//
2835+// basic_raw_socket.hpp
2836+// ~~~~~~~~~~~~~~~~~~~~
2837+//
2838+// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
2839+//
2840+// Distributed under the Boost Software License, Version 1.0. (See accompanying
2841+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
2842+//
2843+
2844+#ifndef ASIO_BASIC_RAW_SOCKET_HPP
2845+#define ASIO_BASIC_RAW_SOCKET_HPP
2846+
2847+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
2848+# pragma once
2849+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
2850+
2851+#include "asio/detail/config.hpp"
2852+#include <cstddef>
2853+#include "asio/basic_socket.hpp"
2854+#include "asio/detail/throw_error.hpp"
2855+#include "asio/error.hpp"
2856+#include "asio/raw_socket_service.hpp"
2857+
2858+#include "asio/detail/push_options.hpp"
2859+
2860+namespace asio {
2861+
2862+/// Provides raw-oriented socket functionality.
2863+/**
2864+ * The basic_raw_socket class template provides asynchronous and blocking
2865+ * raw-oriented socket functionality.
2866+ *
2867+ * @par Thread Safety
2868+ * @e Distinct @e objects: Safe.@n
2869+ * @e Shared @e objects: Unsafe.
2870+ */
2871+template <typename Protocol,
2872+ typename RawSocketService = raw_socket_service<Protocol> >
2873+class basic_raw_socket
2874+ : public basic_socket<Protocol, RawSocketService>
2875+{
2876+public:
2877+ /// The native representation of a socket.
2878+ typedef typename RawSocketService::native_type native_type;
2879+
2880+ /// The protocol type.
2881+ typedef Protocol protocol_type;
2882+
2883+ /// The endpoint type.
2884+ typedef typename Protocol::endpoint endpoint_type;
2885+
2886+ /// Construct a basic_raw_socket without opening it.
2887+ /**
2888+ * This constructor creates a raw socket without opening it. The open()
2889+ * function must be called before data can be sent or received on the socket.
2890+ *
2891+ * @param io_service The io_service object that the raw socket will use
2892+ * to dispatch handlers for any asynchronous operations performed on the
2893+ * socket.
2894+ */
2895+ explicit basic_raw_socket(asio::io_service& io_service)
2896+ : basic_socket<Protocol, RawSocketService>(io_service)
2897+ {
2898+ }
2899+
2900+ /// Construct and open a basic_raw_socket.
2901+ /**
2902+ * This constructor creates and opens a raw socket.
2903+ *
2904+ * @param io_service The io_service object that the raw socket will use
2905+ * to dispatch handlers for any asynchronous operations performed on the
2906+ * socket.
2907+ *
2908+ * @param protocol An object specifying protocol parameters to be used.
2909+ *
2910+ * @throws asio::system_error Thrown on failure.
2911+ */
2912+ basic_raw_socket(asio::io_service& io_service,
2913+ const protocol_type& protocol)
2914+ : basic_socket<Protocol, RawSocketService>(io_service, protocol)
2915+ {
2916+ }
2917+
2918+ /// Construct a basic_raw_socket, opening it and binding it to the given
2919+ /// local endpoint.
2920+ /**
2921+ * This constructor creates a raw socket and automatically opens it bound
2922+ * to the specified endpoint on the local machine. The protocol used is the
2923+ * protocol associated with the given endpoint.
2924+ *
2925+ * @param io_service The io_service object that the raw socket will use
2926+ * to dispatch handlers for any asynchronous operations performed on the
2927+ * socket.
2928+ *
2929+ * @param endpoint An endpoint on the local machine to which the raw
2930+ * socket will be bound.
2931+ *
2932+ * @throws asio::system_error Thrown on failure.
2933+ */
2934+ basic_raw_socket(asio::io_service& io_service,
2935+ const endpoint_type& endpoint)
2936+ : basic_socket<Protocol, RawSocketService>(io_service, endpoint)
2937+ {
2938+ }
2939+
2940+ /// Construct a basic_raw_socket on an existing native socket.
2941+ /**
2942+ * This constructor creates a raw socket object to hold an existing
2943+ * native socket.
2944+ *
2945+ * @param io_service The io_service object that the raw socket will use
2946+ * to dispatch handlers for any asynchronous operations performed on the
2947+ * socket.
2948+ *
2949+ * @param protocol An object specifying protocol parameters to be used.
2950+ *
2951+ * @param native_socket The new underlying socket implementation.
2952+ *
2953+ * @throws asio::system_error Thrown on failure.
2954+ */
2955+ basic_raw_socket(asio::io_service& io_service,
2956+ const protocol_type& protocol, const native_type& native_socket)
2957+ : basic_socket<Protocol, RawSocketService>(
2958+ io_service, protocol, native_socket)
2959+ {
2960+ }
2961+
2962+ /// Send some data on a connected socket.
2963+ /**
2964+ * This function is used to send data on the raw socket. The function call
2965+ * will block until the data has been sent successfully or an error occurs.
2966+ *
2967+ * @param buffers One ore more data buffers to be sent on the socket.
2968+ *
2969+ * @returns The number of bytes sent.
2970+ *
2971+ * @throws asio::system_error Thrown on failure.
2972+ *
2973+ * @note The send operation can only be used with a connected socket. Use
2974+ * the send_to function to send data on an unconnected raw socket.
2975+ *
2976+ * @par Example
2977+ * To send a single data buffer use the @ref buffer function as follows:
2978+ * @code socket.send(asio::buffer(data, size)); @endcode
2979+ * See the @ref buffer documentation for information on sending multiple
2980+ * buffers in one go, and how to use it with arrays, boost::array or
2981+ * std::vector.
2982+ */
2983+ template <typename ConstBufferSequence>
2984+ std::size_t send(const ConstBufferSequence& buffers)
2985+ {
2986+ asio::error_code ec;
2987+ std::size_t s = this->service.send(this->implementation, buffers, 0, ec);
2988+ asio::detail::throw_error(ec);
2989+ return s;
2990+ }
2991+
2992+ /// Send some data on a connected socket.
2993+ /**
2994+ * This function is used to send data on the raw socket. The function call
2995+ * will block until the data has been sent successfully or an error occurs.
2996+ *
2997+ * @param buffers One ore more data buffers to be sent on the socket.
2998+ *
2999+ * @param flags Flags specifying how the send call is to be made.
3000+ *
3001+ * @returns The number of bytes sent.
3002+ *
3003+ * @throws asio::system_error Thrown on failure.
3004+ *
3005+ * @note The send operation can only be used with a connected socket. Use
3006+ * the send_to function to send data on an unconnected raw socket.
3007+ */
3008+ template <typename ConstBufferSequence>
3009+ std::size_t send(const ConstBufferSequence& buffers,
3010+ socket_base::message_flags flags)
3011+ {
3012+ asio::error_code ec;
3013+ std::size_t s = this->service.send(
3014+ this->implementation, buffers, flags, ec);
3015+ asio::detail::throw_error(ec);
3016+ return s;
3017+ }
3018+
3019+ /// Send some data on a connected socket.
3020+ /**
3021+ * This function is used to send data on the raw socket. The function call
3022+ * will block until the data has been sent successfully or an error occurs.
3023+ *
3024+ * @param buffers One or more data buffers to be sent on the socket.
3025+ *
3026+ * @param flags Flags specifying how the send call is to be made.
3027+ *
3028+ * @param ec Set to indicate what error occurred, if any.
3029+ *
3030+ * @returns The number of bytes sent.
3031+ *
3032+ * @note The send operation can only be used with a connected socket. Use
3033+ * the send_to function to send data on an unconnected raw socket.
3034+ */
3035+ template <typename ConstBufferSequence>
3036+ std::size_t send(const ConstBufferSequence& buffers,
3037+ socket_base::message_flags flags, asio::error_code& ec)
3038+ {
3039+ return this->service.send(this->implementation, buffers, flags, ec);
3040+ }
3041+
3042+ /// Start an asynchronous send on a connected socket.
3043+ /**
3044+ * This function is used to send data on the raw socket. The function call
3045+ * will block until the data has been sent successfully or an error occurs.
3046+ *
3047+ * @param buffers One or more data buffers to be sent on the socket. Although
3048+ * the buffers object may be copied as necessary, ownership of the underlying
3049+ * memory blocks is retained by the caller, which must guarantee that they
3050+ * remain valid until the handler is called.
3051+ *
3052+ * @param handler The handler to be called when the send operation completes.
3053+ * Copies will be made of the handler as required. The function signature of
3054+ * the handler must be:
3055+ * @code void handler(
3056+ * const asio::error_code& error, // Result of operation.
3057+ * std::size_t bytes_transferred // Number of bytes sent.
3058+ * ); @endcode
3059+ * Regardless of whether the asynchronous operation completes immediately or
3060+ * not, the handler will not be invoked from within this function. Invocation
3061+ * of the handler will be performed in a manner equivalent to using
3062+ * asio::io_service::post().
3063+ *
3064+ * @note The async_send operation can only be used with a connected socket.
3065+ * Use the async_send_to function to send data on an unconnected raw
3066+ * socket.
3067+ *
3068+ * @par Example
3069+ * To send a single data buffer use the @ref buffer function as follows:
3070+ * @code
3071+ * socket.async_send(asio::buffer(data, size), handler);
3072+ * @endcode
3073+ * See the @ref buffer documentation for information on sending multiple
3074+ * buffers in one go, and how to use it with arrays, boost::array or
3075+ * std::vector.
3076+ */
3077+ template <typename ConstBufferSequence, typename WriteHandler>
3078+ void async_send(const ConstBufferSequence& buffers, WriteHandler handler)
3079+ {
3080+ this->service.async_send(this->implementation, buffers, 0, handler);
3081+ }
3082+
3083+ /// Start an asynchronous send on a connected socket.
3084+ /**
3085+ * This function is used to send data on the raw socket. The function call
3086+ * will block until the data has been sent successfully or an error occurs.
3087+ *
3088+ * @param buffers One or more data buffers to be sent on the socket. Although
3089+ * the buffers object may be copied as necessary, ownership of the underlying
3090+ * memory blocks is retained by the caller, which must guarantee that they
3091+ * remain valid until the handler is called.
3092+ *
3093+ * @param flags Flags specifying how the send call is to be made.
3094+ *
3095+ * @param handler The handler to be called when the send operation completes.
3096+ * Copies will be made of the handler as required. The function signature of
3097+ * the handler must be:
3098+ * @code void handler(
3099+ * const asio::error_code& error, // Result of operation.
3100+ * std::size_t bytes_transferred // Number of bytes sent.
3101+ * ); @endcode
3102+ * Regardless of whether the asynchronous operation completes immediately or
3103+ * not, the handler will not be invoked from within this function. Invocation
3104+ * of the handler will be performed in a manner equivalent to using
3105+ * asio::io_service::post().
3106+ *
3107+ * @note The async_send operation can only be used with a connected socket.
3108+ * Use the async_send_to function to send data on an unconnected raw
3109+ * socket.
3110+ */
3111+ template <typename ConstBufferSequence, typename WriteHandler>
3112+ void async_send(const ConstBufferSequence& buffers,
3113+ socket_base::message_flags flags, WriteHandler handler)
3114+ {
3115+ this->service.async_send(this->implementation, buffers, flags, handler);
3116+ }
3117+
3118+ /// Send raw data to the specified endpoint.
3119+ /**
3120+ * This function is used to send raw data to the specified remote endpoint.
3121+ * The function call will block until the data has been sent successfully or
3122+ * an error occurs.
3123+ *
3124+ * @param buffers One or more data buffers to be sent to the remote endpoint.
3125+ *
3126+ * @param destination The remote endpoint to which the data will be sent.
3127+ *
3128+ * @returns The number of bytes sent.
3129+ *
3130+ * @throws asio::system_error Thrown on failure.
3131+ *
3132+ * @par Example
3133+ * To send a single data buffer use the @ref buffer function as follows:
3134+ * @code
3135+ * asio::ip::udp::endpoint destination(
3136+ * asio::ip::address::from_string("1.2.3.4"), 12345);
3137+ * socket.send_to(asio::buffer(data, size), destination);
3138+ * @endcode
3139+ * See the @ref buffer documentation for information on sending multiple
3140+ * buffers in one go, and how to use it with arrays, boost::array or
3141+ * std::vector.
3142+ */
3143+ template <typename ConstBufferSequence>
3144+ std::size_t send_to(const ConstBufferSequence& buffers,
3145+ const endpoint_type& destination)
3146+ {
3147+ asio::error_code ec;
3148+ std::size_t s = this->service.send_to(
3149+ this->implementation, buffers, destination, 0, ec);
3150+ asio::detail::throw_error(ec);
3151+ return s;
3152+ }
3153+
3154+ /// Send raw data to the specified endpoint.
3155+ /**
3156+ * This function is used to send raw data to the specified remote endpoint.
3157+ * The function call will block until the data has been sent successfully or
3158+ * an error occurs.
3159+ *
3160+ * @param buffers One or more data buffers to be sent to the remote endpoint.
3161+ *
3162+ * @param destination The remote endpoint to which the data will be sent.
3163+ *
3164+ * @param flags Flags specifying how the send call is to be made.
3165+ *
3166+ * @returns The number of bytes sent.
3167+ *
3168+ * @throws asio::system_error Thrown on failure.
3169+ */
3170+ template <typename ConstBufferSequence>
3171+ std::size_t send_to(const ConstBufferSequence& buffers,
3172+ const endpoint_type& destination, socket_base::message_flags flags)
3173+ {
3174+ asio::error_code ec;
3175+ std::size_t s = this->service.send_to(
3176+ this->implementation, buffers, destination, flags, ec);
3177+ asio::detail::throw_error(ec);
3178+ return s;
3179+ }
3180+
3181+ /// Send raw data to the specified endpoint.
3182+ /**
3183+ * This function is used to send raw data to the specified remote endpoint.
3184+ * The function call will block until the data has been sent successfully or
3185+ * an error occurs.
3186+ *
3187+ * @param buffers One or more data buffers to be sent to the remote endpoint.
3188+ *
3189+ * @param destination The remote endpoint to which the data will be sent.
3190+ *
3191+ * @param flags Flags specifying how the send call is to be made.
3192+ *
3193+ * @param ec Set to indicate what error occurred, if any.
3194+ *
3195+ * @returns The number of bytes sent.
3196+ */
3197+ template <typename ConstBufferSequence>
3198+ std::size_t send_to(const ConstBufferSequence& buffers,
3199+ const endpoint_type& destination, socket_base::message_flags flags,
3200+ asio::error_code& ec)
3201+ {
3202+ return this->service.send_to(this->implementation,
3203+ buffers, destination, flags, ec);
3204+ }
3205+
3206+ /// Start an asynchronous send.
3207+ /**
3208+ * This function is used to asynchronously send raw data to the specified
3209+ * remote endpoint. The function call always returns immediately.
3210+ *
3211+ * @param buffers One or more data buffers to be sent to the remote endpoint.
3212+ * Although the buffers object may be copied as necessary, ownership of the
3213+ * underlying memory blocks is retained by the caller, which must guarantee
3214+ * that they remain valid until the handler is called.
3215+ *
3216+ * @param destination The remote endpoint to which the data will be sent.
3217+ * Copies will be made of the endpoint as required.
3218+ *
3219+ * @param handler The handler to be called when the send operation completes.
3220+ * Copies will be made of the handler as required. The function signature of
3221+ * the handler must be:
3222+ * @code void handler(
3223+ * const asio::error_code& error, // Result of operation.
3224+ * std::size_t bytes_transferred // Number of bytes sent.
3225+ * ); @endcode
3226+ * Regardless of whether the asynchronous operation completes immediately or
3227+ * not, the handler will not be invoked from within this function. Invocation
3228+ * of the handler will be performed in a manner equivalent to using
3229+ * asio::io_service::post().
3230+ *
3231+ * @par Example
3232+ * To send a single data buffer use the @ref buffer function as follows:
3233+ * @code
3234+ * asio::ip::udp::endpoint destination(
3235+ * asio::ip::address::from_string("1.2.3.4"), 12345);
3236+ * socket.async_send_to(
3237+ * asio::buffer(data, size), destination, handler);
3238+ * @endcode
3239+ * See the @ref buffer documentation for information on sending multiple
3240+ * buffers in one go, and how to use it with arrays, boost::array or
3241+ * std::vector.
3242+ */
3243+ template <typename ConstBufferSequence, typename WriteHandler>
3244+ void async_send_to(const ConstBufferSequence& buffers,
3245+ const endpoint_type& destination, WriteHandler handler)
3246+ {
3247+ this->service.async_send_to(this->implementation, buffers, destination, 0,
3248+ handler);
3249+ }
3250+
3251+ /// Start an asynchronous send.
3252+ /**
3253+ * This function is used to asynchronously send raw data to the specified
3254+ * remote endpoint. The function call always returns immediately.
3255+ *
3256+ * @param buffers One or more data buffers to be sent to the remote endpoint.
3257+ * Although the buffers object may be copied as necessary, ownership of the
3258+ * underlying memory blocks is retained by the caller, which must guarantee
3259+ * that they remain valid until the handler is called.
3260+ *
3261+ * @param flags Flags specifying how the send call is to be made.
3262+ *
3263+ * @param destination The remote endpoint to which the data will be sent.
3264+ * Copies will be made of the endpoint as required.
3265+ *
3266+ * @param handler The handler to be called when the send operation completes.
3267+ * Copies will be made of the handler as required. The function signature of
3268+ * the handler must be:
3269+ * @code void handler(
3270+ * const asio::error_code& error, // Result of operation.
3271+ * std::size_t bytes_transferred // Number of bytes sent.
3272+ * ); @endcode
3273+ * Regardless of whether the asynchronous operation completes immediately or
3274+ * not, the handler will not be invoked from within this function. Invocation
3275+ * of the handler will be performed in a manner equivalent to using
3276+ * asio::io_service::post().
3277+ */
3278+ template <typename ConstBufferSequence, typename WriteHandler>
3279+ void async_send_to(const ConstBufferSequence& buffers,
3280+ const endpoint_type& destination, socket_base::message_flags flags,
3281+ WriteHandler handler)
3282+ {
3283+ this->service.async_send_to(this->implementation, buffers, destination,
3284+ flags, handler);
3285+ }
3286+
3287+ /// Receive some data on a connected socket.
3288+ /**
3289+ * This function is used to receive data on the raw socket. The function
3290+ * call will block until data has been received successfully or an error
3291+ * occurs.
3292+ *
3293+ * @param buffers One or more buffers into which the data will be received.
3294+ *
3295+ * @returns The number of bytes received.
3296+ *
3297+ * @throws asio::system_error Thrown on failure.
3298+ *
3299+ * @note The receive operation can only be used with a connected socket. Use
3300+ * the receive_from function to receive data on an unconnected raw
3301+ * socket.
3302+ *
3303+ * @par Example
3304+ * To receive into a single data buffer use the @ref buffer function as
3305+ * follows:
3306+ * @code socket.receive(asio::buffer(data, size)); @endcode
3307+ * See the @ref buffer documentation for information on receiving into
3308+ * multiple buffers in one go, and how to use it with arrays, boost::array or
3309+ * std::vector.
3310+ */
3311+ template <typename MutableBufferSequence>
3312+ std::size_t receive(const MutableBufferSequence& buffers)
3313+ {
3314+ asio::error_code ec;
3315+ std::size_t s = this->service.receive(
3316+ this->implementation, buffers, 0, ec);
3317+ asio::detail::throw_error(ec);
3318+ return s;
3319+ }
3320+
3321+ /// Receive some data on a connected socket.
3322+ /**
3323+ * This function is used to receive data on the raw socket. The function
3324+ * call will block until data has been received successfully or an error
3325+ * occurs.
3326+ *
3327+ * @param buffers One or more buffers into which the data will be received.
3328+ *
3329+ * @param flags Flags specifying how the receive call is to be made.
3330+ *
3331+ * @returns The number of bytes received.
3332+ *
3333+ * @throws asio::system_error Thrown on failure.
3334+ *
3335+ * @note The receive operation can only be used with a connected socket. Use
3336+ * the receive_from function to receive data on an unconnected raw
3337+ * socket.
3338+ */
3339+ template <typename MutableBufferSequence>
3340+ std::size_t receive(const MutableBufferSequence& buffers,
3341+ socket_base::message_flags flags)
3342+ {
3343+ asio::error_code ec;
3344+ std::size_t s = this->service.receive(
3345+ this->implementation, buffers, flags, ec);
3346+ asio::detail::throw_error(ec);
3347+ return s;
3348+ }
3349+
3350+ /// Receive some data on a connected socket.
3351+ /**
3352+ * This function is used to receive data on the raw socket. The function
3353+ * call will block until data has been received successfully or an error
3354+ * occurs.
3355+ *
3356+ * @param buffers One or more buffers into which the data will be received.
3357+ *
3358+ * @param flags Flags specifying how the receive call is to be made.
3359+ *
3360+ * @param ec Set to indicate what error occurred, if any.
3361+ *
3362+ * @returns The number of bytes received.
3363+ *
3364+ * @note The receive operation can only be used with a connected socket. Use
3365+ * the receive_from function to receive data on an unconnected raw
3366+ * socket.
3367+ */
3368+ template <typename MutableBufferSequence>
3369+ std::size_t receive(const MutableBufferSequence& buffers,
3370+ socket_base::message_flags flags, asio::error_code& ec)
3371+ {
3372+ return this->service.receive(this->implementation, buffers, flags, ec);
3373+ }
3374+
3375+ /// Start an asynchronous receive on a connected socket.
3376+ /**
3377+ * This function is used to asynchronously receive data from the raw
3378+ * socket. The function call always returns immediately.
3379+ *
3380+ * @param buffers One or more buffers into which the data will be received.
3381+ * Although the buffers object may be copied as necessary, ownership of the
3382+ * underlying memory blocks is retained by the caller, which must guarantee
3383+ * that they remain valid until the handler is called.
3384+ *
3385+ * @param handler The handler to be called when the receive operation
3386+ * completes. Copies will be made of the handler as required. The function
3387+ * signature of the handler must be:
3388+ * @code void handler(
3389+ * const asio::error_code& error, // Result of operation.
3390+ * std::size_t bytes_transferred // Number of bytes received.
3391+ * ); @endcode
3392+ * Regardless of whether the asynchronous operation completes immediately or
3393+ * not, the handler will not be invoked from within this function. Invocation
3394+ * of the handler will be performed in a manner equivalent to using
3395+ * asio::io_service::post().
3396+ *
3397+ * @note The async_receive operation can only be used with a connected socket.
3398+ * Use the async_receive_from function to receive data on an unconnected
3399+ * raw socket.
3400+ *
3401+ * @par Example
3402+ * To receive into a single data buffer use the @ref buffer function as
3403+ * follows:
3404+ * @code
3405+ * socket.async_receive(asio::buffer(data, size), handler);
3406+ * @endcode
3407+ * See the @ref buffer documentation for information on receiving into
3408+ * multiple buffers in one go, and how to use it with arrays, boost::array or
3409+ * std::vector.
3410+ */
3411+ template <typename MutableBufferSequence, typename ReadHandler>
3412+ void async_receive(const MutableBufferSequence& buffers, ReadHandler handler)
3413+ {
3414+ this->service.async_receive(this->implementation, buffers, 0, handler);
3415+ }
3416+
3417+ /// Start an asynchronous receive on a connected socket.
3418+ /**
3419+ * This function is used to asynchronously receive data from the raw
3420+ * socket. The function call always returns immediately.
3421+ *
3422+ * @param buffers One or more buffers into which the data will be received.
3423+ * Although the buffers object may be copied as necessary, ownership of the
3424+ * underlying memory blocks is retained by the caller, which must guarantee
3425+ * that they remain valid until the handler is called.
3426+ *
3427+ * @param flags Flags specifying how the receive call is to be made.
3428+ *
3429+ * @param handler The handler to be called when the receive operation
3430+ * completes. Copies will be made of the handler as required. The function
3431+ * signature of the handler must be:
3432+ * @code void handler(
3433+ * const asio::error_code& error, // Result of operation.
3434+ * std::size_t bytes_transferred // Number of bytes received.
3435+ * ); @endcode
3436+ * Regardless of whether the asynchronous operation completes immediately or
3437+ * not, the handler will not be invoked from within this function. Invocation
3438+ * of the handler will be performed in a manner equivalent to using
3439+ * asio::io_service::post().
3440+ *
3441+ * @note The async_receive operation can only be used with a connected socket.
3442+ * Use the async_receive_from function to receive data on an unconnected
3443+ * raw socket.
3444+ */
3445+ template <typename MutableBufferSequence, typename ReadHandler>
3446+ void async_receive(const MutableBufferSequence& buffers,
3447+ socket_base::message_flags flags, ReadHandler handler)
3448+ {
3449+ this->service.async_receive(this->implementation, buffers, flags, handler);
3450+ }
3451+
3452+ /// Receive raw data with the endpoint of the sender.
3453+ /**
3454+ * This function is used to receive raw data. The function call will block
3455+ * until data has been received successfully or an error occurs.
3456+ *
3457+ * @param buffers One or more buffers into which the data will be received.
3458+ *
3459+ * @param sender_endpoint An endpoint object that receives the endpoint of
3460+ * the remote sender of the data.
3461+ *
3462+ * @returns The number of bytes received.
3463+ *
3464+ * @throws asio::system_error Thrown on failure.
3465+ *
3466+ * @par Example
3467+ * To receive into a single data buffer use the @ref buffer function as
3468+ * follows:
3469+ * @code
3470+ * asio::ip::udp::endpoint sender_endpoint;
3471+ * socket.receive_from(
3472+ * asio::buffer(data, size), sender_endpoint);
3473+ * @endcode
3474+ * See the @ref buffer documentation for information on receiving into
3475+ * multiple buffers in one go, and how to use it with arrays, boost::array or
3476+ * std::vector.
3477+ */
3478+ template <typename MutableBufferSequence>
3479+ std::size_t receive_from(const MutableBufferSequence& buffers,
3480+ endpoint_type& sender_endpoint)
3481+ {
3482+ asio::error_code ec;
3483+ std::size_t s = this->service.receive_from(
3484+ this->implementation, buffers, sender_endpoint, 0, ec);
3485+ asio::detail::throw_error(ec);
3486+ return s;
3487+ }
3488+
3489+ /// Receive raw data with the endpoint of the sender.
3490+ /**
3491+ * This function is used to receive raw data. The function call will block
3492+ * until data has been received successfully or an error occurs.
3493+ *
3494+ * @param buffers One or more buffers into which the data will be received.
3495+ *
3496+ * @param sender_endpoint An endpoint object that receives the endpoint of
3497+ * the remote sender of the data.
3498+ *
3499+ * @param flags Flags specifying how the receive call is to be made.
3500+ *
3501+ * @returns The number of bytes received.
3502+ *
3503+ * @throws asio::system_error Thrown on failure.
3504+ */
3505+ template <typename MutableBufferSequence>
3506+ std::size_t receive_from(const MutableBufferSequence& buffers,
3507+ endpoint_type& sender_endpoint, socket_base::message_flags flags)
3508+ {
3509+ asio::error_code ec;
3510+ std::size_t s = this->service.receive_from(
3511+ this->implementation, buffers, sender_endpoint, flags, ec);
3512+ asio::detail::throw_error(ec);
3513+ return s;
3514+ }
3515+
3516+ /// Receive raw data with the endpoint of the sender.
3517+ /**
3518+ * This function is used to receive raw data. The function call will block
3519+ * until data has been received successfully or an error occurs.
3520+ *
3521+ * @param buffers One or more buffers into which the data will be received.
3522+ *
3523+ * @param sender_endpoint An endpoint object that receives the endpoint of
3524+ * the remote sender of the data.
3525+ *
3526+ * @param flags Flags specifying how the receive call is to be made.
3527+ *
3528+ * @param ec Set to indicate what error occurred, if any.
3529+ *
3530+ * @returns The number of bytes received.
3531+ */
3532+ template <typename MutableBufferSequence>
3533+ std::size_t receive_from(const MutableBufferSequence& buffers,
3534+ endpoint_type& sender_endpoint, socket_base::message_flags flags,
3535+ asio::error_code& ec)
3536+ {
3537+ return this->service.receive_from(this->implementation, buffers,
3538+ sender_endpoint, flags, ec);
3539+ }
3540+
3541+ /// Start an asynchronous receive.
3542+ /**
3543+ * This function is used to asynchronously receive raw data. The function
3544+ * call always returns immediately.
3545+ *
3546+ * @param buffers One or more buffers into which the data will be received.
3547+ * Although the buffers object may be copied as necessary, ownership of the
3548+ * underlying memory blocks is retained by the caller, which must guarantee
3549+ * that they remain valid until the handler is called.
3550+ *
3551+ * @param sender_endpoint An endpoint object that receives the endpoint of
3552+ * the remote sender of the data. Ownership of the sender_endpoint object
3553+ * is retained by the caller, which must guarantee that it is valid until the
3554+ * handler is called.
3555+ *
3556+ * @param handler The handler to be called when the receive operation
3557+ * completes. Copies will be made of the handler as required. The function
3558+ * signature of the handler must be:
3559+ * @code void handler(
3560+ * const asio::error_code& error, // Result of operation.
3561+ * std::size_t bytes_transferred // Number of bytes received.
3562+ * ); @endcode
3563+ * Regardless of whether the asynchronous operation completes immediately or
3564+ * not, the handler will not be invoked from within this function. Invocation
3565+ * of the handler will be performed in a manner equivalent to using
3566+ * asio::io_service::post().
3567+ *
3568+ * @par Example
3569+ * To receive into a single data buffer use the @ref buffer function as
3570+ * follows:
3571+ * @code socket.async_receive_from(
3572+ * asio::buffer(data, size), 0, sender_endpoint, handler); @endcode
3573+ * See the @ref buffer documentation for information on receiving into
3574+ * multiple buffers in one go, and how to use it with arrays, boost::array or
3575+ * std::vector.
3576+ */
3577+ template <typename MutableBufferSequence, typename ReadHandler>
3578+ void async_receive_from(const MutableBufferSequence& buffers,
3579+ endpoint_type& sender_endpoint, ReadHandler handler)
3580+ {
3581+ this->service.async_receive_from(this->implementation, buffers,
3582+ sender_endpoint, 0, handler);
3583+ }
3584+
3585+ /// Start an asynchronous receive.
3586+ /**
3587+ * This function is used to asynchronously receive raw data. The function
3588+ * call always returns immediately.
3589+ *
3590+ * @param buffers One or more buffers into which the data will be received.
3591+ * Although the buffers object may be copied as necessary, ownership of the
3592+ * underlying memory blocks is retained by the caller, which must guarantee
3593+ * that they remain valid until the handler is called.
3594+ *
3595+ * @param sender_endpoint An endpoint object that receives the endpoint of
3596+ * the remote sender of the data. Ownership of the sender_endpoint object
3597+ * is retained by the caller, which must guarantee that it is valid until the
3598+ * handler is called.
3599+ *
3600+ * @param flags Flags specifying how the receive call is to be made.
3601+ *
3602+ * @param handler The handler to be called when the receive operation
3603+ * completes. Copies will be made of the handler as required. The function
3604+ * signature of the handler must be:
3605+ * @code void handler(
3606+ * const asio::error_code& error, // Result of operation.
3607+ * std::size_t bytes_transferred // Number of bytes received.
3608+ * ); @endcode
3609+ * Regardless of whether the asynchronous operation completes immediately or
3610+ * not, the handler will not be invoked from within this function. Invocation
3611+ * of the handler will be performed in a manner equivalent to using
3612+ * asio::io_service::post().
3613+ */
3614+ template <typename MutableBufferSequence, typename ReadHandler>
3615+ void async_receive_from(const MutableBufferSequence& buffers,
3616+ endpoint_type& sender_endpoint, socket_base::message_flags flags,
3617+ ReadHandler handler)
3618+ {
3619+ this->service.async_receive_from(this->implementation, buffers,
3620+ sender_endpoint, flags, handler);
3621+ }
3622+};
3623+
3624+} // namespace asio
3625+
3626+#include "asio/detail/pop_options.hpp"
3627+
3628+#endif // ASIO_BASIC_RAW_SOCKET_HPP
3629
3630=== added file 'asio/asio/basic_serial_port.hpp'
3631--- asio/asio/basic_serial_port.hpp 1970-01-01 00:00:00 +0000
3632+++ asio/asio/basic_serial_port.hpp 2013-11-06 15:11:01 +0000
3633@@ -0,0 +1,620 @@
3634+//
3635+// basic_serial_port.hpp
3636+// ~~~~~~~~~~~~~~~~~~~~~
3637+//
3638+// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
3639+// Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com)
3640+//
3641+// Distributed under the Boost Software License, Version 1.0. (See accompanying
3642+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
3643+//
3644+
3645+#ifndef ASIO_BASIC_SERIAL_PORT_HPP
3646+#define ASIO_BASIC_SERIAL_PORT_HPP
3647+
3648+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
3649+# pragma once
3650+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
3651+
3652+#include "asio/detail/config.hpp"
3653+
3654+#if defined(ASIO_HAS_SERIAL_PORT) \
3655+ || defined(GENERATING_DOCUMENTATION)
3656+
3657+#include <string>
3658+#include "asio/basic_io_object.hpp"
3659+#include "asio/detail/throw_error.hpp"
3660+#include "asio/error.hpp"
3661+#include "asio/serial_port_base.hpp"
3662+#include "asio/serial_port_service.hpp"
3663+
3664+#include "asio/detail/push_options.hpp"
3665+
3666+namespace asio {
3667+
3668+/// Provides serial port functionality.
3669+/**
3670+ * The basic_serial_port class template provides functionality that is common
3671+ * to all serial ports.
3672+ *
3673+ * @par Thread Safety
3674+ * @e Distinct @e objects: Safe.@n
3675+ * @e Shared @e objects: Unsafe.
3676+ */
3677+template <typename SerialPortService = serial_port_service>
3678+class basic_serial_port
3679+ : public basic_io_object<SerialPortService>,
3680+ public serial_port_base
3681+{
3682+public:
3683+ /// The native representation of a serial port.
3684+ typedef typename SerialPortService::native_type native_type;
3685+
3686+ /// A basic_serial_port is always the lowest layer.
3687+ typedef basic_serial_port<SerialPortService> lowest_layer_type;
3688+
3689+ /// Construct a basic_serial_port without opening it.
3690+ /**
3691+ * This constructor creates a serial port without opening it.
3692+ *
3693+ * @param io_service The io_service object that the serial port will use to
3694+ * dispatch handlers for any asynchronous operations performed on the port.
3695+ */
3696+ explicit basic_serial_port(asio::io_service& io_service)
3697+ : basic_io_object<SerialPortService>(io_service)
3698+ {
3699+ }
3700+
3701+ /// Construct and open a basic_serial_port.
3702+ /**
3703+ * This constructor creates and opens a serial port for the specified device
3704+ * name.
3705+ *
3706+ * @param io_service The io_service object that the serial port will use to
3707+ * dispatch handlers for any asynchronous operations performed on the port.
3708+ *
3709+ * @param device The platform-specific device name for this serial
3710+ * port.
3711+ */
3712+ explicit basic_serial_port(asio::io_service& io_service,
3713+ const char* device)
3714+ : basic_io_object<SerialPortService>(io_service)
3715+ {
3716+ asio::error_code ec;
3717+ this->service.open(this->implementation, device, ec);
3718+ asio::detail::throw_error(ec);
3719+ }
3720+
3721+ /// Construct and open a basic_serial_port.
3722+ /**
3723+ * This constructor creates and opens a serial port for the specified device
3724+ * name.
3725+ *
3726+ * @param io_service The io_service object that the serial port will use to
3727+ * dispatch handlers for any asynchronous operations performed on the port.
3728+ *
3729+ * @param device The platform-specific device name for this serial
3730+ * port.
3731+ */
3732+ explicit basic_serial_port(asio::io_service& io_service,
3733+ const std::string& device)
3734+ : basic_io_object<SerialPortService>(io_service)
3735+ {
3736+ asio::error_code ec;
3737+ this->service.open(this->implementation, device, ec);
3738+ asio::detail::throw_error(ec);
3739+ }
3740+
3741+ /// Construct a basic_serial_port on an existing native serial port.
3742+ /**
3743+ * This constructor creates a serial port object to hold an existing native
3744+ * serial port.
3745+ *
3746+ * @param io_service The io_service object that the serial port will use to
3747+ * dispatch handlers for any asynchronous operations performed on the port.
3748+ *
3749+ * @param native_serial_port A native serial port.
3750+ *
3751+ * @throws asio::system_error Thrown on failure.
3752+ */
3753+ basic_serial_port(asio::io_service& io_service,
3754+ const native_type& native_serial_port)
3755+ : basic_io_object<SerialPortService>(io_service)
3756+ {
3757+ asio::error_code ec;
3758+ this->service.assign(this->implementation, native_serial_port, ec);
3759+ asio::detail::throw_error(ec);
3760+ }
3761+
3762+ /// Get a reference to the lowest layer.
3763+ /**
3764+ * This function returns a reference to the lowest layer in a stack of
3765+ * layers. Since a basic_serial_port cannot contain any further layers, it
3766+ * simply returns a reference to itself.
3767+ *
3768+ * @return A reference to the lowest layer in the stack of layers. Ownership
3769+ * is not transferred to the caller.
3770+ */
3771+ lowest_layer_type& lowest_layer()
3772+ {
3773+ return *this;
3774+ }
3775+
3776+ /// Get a const reference to the lowest layer.
3777+ /**
3778+ * This function returns a const reference to the lowest layer in a stack of
3779+ * layers. Since a basic_serial_port cannot contain any further layers, it
3780+ * simply returns a reference to itself.
3781+ *
3782+ * @return A const reference to the lowest layer in the stack of layers.
3783+ * Ownership is not transferred to the caller.
3784+ */
3785+ const lowest_layer_type& lowest_layer() const
3786+ {
3787+ return *this;
3788+ }
3789+
3790+ /// Open the serial port using the specified device name.
3791+ /**
3792+ * This function opens the serial port for the specified device name.
3793+ *
3794+ * @param device The platform-specific device name.
3795+ *
3796+ * @throws asio::system_error Thrown on failure.
3797+ */
3798+ void open(const std::string& device)
3799+ {
3800+ asio::error_code ec;
3801+ this->service.open(this->implementation, device, ec);
3802+ asio::detail::throw_error(ec);
3803+ }
3804+
3805+ /// Open the serial port using the specified device name.
3806+ /**
3807+ * This function opens the serial port using the given platform-specific
3808+ * device name.
3809+ *
3810+ * @param device The platform-specific device name.
3811+ *
3812+ * @param ec Set the indicate what error occurred, if any.
3813+ */
3814+ asio::error_code open(const std::string& device,
3815+ asio::error_code& ec)
3816+ {
3817+ return this->service.open(this->implementation, device, ec);
3818+ }
3819+
3820+ /// Assign an existing native serial port to the serial port.
3821+ /*
3822+ * This function opens the serial port to hold an existing native serial port.
3823+ *
3824+ * @param native_serial_port A native serial port.
3825+ *
3826+ * @throws asio::system_error Thrown on failure.
3827+ */
3828+ void assign(const native_type& native_serial_port)
3829+ {
3830+ asio::error_code ec;
3831+ this->service.assign(this->implementation, native_serial_port, ec);
3832+ asio::detail::throw_error(ec);
3833+ }
3834+
3835+ /// Assign an existing native serial port to the serial port.
3836+ /*
3837+ * This function opens the serial port to hold an existing native serial port.
3838+ *
3839+ * @param native_serial_port A native serial port.
3840+ *
3841+ * @param ec Set to indicate what error occurred, if any.
3842+ */
3843+ asio::error_code assign(const native_type& native_serial_port,
3844+ asio::error_code& ec)
3845+ {
3846+ return this->service.assign(this->implementation, native_serial_port, ec);
3847+ }
3848+
3849+ /// Determine whether the serial port is open.
3850+ bool is_open() const
3851+ {
3852+ return this->service.is_open(this->implementation);
3853+ }
3854+
3855+ /// Close the serial port.
3856+ /**
3857+ * This function is used to close the serial port. Any asynchronous read or
3858+ * write operations will be cancelled immediately, and will complete with the
3859+ * asio::error::operation_aborted error.
3860+ *
3861+ * @throws asio::system_error Thrown on failure.
3862+ */
3863+ void close()
3864+ {
3865+ asio::error_code ec;
3866+ this->service.close(this->implementation, ec);
3867+ asio::detail::throw_error(ec);
3868+ }
3869+
3870+ /// Close the serial port.
3871+ /**
3872+ * This function is used to close the serial port. Any asynchronous read or
3873+ * write operations will be cancelled immediately, and will complete with the
3874+ * asio::error::operation_aborted error.
3875+ *
3876+ * @param ec Set to indicate what error occurred, if any.
3877+ */
3878+ asio::error_code close(asio::error_code& ec)
3879+ {
3880+ return this->service.close(this->implementation, ec);
3881+ }
3882+
3883+ /// Get the native serial port representation.
3884+ /**
3885+ * This function may be used to obtain the underlying representation of the
3886+ * serial port. This is intended to allow access to native serial port
3887+ * functionality that is not otherwise provided.
3888+ */
3889+ native_type native()
3890+ {
3891+ return this->service.native(this->implementation);
3892+ }
3893+
3894+ /// Cancel all asynchronous operations associated with the serial port.
3895+ /**
3896+ * This function causes all outstanding asynchronous read or write operations
3897+ * to finish immediately, and the handlers for cancelled operations will be
3898+ * passed the asio::error::operation_aborted error.
3899+ *
3900+ * @throws asio::system_error Thrown on failure.
3901+ */
3902+ void cancel()
3903+ {
3904+ asio::error_code ec;
3905+ this->service.cancel(this->implementation, ec);
3906+ asio::detail::throw_error(ec);
3907+ }
3908+
3909+ /// Cancel all asynchronous operations associated with the serial port.
3910+ /**
3911+ * This function causes all outstanding asynchronous read or write operations
3912+ * to finish immediately, and the handlers for cancelled operations will be
3913+ * passed the asio::error::operation_aborted error.
3914+ *
3915+ * @param ec Set to indicate what error occurred, if any.
3916+ */
3917+ asio::error_code cancel(asio::error_code& ec)
3918+ {
3919+ return this->service.cancel(this->implementation, ec);
3920+ }
3921+
3922+ /// Send a break sequence to the serial port.
3923+ /**
3924+ * This function causes a break sequence of platform-specific duration to be
3925+ * sent out the serial port.
3926+ *
3927+ * @throws asio::system_error Thrown on failure.
3928+ */
3929+ void send_break()
3930+ {
3931+ asio::error_code ec;
3932+ this->service.send_break(this->implementation, ec);
3933+ asio::detail::throw_error(ec);
3934+ }
3935+
3936+ /// Send a break sequence to the serial port.
3937+ /**
3938+ * This function causes a break sequence of platform-specific duration to be
3939+ * sent out the serial port.
3940+ *
3941+ * @param ec Set to indicate what error occurred, if any.
3942+ */
3943+ asio::error_code send_break(asio::error_code& ec)
3944+ {
3945+ return this->service.send_break(this->implementation, ec);
3946+ }
3947+
3948+ /// Set an option on the serial port.
3949+ /**
3950+ * This function is used to set an option on the serial port.
3951+ *
3952+ * @param option The option value to be set on the serial port.
3953+ *
3954+ * @throws asio::system_error Thrown on failure.
3955+ *
3956+ * @sa SettableSerialPortOption @n
3957+ * asio::serial_port_base::baud_rate @n
3958+ * asio::serial_port_base::flow_control @n
3959+ * asio::serial_port_base::parity @n
3960+ * asio::serial_port_base::stop_bits @n
3961+ * asio::serial_port_base::character_size
3962+ */
3963+ template <typename SettableSerialPortOption>
3964+ void set_option(const SettableSerialPortOption& option)
3965+ {
3966+ asio::error_code ec;
3967+ this->service.set_option(this->implementation, option, ec);
3968+ asio::detail::throw_error(ec);
3969+ }
3970+
3971+ /// Set an option on the serial port.
3972+ /**
3973+ * This function is used to set an option on the serial port.
3974+ *
3975+ * @param option The option value to be set on the serial port.
3976+ *
3977+ * @param ec Set to indicate what error occurred, if any.
3978+ *
3979+ * @sa SettableSerialPortOption @n
3980+ * asio::serial_port_base::baud_rate @n
3981+ * asio::serial_port_base::flow_control @n
3982+ * asio::serial_port_base::parity @n
3983+ * asio::serial_port_base::stop_bits @n
3984+ * asio::serial_port_base::character_size
3985+ */
3986+ template <typename SettableSerialPortOption>
3987+ asio::error_code set_option(const SettableSerialPortOption& option,
3988+ asio::error_code& ec)
3989+ {
3990+ return this->service.set_option(this->implementation, option, ec);
3991+ }
3992+
3993+ /// Get an option from the serial port.
3994+ /**
3995+ * This function is used to get the current value of an option on the serial
3996+ * port.
3997+ *
3998+ * @param option The option value to be obtained from the serial port.
3999+ *
4000+ * @throws asio::system_error Thrown on failure.
4001+ *
4002+ * @sa GettableSerialPortOption @n
4003+ * asio::serial_port_base::baud_rate @n
4004+ * asio::serial_port_base::flow_control @n
4005+ * asio::serial_port_base::parity @n
4006+ * asio::serial_port_base::stop_bits @n
4007+ * asio::serial_port_base::character_size
4008+ */
4009+ template <typename GettableSerialPortOption>
4010+ void get_option(GettableSerialPortOption& option)
4011+ {
4012+ asio::error_code ec;
4013+ this->service.get_option(this->implementation, option, ec);
4014+ asio::detail::throw_error(ec);
4015+ }
4016+
4017+ /// Get an option from the serial port.
4018+ /**
4019+ * This function is used to get the current value of an option on the serial
4020+ * port.
4021+ *
4022+ * @param option The option value to be obtained from the serial port.
4023+ *
4024+ * @param ec Set to indicate what error occured, if any.
4025+ *
4026+ * @sa GettableSerialPortOption @n
4027+ * asio::serial_port_base::baud_rate @n
4028+ * asio::serial_port_base::flow_control @n
4029+ * asio::serial_port_base::parity @n
4030+ * asio::serial_port_base::stop_bits @n
4031+ * asio::serial_port_base::character_size
4032+ */
4033+ template <typename GettableSerialPortOption>
4034+ asio::error_code get_option(GettableSerialPortOption& option,
4035+ asio::error_code& ec)
4036+ {
4037+ return this->service.get_option(this->implementation, option, ec);
4038+ }
4039+
4040+ /// Write some data to the serial port.
4041+ /**
4042+ * This function is used to write data to the serial port. The function call
4043+ * will block until one or more bytes of the data has been written
4044+ * successfully, or until an error occurs.
4045+ *
4046+ * @param buffers One or more data buffers to be written to the serial port.
4047+ *
4048+ * @returns The number of bytes written.
4049+ *
4050+ * @throws asio::system_error Thrown on failure. An error code of
4051+ * asio::error::eof indicates that the connection was closed by the
4052+ * peer.
4053+ *
4054+ * @note The write_some operation may not transmit all of the data to the
4055+ * peer. Consider using the @ref write function if you need to ensure that
4056+ * all data is written before the blocking operation completes.
4057+ *
4058+ * @par Example
4059+ * To write a single data buffer use the @ref buffer function as follows:
4060+ * @code
4061+ * serial_port.write_some(asio::buffer(data, size));
4062+ * @endcode
4063+ * See the @ref buffer documentation for information on writing multiple
4064+ * buffers in one go, and how to use it with arrays, boost::array or
4065+ * std::vector.
4066+ */
4067+ template <typename ConstBufferSequence>
4068+ std::size_t write_some(const ConstBufferSequence& buffers)
4069+ {
4070+ asio::error_code ec;
4071+ std::size_t s = this->service.write_some(this->implementation, buffers, ec);
4072+ asio::detail::throw_error(ec);
4073+ return s;
4074+ }
4075+
4076+ /// Write some data to the serial port.
4077+ /**
4078+ * This function is used to write data to the serial port. The function call
4079+ * will block until one or more bytes of the data has been written
4080+ * successfully, or until an error occurs.
4081+ *
4082+ * @param buffers One or more data buffers to be written to the serial port.
4083+ *
4084+ * @param ec Set to indicate what error occurred, if any.
4085+ *
4086+ * @returns The number of bytes written. Returns 0 if an error occurred.
4087+ *
4088+ * @note The write_some operation may not transmit all of the data to the
4089+ * peer. Consider using the @ref write function if you need to ensure that
4090+ * all data is written before the blocking operation completes.
4091+ */
4092+ template <typename ConstBufferSequence>
4093+ std::size_t write_some(const ConstBufferSequence& buffers,
4094+ asio::error_code& ec)
4095+ {
4096+ return this->service.write_some(this->implementation, buffers, ec);
4097+ }
4098+
4099+ /// Start an asynchronous write.
4100+ /**
4101+ * This function is used to asynchronously write data to the serial port.
4102+ * The function call always returns immediately.
4103+ *
4104+ * @param buffers One or more data buffers to be written to the serial port.
4105+ * Although the buffers object may be copied as necessary, ownership of the
4106+ * underlying memory blocks is retained by the caller, which must guarantee
4107+ * that they remain valid until the handler is called.
4108+ *
4109+ * @param handler The handler to be called when the write operation completes.
4110+ * Copies will be made of the handler as required. The function signature of
4111+ * the handler must be:
4112+ * @code void handler(
4113+ * const asio::error_code& error, // Result of operation.
4114+ * std::size_t bytes_transferred // Number of bytes written.
4115+ * ); @endcode
4116+ * Regardless of whether the asynchronous operation completes immediately or
4117+ * not, the handler will not be invoked from within this function. Invocation
4118+ * of the handler will be performed in a manner equivalent to using
4119+ * asio::io_service::post().
4120+ *
4121+ * @note The write operation may not transmit all of the data to the peer.
4122+ * Consider using the @ref async_write function if you need to ensure that all
4123+ * data is written before the asynchronous operation completes.
4124+ *
4125+ * @par Example
4126+ * To write a single data buffer use the @ref buffer function as follows:
4127+ * @code
4128+ * serial_port.async_write_some(asio::buffer(data, size), handler);
4129+ * @endcode
4130+ * See the @ref buffer documentation for information on writing multiple
4131+ * buffers in one go, and how to use it with arrays, boost::array or
4132+ * std::vector.
4133+ */
4134+ template <typename ConstBufferSequence, typename WriteHandler>
4135+ void async_write_some(const ConstBufferSequence& buffers,
4136+ WriteHandler handler)
4137+ {
4138+ this->service.async_write_some(this->implementation, buffers, handler);
4139+ }
4140+
4141+ /// Read some data from the serial port.
4142+ /**
4143+ * This function is used to read data from the serial port. The function
4144+ * call will block until one or more bytes of data has been read successfully,
4145+ * or until an error occurs.
4146+ *
4147+ * @param buffers One or more buffers into which the data will be read.
4148+ *
4149+ * @returns The number of bytes read.
4150+ *
4151+ * @throws asio::system_error Thrown on failure. An error code of
4152+ * asio::error::eof indicates that the connection was closed by the
4153+ * peer.
4154+ *
4155+ * @note The read_some operation may not read all of the requested number of
4156+ * bytes. Consider using the @ref read function if you need to ensure that
4157+ * the requested amount of data is read before the blocking operation
4158+ * completes.
4159+ *
4160+ * @par Example
4161+ * To read into a single data buffer use the @ref buffer function as follows:
4162+ * @code
4163+ * serial_port.read_some(asio::buffer(data, size));
4164+ * @endcode
4165+ * See the @ref buffer documentation for information on reading into multiple
4166+ * buffers in one go, and how to use it with arrays, boost::array or
4167+ * std::vector.
4168+ */
4169+ template <typename MutableBufferSequence>
4170+ std::size_t read_some(const MutableBufferSequence& buffers)
4171+ {
4172+ asio::error_code ec;
4173+ std::size_t s = this->service.read_some(this->implementation, buffers, ec);
4174+ asio::detail::throw_error(ec);
4175+ return s;
4176+ }
4177+
4178+ /// Read some data from the serial port.
4179+ /**
4180+ * This function is used to read data from the serial port. The function
4181+ * call will block until one or more bytes of data has been read successfully,
4182+ * or until an error occurs.
4183+ *
4184+ * @param buffers One or more buffers into which the data will be read.
4185+ *
4186+ * @param ec Set to indicate what error occurred, if any.
4187+ *
4188+ * @returns The number of bytes read. Returns 0 if an error occurred.
4189+ *
4190+ * @note The read_some operation may not read all of the requested number of
4191+ * bytes. Consider using the @ref read function if you need to ensure that
4192+ * the requested amount of data is read before the blocking operation
4193+ * completes.
4194+ */
4195+ template <typename MutableBufferSequence>
4196+ std::size_t read_some(const MutableBufferSequence& buffers,
4197+ asio::error_code& ec)
4198+ {
4199+ return this->service.read_some(this->implementation, buffers, ec);
4200+ }
4201+
4202+ /// Start an asynchronous read.
4203+ /**
4204+ * This function is used to asynchronously read data from the serial port.
4205+ * The function call always returns immediately.
4206+ *
4207+ * @param buffers One or more buffers into which the data will be read.
4208+ * Although the buffers object may be copied as necessary, ownership of the
4209+ * underlying memory blocks is retained by the caller, which must guarantee
4210+ * that they remain valid until the handler is called.
4211+ *
4212+ * @param handler The handler to be called when the read operation completes.
4213+ * Copies will be made of the handler as required. The function signature of
4214+ * the handler must be:
4215+ * @code void handler(
4216+ * const asio::error_code& error, // Result of operation.
4217+ * std::size_t bytes_transferred // Number of bytes read.
4218+ * ); @endcode
4219+ * Regardless of whether the asynchronous operation completes immediately or
4220+ * not, the handler will not be invoked from within this function. Invocation
4221+ * of the handler will be performed in a manner equivalent to using
4222+ * asio::io_service::post().
4223+ *
4224+ * @note The read operation may not read all of the requested number of bytes.
4225+ * Consider using the @ref async_read function if you need to ensure that the
4226+ * requested amount of data is read before the asynchronous operation
4227+ * completes.
4228+ *
4229+ * @par Example
4230+ * To read into a single data buffer use the @ref buffer function as follows:
4231+ * @code
4232+ * serial_port.async_read_some(asio::buffer(data, size), handler);
4233+ * @endcode
4234+ * See the @ref buffer documentation for information on reading into multiple
4235+ * buffers in one go, and how to use it with arrays, boost::array or
4236+ * std::vector.
4237+ */
4238+ template <typename MutableBufferSequence, typename ReadHandler>
4239+ void async_read_some(const MutableBufferSequence& buffers,
4240+ ReadHandler handler)
4241+ {
4242+ this->service.async_read_some(this->implementation, buffers, handler);
4243+ }
4244+};
4245+
4246+} // namespace asio
4247+
4248+#include "asio/detail/pop_options.hpp"
4249+
4250+#endif // defined(ASIO_HAS_SERIAL_PORT)
4251+ // || defined(GENERATING_DOCUMENTATION)
4252+
4253+#endif // ASIO_BASIC_SERIAL_PORT_HPP
4254
4255=== added file 'asio/asio/basic_socket.hpp'
4256--- asio/asio/basic_socket.hpp 1970-01-01 00:00:00 +0000
4257+++ asio/asio/basic_socket.hpp 2013-11-06 15:11:01 +0000
4258@@ -0,0 +1,1060 @@
4259+//
4260+// basic_socket.hpp
4261+// ~~~~~~~~~~~~~~~~
4262+//
4263+// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
4264+//
4265+// Distributed under the Boost Software License, Version 1.0. (See accompanying
4266+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
4267+//
4268+
4269+#ifndef ASIO_BASIC_SOCKET_HPP
4270+#define ASIO_BASIC_SOCKET_HPP
4271+
4272+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
4273+# pragma once
4274+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
4275+
4276+#include "asio/detail/config.hpp"
4277+#include "asio/basic_io_object.hpp"
4278+#include "asio/detail/throw_error.hpp"
4279+#include "asio/error.hpp"
4280+#include "asio/socket_base.hpp"
4281+
4282+#include "asio/detail/push_options.hpp"
4283+
4284+namespace asio {
4285+
4286+/// Provides socket functionality.
4287+/**
4288+ * The basic_socket class template provides functionality that is common to both
4289+ * stream-oriented and datagram-oriented sockets.
4290+ *
4291+ * @par Thread Safety
4292+ * @e Distinct @e objects: Safe.@n
4293+ * @e Shared @e objects: Unsafe.
4294+ */
4295+template <typename Protocol, typename SocketService>
4296+class basic_socket
4297+ : public basic_io_object<SocketService>,
4298+ public socket_base
4299+{
4300+public:
4301+ /// The native representation of a socket.
4302+ typedef typename SocketService::native_type native_type;
4303+
4304+ /// The protocol type.
4305+ typedef Protocol protocol_type;
4306+
4307+ /// The endpoint type.
4308+ typedef typename Protocol::endpoint endpoint_type;
4309+
4310+ /// A basic_socket is always the lowest layer.
4311+ typedef basic_socket<Protocol, SocketService> lowest_layer_type;
4312+
4313+ /// Construct a basic_socket without opening it.
4314+ /**
4315+ * This constructor creates a socket without opening it.
4316+ *
4317+ * @param io_service The io_service object that the socket will use to
4318+ * dispatch handlers for any asynchronous operations performed on the socket.
4319+ */
4320+ explicit basic_socket(asio::io_service& io_service)
4321+ : basic_io_object<SocketService>(io_service)
4322+ {
4323+ }
4324+
4325+ /// Construct and open a basic_socket.
4326+ /**
4327+ * This constructor creates and opens a socket.
4328+ *
4329+ * @param io_service The io_service object that the socket will use to
4330+ * dispatch handlers for any asynchronous operations performed on the socket.
4331+ *
4332+ * @param protocol An object specifying protocol parameters to be used.
4333+ *
4334+ * @throws asio::system_error Thrown on failure.
4335+ */
4336+ basic_socket(asio::io_service& io_service,
4337+ const protocol_type& protocol)
4338+ : basic_io_object<SocketService>(io_service)
4339+ {
4340+ asio::error_code ec;
4341+ this->service.open(this->implementation, protocol, ec);
4342+ asio::detail::throw_error(ec);
4343+ }
4344+
4345+ /// Construct a basic_socket, opening it and binding it to the given local
4346+ /// endpoint.
4347+ /**
4348+ * This constructor creates a socket and automatically opens it bound to the
4349+ * specified endpoint on the local machine. The protocol used is the protocol
4350+ * associated with the given endpoint.
4351+ *
4352+ * @param io_service The io_service object that the socket will use to
4353+ * dispatch handlers for any asynchronous operations performed on the socket.
4354+ *
4355+ * @param endpoint An endpoint on the local machine to which the socket will
4356+ * be bound.
4357+ *
4358+ * @throws asio::system_error Thrown on failure.
4359+ */
4360+ basic_socket(asio::io_service& io_service,
4361+ const endpoint_type& endpoint)
4362+ : basic_io_object<SocketService>(io_service)
4363+ {
4364+ asio::error_code ec;
4365+ this->service.open(this->implementation, endpoint.protocol(), ec);
4366+ asio::detail::throw_error(ec);
4367+ this->service.bind(this->implementation, endpoint, ec);
4368+ asio::detail::throw_error(ec);
4369+ }
4370+
4371+ /// Construct a basic_socket on an existing native socket.
4372+ /**
4373+ * This constructor creates a socket object to hold an existing native socket.
4374+ *
4375+ * @param io_service The io_service object that the socket will use to
4376+ * dispatch handlers for any asynchronous operations performed on the socket.
4377+ *
4378+ * @param protocol An object specifying protocol parameters to be used.
4379+ *
4380+ * @param native_socket A native socket.
4381+ *
4382+ * @throws asio::system_error Thrown on failure.
4383+ */
4384+ basic_socket(asio::io_service& io_service,
4385+ const protocol_type& protocol, const native_type& native_socket)
4386+ : basic_io_object<SocketService>(io_service)
4387+ {
4388+ asio::error_code ec;
4389+ this->service.assign(this->implementation, protocol, native_socket, ec);
4390+ asio::detail::throw_error(ec);
4391+ }
4392+
4393+ /// Get a reference to the lowest layer.
4394+ /**
4395+ * This function returns a reference to the lowest layer in a stack of
4396+ * layers. Since a basic_socket cannot contain any further layers, it simply
4397+ * returns a reference to itself.
4398+ *
4399+ * @return A reference to the lowest layer in the stack of layers. Ownership
4400+ * is not transferred to the caller.
4401+ */
4402+ lowest_layer_type& lowest_layer()
4403+ {
4404+ return *this;
4405+ }
4406+
4407+ /// Get a const reference to the lowest layer.
4408+ /**
4409+ * This function returns a const reference to the lowest layer in a stack of
4410+ * layers. Since a basic_socket cannot contain any further layers, it simply
4411+ * returns a reference to itself.
4412+ *
4413+ * @return A const reference to the lowest layer in the stack of layers.
4414+ * Ownership is not transferred to the caller.
4415+ */
4416+ const lowest_layer_type& lowest_layer() const
4417+ {
4418+ return *this;
4419+ }
4420+
4421+ /// Open the socket using the specified protocol.
4422+ /**
4423+ * This function opens the socket so that it will use the specified protocol.
4424+ *
4425+ * @param protocol An object specifying protocol parameters to be used.
4426+ *
4427+ * @throws asio::system_error Thrown on failure.
4428+ *
4429+ * @par Example
4430+ * @code
4431+ * asio::ip::tcp::socket socket(io_service);
4432+ * socket.open(asio::ip::tcp::v4());
4433+ * @endcode
4434+ */
4435+ void open(const protocol_type& protocol = protocol_type())
4436+ {
4437+ asio::error_code ec;
4438+ this->service.open(this->implementation, protocol, ec);
4439+ asio::detail::throw_error(ec);
4440+ }
4441+
4442+ /// Open the socket using the specified protocol.
4443+ /**
4444+ * This function opens the socket so that it will use the specified protocol.
4445+ *
4446+ * @param protocol An object specifying which protocol is to be used.
4447+ *
4448+ * @param ec Set to indicate what error occurred, if any.
4449+ *
4450+ * @par Example
4451+ * @code
4452+ * asio::ip::tcp::socket socket(io_service);
4453+ * asio::error_code ec;
4454+ * socket.open(asio::ip::tcp::v4(), ec);
4455+ * if (ec)
4456+ * {
4457+ * // An error occurred.
4458+ * }
4459+ * @endcode
4460+ */
4461+ asio::error_code open(const protocol_type& protocol,
4462+ asio::error_code& ec)
4463+ {
4464+ return this->service.open(this->implementation, protocol, ec);
4465+ }
4466+
4467+ /// Assign an existing native socket to the socket.
4468+ /*
4469+ * This function opens the socket to hold an existing native socket.
4470+ *
4471+ * @param protocol An object specifying which protocol is to be used.
4472+ *
4473+ * @param native_socket A native socket.
4474+ *
4475+ * @throws asio::system_error Thrown on failure.
4476+ */
4477+ void assign(const protocol_type& protocol, const native_type& native_socket)
4478+ {
4479+ asio::error_code ec;
4480+ this->service.assign(this->implementation, protocol, native_socket, ec);
4481+ asio::detail::throw_error(ec);
4482+ }
4483+
4484+ /// Assign an existing native socket to the socket.
4485+ /*
4486+ * This function opens the socket to hold an existing native socket.
4487+ *
4488+ * @param protocol An object specifying which protocol is to be used.
4489+ *
4490+ * @param native_socket A native socket.
4491+ *
4492+ * @param ec Set to indicate what error occurred, if any.
4493+ */
4494+ asio::error_code assign(const protocol_type& protocol,
4495+ const native_type& native_socket, asio::error_code& ec)
4496+ {
4497+ return this->service.assign(this->implementation,
4498+ protocol, native_socket, ec);
4499+ }
4500+
4501+ /// Determine whether the socket is open.
4502+ bool is_open() const
4503+ {
4504+ return this->service.is_open(this->implementation);
4505+ }
4506+
4507+ /// Close the socket.
4508+ /**
4509+ * This function is used to close the socket. Any asynchronous send, receive
4510+ * or connect operations will be cancelled immediately, and will complete
4511+ * with the asio::error::operation_aborted error.
4512+ *
4513+ * @throws asio::system_error Thrown on failure.
4514+ *
4515+ * @note For portable behaviour with respect to graceful closure of a
4516+ * connected socket, call shutdown() before closing the socket.
4517+ */
4518+ void close()
4519+ {
4520+ asio::error_code ec;
4521+ this->service.close(this->implementation, ec);
4522+ asio::detail::throw_error(ec);
4523+ }
4524+
4525+ /// Close the socket.
4526+ /**
4527+ * This function is used to close the socket. Any asynchronous send, receive
4528+ * or connect operations will be cancelled immediately, and will complete
4529+ * with the asio::error::operation_aborted error.
4530+ *
4531+ * @param ec Set to indicate what error occurred, if any.
4532+ *
4533+ * @par Example
4534+ * @code
4535+ * asio::ip::tcp::socket socket(io_service);
4536+ * ...
4537+ * asio::error_code ec;
4538+ * socket.close(ec);
4539+ * if (ec)
4540+ * {
4541+ * // An error occurred.
4542+ * }
4543+ * @endcode
4544+ *
4545+ * @note For portable behaviour with respect to graceful closure of a
4546+ * connected socket, call shutdown() before closing the socket.
4547+ */
4548+ asio::error_code close(asio::error_code& ec)
4549+ {
4550+ return this->service.close(this->implementation, ec);
4551+ }
4552+
4553+ /// Get the native socket representation.
4554+ /**
4555+ * This function may be used to obtain the underlying representation of the
4556+ * socket. This is intended to allow access to native socket functionality
4557+ * that is not otherwise provided.
4558+ */
4559+ native_type native()
4560+ {
4561+ return this->service.native(this->implementation);
4562+ }
4563+
4564+ /// Cancel all asynchronous operations associated with the socket.
4565+ /**
4566+ * This function causes all outstanding asynchronous connect, send and receive
4567+ * operations to finish immediately, and the handlers for cancelled operations
4568+ * will be passed the asio::error::operation_aborted error.
4569+ *
4570+ * @throws asio::system_error Thrown on failure.
4571+ *
4572+ * @note Calls to cancel() will always fail with
4573+ * asio::error::operation_not_supported when run on Windows XP, Windows
4574+ * Server 2003, and earlier versions of Windows, unless
4575+ * ASIO_ENABLE_CANCELIO is defined. However, the CancelIo function has
4576+ * two issues that should be considered before enabling its use:
4577+ *
4578+ * @li It will only cancel asynchronous operations that were initiated in the
4579+ * current thread.
4580+ *
4581+ * @li It can appear to complete without error, but the request to cancel the
4582+ * unfinished operations may be silently ignored by the operating system.
4583+ * Whether it works or not seems to depend on the drivers that are installed.
4584+ *
4585+ * For portable cancellation, consider using one of the following
4586+ * alternatives:
4587+ *
4588+ * @li Disable asio's I/O completion port backend by defining
4589+ * ASIO_DISABLE_IOCP.
4590+ *
4591+ * @li Use the close() function to simultaneously cancel the outstanding
4592+ * operations and close the socket.
4593+ *
4594+ * When running on Windows Vista, Windows Server 2008, and later, the
4595+ * CancelIoEx function is always used. This function does not have the
4596+ * problems described above.
4597+ */
4598+#if defined(BOOST_MSVC) && (BOOST_MSVC >= 1400) \
4599+ && (!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600) \
4600+ && !defined(ASIO_ENABLE_CANCELIO)
4601+ __declspec(deprecated("By default, this function always fails with "
4602+ "operation_not_supported when used on Windows XP, Windows Server 2003, "
4603+ "or earlier. Consult documentation for details."))
4604+#endif
4605+ void cancel()
4606+ {
4607+ asio::error_code ec;
4608+ this->service.cancel(this->implementation, ec);
4609+ asio::detail::throw_error(ec);
4610+ }
4611+
4612+ /// Cancel all asynchronous operations associated with the socket.
4613+ /**
4614+ * This function causes all outstanding asynchronous connect, send and receive
4615+ * operations to finish immediately, and the handlers for cancelled operations
4616+ * will be passed the asio::error::operation_aborted error.
4617+ *
4618+ * @param ec Set to indicate what error occurred, if any.
4619+ *
4620+ * @note Calls to cancel() will always fail with
4621+ * asio::error::operation_not_supported when run on Windows XP, Windows
4622+ * Server 2003, and earlier versions of Windows, unless
4623+ * ASIO_ENABLE_CANCELIO is defined. However, the CancelIo function has
4624+ * two issues that should be considered before enabling its use:
4625+ *
4626+ * @li It will only cancel asynchronous operations that were initiated in the
4627+ * current thread.
4628+ *
4629+ * @li It can appear to complete without error, but the request to cancel the
4630+ * unfinished operations may be silently ignored by the operating system.
4631+ * Whether it works or not seems to depend on the drivers that are installed.
4632+ *
4633+ * For portable cancellation, consider using one of the following
4634+ * alternatives:
4635+ *
4636+ * @li Disable asio's I/O completion port backend by defining
4637+ * ASIO_DISABLE_IOCP.
4638+ *
4639+ * @li Use the close() function to simultaneously cancel the outstanding
4640+ * operations and close the socket.
4641+ *
4642+ * When running on Windows Vista, Windows Server 2008, and later, the
4643+ * CancelIoEx function is always used. This function does not have the
4644+ * problems described above.
4645+ */
4646+#if defined(BOOST_MSVC) && (BOOST_MSVC >= 1400) \
4647+ && (!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600) \
4648+ && !defined(ASIO_ENABLE_CANCELIO)
4649+ __declspec(deprecated("By default, this function always fails with "
4650+ "operation_not_supported when used on Windows XP, Windows Server 2003, "
4651+ "or earlier. Consult documentation for details."))
4652+#endif
4653+ asio::error_code cancel(asio::error_code& ec)
4654+ {
4655+ return this->service.cancel(this->implementation, ec);
4656+ }
4657+
4658+ /// Determine whether the socket is at the out-of-band data mark.
4659+ /**
4660+ * This function is used to check whether the socket input is currently
4661+ * positioned at the out-of-band data mark.
4662+ *
4663+ * @return A bool indicating whether the socket is at the out-of-band data
4664+ * mark.
4665+ *
4666+ * @throws asio::system_error Thrown on failure.
4667+ */
4668+ bool at_mark() const
4669+ {
4670+ asio::error_code ec;
4671+ bool b = this->service.at_mark(this->implementation, ec);
4672+ asio::detail::throw_error(ec);
4673+ return b;
4674+ }
4675+
4676+ /// Determine whether the socket is at the out-of-band data mark.
4677+ /**
4678+ * This function is used to check whether the socket input is currently
4679+ * positioned at the out-of-band data mark.
4680+ *
4681+ * @param ec Set to indicate what error occurred, if any.
4682+ *
4683+ * @return A bool indicating whether the socket is at the out-of-band data
4684+ * mark.
4685+ */
4686+ bool at_mark(asio::error_code& ec) const
4687+ {
4688+ return this->service.at_mark(this->implementation, ec);
4689+ }
4690+
4691+ /// Determine the number of bytes available for reading.
4692+ /**
4693+ * This function is used to determine the number of bytes that may be read
4694+ * without blocking.
4695+ *
4696+ * @return The number of bytes that may be read without blocking, or 0 if an
4697+ * error occurs.
4698+ *
4699+ * @throws asio::system_error Thrown on failure.
4700+ */
4701+ std::size_t available() const
4702+ {
4703+ asio::error_code ec;
4704+ std::size_t s = this->service.available(this->implementation, ec);
4705+ asio::detail::throw_error(ec);
4706+ return s;
4707+ }
4708+
4709+ /// Determine the number of bytes available for reading.
4710+ /**
4711+ * This function is used to determine the number of bytes that may be read
4712+ * without blocking.
4713+ *
4714+ * @param ec Set to indicate what error occurred, if any.
4715+ *
4716+ * @return The number of bytes that may be read without blocking, or 0 if an
4717+ * error occurs.
4718+ */
4719+ std::size_t available(asio::error_code& ec) const
4720+ {
4721+ return this->service.available(this->implementation, ec);
4722+ }
4723+
4724+ /// Bind the socket to the given local endpoint.
4725+ /**
4726+ * This function binds the socket to the specified endpoint on the local
4727+ * machine.
4728+ *
4729+ * @param endpoint An endpoint on the local machine to which the socket will
4730+ * be bound.
4731+ *
4732+ * @throws asio::system_error Thrown on failure.
4733+ *
4734+ * @par Example
4735+ * @code
4736+ * asio::ip::tcp::socket socket(io_service);
4737+ * socket.open(asio::ip::tcp::v4());
4738+ * socket.bind(asio::ip::tcp::endpoint(
4739+ * asio::ip::tcp::v4(), 12345));
4740+ * @endcode
4741+ */
4742+ void bind(const endpoint_type& endpoint)
4743+ {
4744+ asio::error_code ec;
4745+ this->service.bind(this->implementation, endpoint, ec);
4746+ asio::detail::throw_error(ec);
4747+ }
4748+
4749+ /// Bind the socket to the given local endpoint.
4750+ /**
4751+ * This function binds the socket to the specified endpoint on the local
4752+ * machine.
4753+ *
4754+ * @param endpoint An endpoint on the local machine to which the socket will
4755+ * be bound.
4756+ *
4757+ * @param ec Set to indicate what error occurred, if any.
4758+ *
4759+ * @par Example
4760+ * @code
4761+ * asio::ip::tcp::socket socket(io_service);
4762+ * socket.open(asio::ip::tcp::v4());
4763+ * asio::error_code ec;
4764+ * socket.bind(asio::ip::tcp::endpoint(
4765+ * asio::ip::tcp::v4(), 12345), ec);
4766+ * if (ec)
4767+ * {
4768+ * // An error occurred.
4769+ * }
4770+ * @endcode
4771+ */
4772+ asio::error_code bind(const endpoint_type& endpoint,
4773+ asio::error_code& ec)
4774+ {
4775+ return this->service.bind(this->implementation, endpoint, ec);
4776+ }
4777+
4778+ /// Connect the socket to the specified endpoint.
4779+ /**
4780+ * This function is used to connect a socket to the specified remote endpoint.
4781+ * The function call will block until the connection is successfully made or
4782+ * an error occurs.
4783+ *
4784+ * The socket is automatically opened if it is not already open. If the
4785+ * connect fails, and the socket was automatically opened, the socket is
4786+ * not returned to the closed state.
4787+ *
4788+ * @param peer_endpoint The remote endpoint to which the socket will be
4789+ * connected.
4790+ *
4791+ * @throws asio::system_error Thrown on failure.
4792+ *
4793+ * @par Example
4794+ * @code
4795+ * asio::ip::tcp::socket socket(io_service);
4796+ * asio::ip::tcp::endpoint endpoint(
4797+ * asio::ip::address::from_string("1.2.3.4"), 12345);
4798+ * socket.connect(endpoint);
4799+ * @endcode
4800+ */
4801+ void connect(const endpoint_type& peer_endpoint)
4802+ {
4803+ asio::error_code ec;
4804+ if (!is_open())
4805+ {
4806+ this->service.open(this->implementation, peer_endpoint.protocol(), ec);
4807+ asio::detail::throw_error(ec);
4808+ }
4809+ this->service.connect(this->implementation, peer_endpoint, ec);
4810+ asio::detail::throw_error(ec);
4811+ }
4812+
4813+ /// Connect the socket to the specified endpoint.
4814+ /**
4815+ * This function is used to connect a socket to the specified remote endpoint.
4816+ * The function call will block until the connection is successfully made or
4817+ * an error occurs.
4818+ *
4819+ * The socket is automatically opened if it is not already open. If the
4820+ * connect fails, and the socket was automatically opened, the socket is
4821+ * not returned to the closed state.
4822+ *
4823+ * @param peer_endpoint The remote endpoint to which the socket will be
4824+ * connected.
4825+ *
4826+ * @param ec Set to indicate what error occurred, if any.
4827+ *
4828+ * @par Example
4829+ * @code
4830+ * asio::ip::tcp::socket socket(io_service);
4831+ * asio::ip::tcp::endpoint endpoint(
4832+ * asio::ip::address::from_string("1.2.3.4"), 12345);
4833+ * asio::error_code ec;
4834+ * socket.connect(endpoint, ec);
4835+ * if (ec)
4836+ * {
4837+ * // An error occurred.
4838+ * }
4839+ * @endcode
4840+ */
4841+ asio::error_code connect(const endpoint_type& peer_endpoint,
4842+ asio::error_code& ec)
4843+ {
4844+ if (!is_open())
4845+ {
4846+ if (this->service.open(this->implementation,
4847+ peer_endpoint.protocol(), ec))
4848+ {
4849+ return ec;
4850+ }
4851+ }
4852+
4853+ return this->service.connect(this->implementation, peer_endpoint, ec);
4854+ }
4855+
4856+ /// Start an asynchronous connect.
4857+ /**
4858+ * This function is used to asynchronously connect a socket to the specified
4859+ * remote endpoint. The function call always returns immediately.
4860+ *
4861+ * The socket is automatically opened if it is not already open. If the
4862+ * connect fails, and the socket was automatically opened, the socket is
4863+ * not returned to the closed state.
4864+ *
4865+ * @param peer_endpoint The remote endpoint to which the socket will be
4866+ * connected. Copies will be made of the endpoint object as required.
4867+ *
4868+ * @param handler The handler to be called when the connection operation
4869+ * completes. Copies will be made of the handler as required. The function
4870+ * signature of the handler must be:
4871+ * @code void handler(
4872+ * const asio::error_code& error // Result of operation
4873+ * ); @endcode
4874+ * Regardless of whether the asynchronous operation completes immediately or
4875+ * not, the handler will not be invoked from within this function. Invocation
4876+ * of the handler will be performed in a manner equivalent to using
4877+ * asio::io_service::post().
4878+ *
4879+ * @par Example
4880+ * @code
4881+ * void connect_handler(const asio::error_code& error)
4882+ * {
4883+ * if (!error)
4884+ * {
4885+ * // Connect succeeded.
4886+ * }
4887+ * }
4888+ *
4889+ * ...
4890+ *
4891+ * asio::ip::tcp::socket socket(io_service);
4892+ * asio::ip::tcp::endpoint endpoint(
4893+ * asio::ip::address::from_string("1.2.3.4"), 12345);
4894+ * socket.async_connect(endpoint, connect_handler);
4895+ * @endcode
4896+ */
4897+ template <typename ConnectHandler>
4898+ void async_connect(const endpoint_type& peer_endpoint, ConnectHandler handler)
4899+ {
4900+ if (!is_open())
4901+ {
4902+ asio::error_code ec;
4903+ if (this->service.open(this->implementation,
4904+ peer_endpoint.protocol(), ec))
4905+ {
4906+ this->get_io_service().post(
4907+ asio::detail::bind_handler(handler, ec));
4908+ return;
4909+ }
4910+ }
4911+
4912+ this->service.async_connect(this->implementation, peer_endpoint, handler);
4913+ }
4914+
4915+ /// Set an option on the socket.
4916+ /**
4917+ * This function is used to set an option on the socket.
4918+ *
4919+ * @param option The new option value to be set on the socket.
4920+ *
4921+ * @throws asio::system_error Thrown on failure.
4922+ *
4923+ * @sa SettableSocketOption @n
4924+ * asio::socket_base::broadcast @n
4925+ * asio::socket_base::do_not_route @n
4926+ * asio::socket_base::keep_alive @n
4927+ * asio::socket_base::linger @n
4928+ * asio::socket_base::receive_buffer_size @n
4929+ * asio::socket_base::receive_low_watermark @n
4930+ * asio::socket_base::reuse_address @n
4931+ * asio::socket_base::send_buffer_size @n
4932+ * asio::socket_base::send_low_watermark @n
4933+ * asio::ip::multicast::join_group @n
4934+ * asio::ip::multicast::leave_group @n
4935+ * asio::ip::multicast::enable_loopback @n
4936+ * asio::ip::multicast::outbound_interface @n
4937+ * asio::ip::multicast::hops @n
4938+ * asio::ip::tcp::no_delay
4939+ *
4940+ * @par Example
4941+ * Setting the IPPROTO_TCP/TCP_NODELAY option:
4942+ * @code
4943+ * asio::ip::tcp::socket socket(io_service);
4944+ * ...
4945+ * asio::ip::tcp::no_delay option(true);
4946+ * socket.set_option(option);
4947+ * @endcode
4948+ */
4949+ template <typename SettableSocketOption>
4950+ void set_option(const SettableSocketOption& option)
4951+ {
4952+ asio::error_code ec;
4953+ this->service.set_option(this->implementation, option, ec);
4954+ asio::detail::throw_error(ec);
4955+ }
4956+
4957+ /// Set an option on the socket.
4958+ /**
4959+ * This function is used to set an option on the socket.
4960+ *
4961+ * @param option The new option value to be set on the socket.
4962+ *
4963+ * @param ec Set to indicate what error occurred, if any.
4964+ *
4965+ * @sa SettableSocketOption @n
4966+ * asio::socket_base::broadcast @n
4967+ * asio::socket_base::do_not_route @n
4968+ * asio::socket_base::keep_alive @n
4969+ * asio::socket_base::linger @n
4970+ * asio::socket_base::receive_buffer_size @n
4971+ * asio::socket_base::receive_low_watermark @n
4972+ * asio::socket_base::reuse_address @n
4973+ * asio::socket_base::send_buffer_size @n
4974+ * asio::socket_base::send_low_watermark @n
4975+ * asio::ip::multicast::join_group @n
4976+ * asio::ip::multicast::leave_group @n
4977+ * asio::ip::multicast::enable_loopback @n
4978+ * asio::ip::multicast::outbound_interface @n
4979+ * asio::ip::multicast::hops @n
4980+ * asio::ip::tcp::no_delay
4981+ *
4982+ * @par Example
4983+ * Setting the IPPROTO_TCP/TCP_NODELAY option:
4984+ * @code
4985+ * asio::ip::tcp::socket socket(io_service);
4986+ * ...
4987+ * asio::ip::tcp::no_delay option(true);
4988+ * asio::error_code ec;
4989+ * socket.set_option(option, ec);
4990+ * if (ec)
4991+ * {
4992+ * // An error occurred.
4993+ * }
4994+ * @endcode
4995+ */
4996+ template <typename SettableSocketOption>
4997+ asio::error_code set_option(const SettableSocketOption& option,
4998+ asio::error_code& ec)
4999+ {
5000+ return this->service.set_option(this->implementation, option, ec);
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to all changes: