text stringlengths 14 100k | source stringclasses 1
value | repo stringclasses 810
values | language stringclasses 13
values |
|---|---|---|---|
<|fim_prefix|>/* SPDX-License-Identifier: MPL-2.0 */
#include "precompiled.hpp"
#include "rep.hpp"
#include "err.hpp"
#include "msg.hpp"
zmq::rep_t::rep_t (class ctx_t *parent_, uint32_t tid_, int sid_) :
router_t (parent_, tid_, sid_),
_sending_reply (false),
_request_begins (true)
{
options.type = Z... | fim | zeromq/libzmq | cpp |
<|fim_suffix|>from socket_base_t.
int xsend (zmq::msg_t *msg_);
int xrecv (zmq::msg_t *msg_);
bool xhas_in ();
bool xhas_out ();
private:
// If true, we are in process of sending the reply. If false we are
// in process of receiving a request.
bool _sending_reply;
// If true, we a... | fim | zeromq/libzmq | cpp |
<|fim_prefix|>/* SPDX-License-Identifier: MPL-2.0 */
#include "precompiled.hpp"
#include "macros.hpp"
#include "req.hpp"
#include "err.hpp"
#include "msg.hpp"
#include "wire.hpp"
#include "random.hpp"
#include "likely.hpp"
zmq::req_t::req_t (class ctx_t *parent_, uint32_t tid_, int sid_) :
dealer_t (parent_, tid_... | fim | zeromq/libzmq | cpp |
/* SPDX-License-Identifier: MPL-2.0 */
#ifndef __ZMQ_REQ_HPP_INCLUDED__
#define __ZMQ_REQ_HPP_INCLUDED__
#include "dealer.hpp"
#include "stdint.hpp"
namespace zmq
{
class ctx_t;
class msg_t;
class io_thread_t;
class socket_base_t;
class req_t ZMQ_FINAL : public dealer_t
{
public:
req_t (zmq::ctx_t *parent_, u... | fim | zeromq/libzmq | cpp |
<|fim_suffix|>pe == _current_in)
_terminate_current_in = true;
else
old_pipe->terminate (true);
}
}
}
pipe_->set_router_socket_routing_id (routing_id);
add_out_pipe (ZMQ_MOVE (routing_id), pipe_);
return true;
}
<|fim_prefix|>... | fim | zeromq/libzmq | cpp |
/* SPDX-License-Identifier: MPL-2.0 */
#ifndef __ZMQ_ROUTER_HPP_INCLUDED__
#define __ZMQ_ROUTER_HPP_INCLUDED__
#include <map>
#include "socket_base.hpp"
#include "session_base.hpp"
#include "stdint.hpp"
#include "blob.hpp"
#include "msg.hpp"
#include "fq.hpp"
namespace zmq
{
class ctx_t;
class pipe_t;
// TODO: Th... | fim | zeromq/libzmq | cpp |
<|fim_prefix|>/* SPDX-License-Identifier: MPL-2.0 */
#include "precompiled.hpp"
#include "macros.hpp"
#include "scatter.hpp"
#include "pipe.hpp"
#include "err.hpp"
#include "msg.hpp"
zmq::scatter_t::scatter_t (class ctx_t *parent_, uint32_t tid_, int sid_) :
socket_base_t (parent_, tid_, sid_, true)
{
options... | fim | zeromq/libzmq | cpp |
<|fim_prefix|>/* SPDX-License-Identifier: MPL-2.0 */
#ifndef __ZMQ_SCATTER_HPP_INCLUDE<|fim_suffix|>managing the outbound pipes.
lb_t _lb;
ZMQ_NON_COPYABLE_NOR_MOVABLE (scatter_t)
};
}
#endif
<|fim_middle|>D__
#define __ZMQ_SCATTER_HPP_INCLUDED__
#include "socket_base.hpp"
#include "session_base.hpp"
#inclu... | fim | zeromq/libzmq | cpp |
<|fim_suffix|>ure_allocator_t<U> &)
{
return false;
}
#else
template <typename T> struct secure_allocator_t : std::allocator<T>
{
secure_allocator_t () ZMQ_DEFAULT;
template <class U>
secure_allocator_t (const secure_allocator_t<U> &) ZMQ_NOEXCEPT
{
}
template <class U> struct rebind
{... | fim | zeromq/libzmq | cpp |
<|fim_suffix|>ntries_t::iterator fd_entry_it =
family_entry.fd_entries.begin ();
fd_entry_it != family_entry.fd_entries.end ();
++fd_entry_it) {
fd_t fd = fd_entry_it->fd;
// http://stackoverflow.com/q/35043420/18... | fim | zeromq/libzmq | cpp |
<|fim_suffix|>
void cleanup_retired ();
bool cleanup_retired (family_entry_t &family_entry_);
// Checks if an fd_entry_t is retired.
static bool is_retired_fd (const fd_entry_t &entry_);
static fd_entries_t::iterator
find_fd_entry_by_handle (fd_entries_t &fd_entries_, handle_t handle_);
... | fim | zeromq/libzmq | cpp |
<|fim_suffix|> rc = _fq.recvpipe (msg_, NULL);
// get the new message
if (rc == 0)
rc = _fq.recvpipe (msg_, &pipe);
}
if (rc != 0)
return rc;
zmq_assert (pipe != NULL);
const uint32_t routing_id = pipe->get_server_socket_routing_id ();
msg_->set_routin... | fim | zeromq/libzmq | cpp |
<|fim_prefix|>/* SPDX-License-Identifier<|fim_suffix|> bool xhas_in ();
bool xhas_out ();
void xread_activated (zmq::pipe_t *pipe_);
void xwrite_activated (zmq::pipe_t *pipe_);
void xpipe_terminated (zmq::pipe_t *pipe_);
int xdisconnect_peer (uint32_t routing_id_);
private:
// Fair queuein... | fim | zeromq/libzmq | cpp |
<|fim_prefix|>/* SPDX-License-Identifier: MPL-2.0 */
#include "precompiled.hpp"
#include "macros.hpp"
#include "session_base.hpp"
#include "i_engine.hpp"
#include "err.hpp"
#include "pipe.hpp"
#include "likely.hpp"
#include "tcp_connecter.hpp"
#include "ws_connecter.hpp"
#include "ipc_connecter.hpp"
#include "tipc_con... | fim | zeromq/libzmq | cpp |
<|fim_prefix|>/* SPDX-License-Identifier: MPL-2.0 */
#ifndef __ZMQ_SESSION_BASE_HPP_INCLUDED__
#define __ZMQ_SESSION_BASE_HPP_INCLUDED__
#include <stdarg.h>
#include "own.hpp"
#include "io_object.hpp"
#include "pipe.hpp"
#include "socket_base.hpp"
#include "i_engine.hpp"
#include "msg.hpp"
namespace zmq
{
class io_... | fim | zeromq/libzmq | cpp |
<|fim_prefix|>/* SPDX-License-Identifier: MPL-2.0 */
#include "precompiled.hpp"
#include "poller.hpp"
#include "polling_util.hpp"
#if defined ZMQ_POLL_BASED_ON_POLL
#if !defined ZMQ_HAVE_WINDOWS && !defined ZMQ_HAVE_AIX
#include <poll.h>
#endif
#elif defined ZMQ_POLL_BASED_ON_SELECT
#if defined ZMQ_HAVE_WINDOWS
#elif... | fim | zeromq/libzmq | cpp |
<|fim_prefix|>/* SPDX-License-Identifier: MPL-2.0 */
#ifndef __ZMQ_SIGNALER_HPP_INCLUDED__
#define __ZMQ_SIGNALER_HPP_INCLUDED__
#ifdef HAVE_FORK
#include <unistd.h>
#endif
#include "fd.hpp"
#include "macros.hpp"
namespace zmq
{
// This is a cross-platform equivalent to signal_fd. However, as opposed
// to signal... | fim | zeromq/libzmq | cpp |
<|fim_prefix|>/* SPDX-License-Identifier: MPL-2.0 */
#include "precompiled.hpp"
#include <new>
#include <string>
#include <algorithm>
#include <limits>
#include "macros.hpp"
#if defined ZMQ_HAVE_WINDOWS
#if defined _MSC_VER
#if defined _WIN32_WCE
#include <cmnintrin.h>
#else
#include <intrin.h>
#endif
#endif
#else
#... | fim | zeromq/libzmq | cpp |
<|fim_prefix|>/* SPDX-License-Identifier: MPL-2.0 */
#ifndef __ZMQ_SOCKET_BASE_HPP_INCLUDED__
#define __ZMQ_SOCKET_BASE_HPP_INCLUDED__
#include <string>
#include <map>
#include <stdarg.h>
#include "own.hpp"
#include "array.hpp"
#include "blob.hpp"
#include "stdint.hpp"
#include "poller.hpp"
#include "i_poll_events.h... | fim | zeromq/libzmq | cpp |
<|fim_suffix|>:socket_poller_t::add (socket_base_t *socket_,
void *user_data_,
short events_)
{
if (find_if2 (_items.begin (), _items.end (), socket_, &is_socket)
!= _items.end ()) {
errno = EINVAL;
return -1;
}
if (is_th... | fim | zeromq/libzmq | cpp |
<|fim_suffix|>zable_optimized_fd_set_t _pollset_in;
resizable_optimized_fd_set_t _pollset_out;
resizable_optimized_fd_set_t _pollset_err;
zmq::fd_t _max_fd;
#endif
ZMQ_NON_COPYABLE_NOR_MOVABLE (socket_poller_t)
};
}
#endif
<|fim_prefix|>/* SPDX-License-Identifier: MPL-2.0 */
#ifndef __ZMQ_SOCKET_POLL... | fim | zeromq/libzmq | cpp |
<|fim_prefix|>/* SPDX-License-Identifier: MPL-2.0 */
#include "precompiled.hpp"
#include <sys/types.h>
#include "err.hpp"
#include "socks.hpp"
#include "tcp.hpp"
#include "blob.hpp"
#ifndef ZMQ_HAVE_WINDOWS
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#endif
zmq::socks_greeting_t::socks_greeti... | fim | zeromq/libzmq | cpp |
<|fim_suffix|> const;
void reset ();
private:
size_t _bytes_encoded;
size_t _bytes_written;
uint8_t _buf[1 + 1 + UINT8_MAX + 1 + UINT8_MAX];
};
struct socks_auth_response_t
{
socks_auth_response_t (uint8_t response_code_);
uint8_t response_code;
};
class socks_auth_response_decoder_t
{
pu... | fim | zeromq/libzmq | cpp |
/* SPDX-License-Identifier: MPL-2.0 */
#include "precompiled.hpp"
#include <new>
#include <string>
#include "macros.hpp"
#include "socks_connecter.hpp"
#include "random.hpp"
#include "err.hpp"
#include "ip.hpp"
#include "tcp.hpp"
#include "address.hpp"
#include "tcp_address.hpp"
#include "session_base.hpp"
#include "... | fim | zeromq/libzmq | cpp |
<|fim_suffix|> std::string &hostname_,
uint16_t &port_);
int connect_to_proxy ();
void error ();
// Open TCP connecting socket. Returns -1 in case of error,
// 0 if connect was successful immediately. Returns -1 with
// EAGAIN errno if async connect was la... | fim | zeromq/libzmq | cpp |
<|fim_suffix|>#endif
#ifndef UINT32_MAX
#define UINT32_MAX _UI32_MAX
#endif
#else
#include <stdint.h>
#endif
#ifndef UINT8_MAX
#define UINT8_MAX 0xFF
#endif
#endif
<|fim_prefix|>/* SPDX-License-Identifier: MPL-2.0 */
#ifndef<|fim_middle|> __ZMQ_STDINT_HPP_INCLUDED__
#define __ZMQ_STDINT_HPP_INCLUDED__
#if define... | fim | zeromq/libzmq | cpp |
<|fim_prefix|>/* SPDX-License-Identifier: MPL-2.0 */
#include "precompiled.hpp"
#include "macros.hpp"
#include "stream.hpp"
#include "pipe.hpp"
#include "wire.hpp"
#include "random.hpp"
#include "likely.hpp"
#include "err.hpp"
zmq::stream_t::stream_t (class ctx_t *parent_, uint32_t tid_, int sid_) :
routing_socke... | fim | zeromq/libzmq | cpp |
<|fim_suffix|> bool _more_out;
// Routing IDs are generated. It's a simple increment and wrap-over
// algorithm. This value is the next ID to use (if not used already).
uint32_t _next_integral_routing_id;
ZMQ_NON_COPYABLE_NOR_MOVABLE (stream_t)
};
}
#endif
<|fim_prefix|>/* SPDX-License-Identifier: ... | fim | zeromq/libzmq | cpp |
<|fim_prefix|>/* SPDX-License-Identifier: MPL-2.0 */
#include "precompiled.hpp"
#include "stream_connecter_base.hpp"
#include "session_base.hpp"
#include "address.hpp"
#include "random.hpp"
#include "zmtp_engine.hpp"
#include "raw_engine.hpp"
#ifndef ZMQ_HAVE_WINDOWS
#include <unistd.h>
#else
#include <winsock2.h>
#e... | fim | zeromq/libzmq | cpp |
<|fim_suffix|>a while before trying to connect.
const bool _delayed_start;
// True iff a timer has been started.
bool _reconnect_timer_started;
// Current reconnect ivl, updated for backoff strategy
int _current_reconnect_ivl;
ZMQ_NON_COPYABLE_NOR_MOVABLE (stream_connecter_base_t)
protec... | fim | zeromq/libzmq | cpp |
<|fim_suffix|>
flush_session = true;
}
if (flush_session)
_session->flush ();
_next_msg = &stream_engine_base_t::pull_and_encode;
_process_msg = &stream_engine_base_t::write_credential;
// Compile metadata.
properties_t properties;
init_properties (properties);
// A... | fim | zeromq/libzmq | cpp |
<|fim_prefix|>/* SPDX-License-Identifier: MPL-2.0 */
#ifndef __ZMQ_STREAM_ENGINE_BASE_HPP_INCLUDED__
#define __ZMQ_STREAM_ENGINE_BASE_HPP_INCLUDED__
#include <stddef.h>
#include "fd.hpp"
#include "i_engine.hpp"
#include "io_object.hpp"
#include "i_encoder.hpp"
#include "i_decoder.hpp"
#include "options.hpp"
#include... | fim | zeromq/libzmq | cpp |
<|fim_suffix|>::stream_listener_base_t::stream_listener_base_t (
zmq::io_thread_t *io_thread_,
zmq::socket_base_t *socket_,
const zmq::options_t &options_) :
own_t (io_thread_, options_),
io_object_t (io_thread_),
_s (retired_fd),
_handle (static_cast<handle_t> (NULL)),
_socket (socket_)
{
}
... | fim | zeromq/libzmq | cpp |
<|fim_suffix|> const options_t &options_);
~stream_listener_base_t () ZMQ_OVERRIDE;
// Get the bound address for use with wildcards
int get_local_address (std::string &addr_) const;
protected:
virtual std::string get_socket_name (fd_t fd_,
socket_end_t s... | fim | zeromq/libzmq | cpp |
<|fim_suffix|>// Override the XSUB's send.
errno = ENOTSUP;
return -1;
}
bool zmq::sub_t::xhas_out ()
{
// Override the XSUB's send.
return false;
}
<|fim_prefix|>/* SPDX-License-Identifier: MPL-2.0 */
#include "precompiled.hpp"
#include "sub.hpp"
#include "msg.hpp"
zmq::sub_t::sub_t (class ctx_t *... | fim | zeromq/libzmq | cpp |
<|fim_suffix|>ead_t;
class socket_base_t;
class sub_t ZMQ_FINAL : public xsub_t
{
public:
sub_t (zmq::ctx_t *parent_, uint32_t tid_, int sid_);
~sub_t ();
protected:
int xsetsockopt (int option_, const void *optval_, size_t optvallen_);
int xsend (zmq::msg_t *msg_);
bool xhas_out ();
ZMQ_... | fim | zeromq/libzmq | cpp |
<|fim_suffix|>rc;
}
#endif // ZMQ_HAVE_TCP_KEEPALIVE
#endif // ZMQ_HAVE_TCP_KEEPIDLE
#ifdef ZMQ_HAVE_TCP_KEEPINTVL
if (keepalive_intvl_ != -1) {
int rc = setsockopt (s_, IPPROTO_TCP, TCP_KEEPINTVL,
&keepalive_intvl_, sizeof (int));
assert_success... | fim | zeromq/libzmq | cpp |
<|fim_suffix|>, returns the socket
// descriptor and assigns the resolved address to out_tcp_addr_. In case of
// an error, retired_fd is returned, and the value of out_tcp_addr_ is undefined.
// errno is set to an error code describing the cause of the error.
fd_t tcp_open_socket (const char *address_,
... | fim | zeromq/libzmq | cpp |
<|fim_suffix|> else {
const long mask = strtol (mask_str.c_str (), NULL, 10);
if ((mask < 1)
|| (_network_address.family () == AF_INET6 && mask > full_mask_ipv6)
|| (_network_address.family () != AF_INET6
&& mask > full_mask_ipv4)) {
errno = EINVAL;
... | fim | zeromq/libzmq | cpp |
/* SPDX-License-Identifier: MPL-2.0 */
#ifndef __ZMQ_TCP_ADDRESS_HPP_INCLUDED__
#define __ZMQ_TCP_ADDRESS_HPP_INCLUDED__
#if !defined ZMQ_HAVE_WINDOWS
#include <sys/socket.h>
#include <netinet/in.h>
#endif
#include "ip_resolver.hpp"
namespace zmq
{
class tcp_address_t
{
public:
tcp_address_t ();
tcp_addre... | fim | zeromq/libzmq | cpp |
<|fim_suffix|>
errno_assert (errno != EBADF && errno != ENOPROTOOPT
&& errno != ENOTSOCK && errno != ENOBUFS);
#else
errno_assert (errno != ENOPROTOOPT && errno != ENOTSOCK
&& errno != ENOBUFS);
#endif
return retired_fd;
}
#endif
// Return th... | fim | zeromq/libzmq | cpp |
<|fim_suffix|>ng ();
// Internal function to add a connect timer
void add_connect_timer ();
// Open TCP connecting socket. Returns -1 in case of error,
// 0 if connect was successful immediately. Returns -1 with
// EAGAIN errno if async connect was launched.
int open ();
// Get the f... | fim | zeromq/libzmq | cpp |
<|fim_prefix|>/* SPDX-License-Identifier: MPL-2.0 */
#include "precompiled.hpp"
#include <new>
#include <string>
#include <stdio.h>
#include "tcp_listener.hpp"
#include "io_thread.hpp"
#include "config.hpp"
#include "err.hpp"
#include "ip.hpp"
#include "tcp.hpp"
#include "socket_base.hpp"
#include "address.hpp"
#if... | fim | zeromq/libzmq | cpp |
<|fim_suffix|>);
// Address to listen on.
tcp_address_t _address;
ZMQ_NON_COPYABLE_NOR_MOVABLE (tcp_listener_t)
};
}
#endif
<|fim_prefix|>/* SPDX-License-Identifier: MPL-2.0 */
#ifndef __ZMQ_TCP_LISTENER_HPP_INCLUDED__
#define __ZMQ_TCP_LISTENER_HPP_INCLUDED__
#include "fd.hpp"
#include "tcp_address.h... | fim | zeromq/libzmq | cpp |
<|fim_suffix|>hedparam (pthread_self (), policy, ¶m);
#if defined(__FreeBSD_kernel__) || defined(__FreeBSD__)
// If this feature is unavailable at run-time, don't abort.
if (rc == ENOSYS)
return;
#endif
posix_assert (rc);
#if !defined ZMQ_HAVE_VXWORKS
if (use_nice_instead_priority
... | fim | zeromq/libzmq | cpp |
<|fim_prefix|>/* SPDX-License-Identifier: MPL-2.0 */
#ifndef __ZMQ_THREAD_HPP_INCLUDED__
#define __ZMQ_THREAD_HPP_INCLUDED__
#if defined ZMQ_HAVE_VXWORKS
#include <vxWorks.h>
#include <taskLib.h>
#elif !defined ZMQ_HAVE_<|fim_suffix|>d scheduling parameters.
int _thread_priority;
int _thread_sched_policy;
... | fim | zeromq/libzmq | cpp |
<|fim_prefix|>/* SPDX-License-Identifier: MPL-2.0 */
#include "precompiled.hpp"
#include "timers.hpp"
#include "err.hpp"
#include <algorithm>
zmq::timers_t::timers_t () : _tag (0xCAFEDADA), _next_timer_id (0)
{
}
zmq::timers_t::~timers_t ()
{
// Mark the timers as dead
_tag = 0xdeadbeef;
}
bool zmq::timer... | fim | zeromq/libzmq | cpp |
<|fim_prefix|>/* SPDX-License-Identifier: MPL-2.0 */
#ifndef __ZMQ_TIMERS_HPP_INCLUDED__
#define __ZMQ_TIMERS_HPP_INCLUDED__
#include <stddef.h>
#include <map>
#include <set>
#include "clock.hpp"
namespace zmq
{
typedef void (timers_timer_fn) (int timer_id_, void *arg_);
class timers_t
{
public:
timers_t ();... | fim | zeromq/libzmq | cpp |
<|fim_prefix|>/* SPDX-License-Identifier: MPL-2.0 */
#include "precompiled.hpp"
#include "tipc_address.hpp"
#if defined ZMQ_HAVE_TIPC
#include "err.hpp"
#include <string>
#include <sstream>
zmq::tipc_address_t::tipc_address_t ()
{
memset (&address, 0, sizeof address);
_random = false;
}
zmq::tipc_address... | fim | zeromq/libzmq | cpp |
<|fim_prefix|>/* SPDX-License-Identifier: MPL-2.0 */
#ifndef __ZMQ_TIPC_ADDRESS_HPP_INCLUDED__
#define __ZMQ_TIPC_ADDRESS_HPP_INCLUDED__
#include <string>
#include "platform.hpp"
#if defined ZMQ_HAVE_TIPC
#include <sys/socket.h>
#if defined ZMQ_HAVE_VXWORKS
#include <tipc/tipc.h>
#else
#include <linux/tipc.h>
#end... | fim | zeromq/libzmq | cpp |
<|fim_suffix|> int rc = getsockopt (_s, SOL_SOCKET, SO_ERROR,
reinterpret_cast<char *> (&err), &len);
if (rc == -1)
err = errno;
if (err != 0) {
// Assert if the error was caused by 0MQ bug.
// Networking problems are OK. No need to assert.
errno = er... | fim | zeromq/libzmq | cpp |
<|fim_prefix|>/* SPDX-Lice<|fim_suffix|>DED__
#include "platform.hpp"
#if defined ZMQ_HAVE_TIPC
#include "fd.hpp"
#include "stream_connecter_base.hpp"
namespace zmq
{
class tipc_connecter_t ZMQ_FINAL : public stream_connecter_base_t
{
public:
// If 'delayed_start' is true connecter first waits for a while,
... | fim | zeromq/libzmq | cpp |
<|fim_prefix|>/* SPDX-License-Identifier: MPL-2.0 */
#include "precompiled.hpp"
#include "tipc_listener.hpp"
#if defined ZMQ_HAVE_TIPC
#include <new>
#include <string.h>
#include "tipc_address.hpp"
#include "io_thread.hpp"
#include "config.hpp"
#include "err.hpp"
#include "ip.hpp"
#include "socket_base.hpp"
#incl... | fim | zeromq/libzmq | cpp |
<|fim_prefix|>/* SPDX-License-Identifier: MPL-2.0 */
#ifndef __ZMQ_TIPC_LISTENER_HPP_INCLUDED__
#define __ZMQ_TIPC_LISTENER_HPP_INCLUDED__
#include "platform.hpp"
#if defined ZMQ_HAVE_TIPC
#include <string>
#include "fd.hpp"
#include "stream_listener_base.hpp"
#include "tipc<|fim_suffix|>connection was dropped whi... | fim | zeromq/libzmq | cpp |
<|fim_suffix|>- _min] = 0;
zmq_assert (_live_nodes > 1);
--_live_nodes;
// Compact the table if possible
if (_live_nodes == 1) {
// We can switch to using the more compact single-node
// representation since the table only contains one ... | fim | zeromq/libzmq | cpp |
<|fim_prefix|>/* SPDX-License-Identifier: MPL-2.0 */
#ifndef __ZMQ_TRIE<|fim_suffix|> (unsigned char *prefix_, size_t size_)
{
if (_trie.rm (prefix_, size_)) {
_num_prefixes.sub (1);
return true;
} else
return false;
}
bool check (const unsigned char *da... | fim | zeromq/libzmq | cpp |
<|fim_suffix|>nd by address.
if (ipv6_ && _is_multicast && _bind_interface < 0) {
errno = ENODEV;
return -1;
}
return 0;
}
int zmq::udp_address_t::family () const
{
return _bind_address.family ();
}
bool zmq::udp_address_t::is_mcast () const
{
return _is_multicast;
}
const zmq::i... | fim | zeromq/libzmq | cpp |
<|fim_prefix|>/* SPDX-License-Identifier: MPL-2.0 */
#ifndef __ZMQ_UDP<|fim_suffix|>irtual ~udp_address_t ();
int resolve (const char *name_, bool bind_, bool ipv6_);
// The opposite to resolve()
virtual int to_string (std::string &addr_);
int family () const;
bool is_mcast () const;
con... | fim | zeromq/libzmq | cpp |
<|fim_prefix|>/* SPDX-License-Identifier: MPL-2.0 */
#include "precompiled.hpp"
#if !defined ZMQ_HAVE_WINDOWS
#include <sys/types.h>
#include <unistd.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#ifdef ZMQ_HAVE_VXWORKS
#include <sockLib.h>
#endif
#endif
#include "udp_address.hpp"
#includ... | fim | zeromq/libzmq | cpp |
<|fim_prefix|>
#ifndef __ZMQ_UDP_ENGINE_HPP_INCLUDED__
#define __ZMQ_UDP_ENGINE_HPP_INCLUDED__
#include "io_object.hpp"
#include "i_engine.hpp"
#include "address.hpp"
#includ<|fim_suffix|>, bool loop_);
// Set multicast TTL
static int set_udp_multicast_ttl (fd_t s_, bool is_ipv6_, int hops_);
// Set multic... | fim | zeromq/libzmq | cpp |
/* SPDX-License-Identifier: MPL-2.0 */
#include "precompiled.hpp"
#include <stdlib.h>
#include <string.h>
#include <limits>
#include <limits.h>
#include "decoder.hpp"
#include "v1_decoder.hpp"
#include "likely.hpp"
#include "wire.hpp"
#include "err.hpp"
zmq::v1_decoder_t::v1_decoder_t (size_t bufsize_, int64_t maxms... | fim | zeromq/libzmq | cpp |
<|fim_prefix|>/* SPDX-License-Identifier: MPL-2.0 */
#ifndef __ZMQ_V1_DECODER_HPP_INCLUDED__
#define __ZMQ_V1_DECODER_HPP_INCLUDED__
#in<|fim_suffix|>ecoder_t)
};
}
#endif
<|fim_middle|>clude "decoder.hpp"
namespace zmq
{
// Decoder for ZMTP/1.0 protocol. Converts data batches into messages.
class v1_decoder_t ZM... | fim | zeromq/libzmq | cpp |
<|fim_prefix|>/* SPDX-License-Identifier: MPL-2.0 */
#include "precompiled.hpp"
#include "encoder.hpp"
#include "v1_encoder.hpp"
#include "msg.hpp"
#include "wire.hpp"
#include <limits.h>
zmq::v1_encoder_t::v1_encoder_t (size_t bufsize_) :
encoder_base_t<v1_en<|fim_suffix|>and go to message_ready state.
next... | fim | zeromq/libzmq | cpp |
<|fim_suffix|>_t<v1_encoder_t>
{
public:
v1_encoder_t (size_t bufsize_);
~v1_encoder_t ();
private:
void size_ready ();
void message_ready ();
unsigned char _tmpbuf[11];
ZMQ_NON_COPYABLE_NOR_MOVABLE (v1_encoder_t)
};
}
#endif
<|fim_prefix|>/* SPDX-License-Identi<|fim_middle|>fier: MPL-2.... | fim | zeromq/libzmq | cpp |
<|fim_prefix|>/* SPDX-License-Identifier: MPL-2.0 */
#include "precompiled.hpp"
#include <stdlib.h>
#include <string.h>
#include <cmath>
#include "v2_protocol.hpp"
#include "v2_decoder.hpp"
#include "likely.hpp"
#include "wire.hpp"
#include "err.hpp"
zmq::v2_decoder_t::v2_decoder_t (size_t bufsize_,
... | fim | zeromq/libzmq | cpp |
<|fim_suffix|>
};
}
#endif
<|fim_prefix|>/* SPDX-License-Identifier: MPL-2.0 */
#ifndef __ZMQ_V2_DECODER_HPP_INCLUDED__
#define __ZMQ_V2_DECODER_HPP_INCLUDED__
#include "decoder.hpp"
#include "decoder_allocators.hpp"
namespace zmq
{
// Decoder for ZMTP/2.x framin<|fim_middle|>g protocol. Converts data stream into ... | fim | zeromq/libzmq | cpp |
<|fim_prefix|>/* SPDX-License-Identifier: MPL-2.0 */
#include "precompiled.hpp"
#include "v2_protocol.hpp"
#include "v2_encoder.hpp"
#include "msg.hpp"
#include "likely.hpp"
#include "wire.hpp"
#include <limits.h>
zmq::v2_encoder_t::v2_encoder_t (size_t bufsize_) :
encoder_base_t<v2_encoder_t> (bufsize_)
{
/... | fim | zeromq/libzmq | cpp |
<|fim_suffix|>har _tmp_buf[10];
ZMQ_NON_COPYABLE_NOR_MOVABLE (v2_encoder_t)
};
}
#endif
<|fim_prefix|>/* SPDX-License-Identifier: MPL-2.0 */
#ifndef __ZMQ_V2_ENCODER_HPP_INCLUDED__
#define __ZMQ_V2_ENCODER_HPP_INCLUDED__
#include "encoder.hpp"
namespace zmq
{
// Encoder for 0MQ framing protocol. Converts mess... | fim | zeromq/libzmq | cpp |
<|fim_prefix|>/* SPDX-License-Identifier: MPL-2.0 */
#ifndef __ZMQ_V2_PROTOCOL_HPP_INCLUDED__
#define __ZMQ_V2_PROTOCOL_HPP_INCLUDED__
namespace zmq
{
// Definition of constants for ZMTP/2.0 transpor<|fim_suffix|>Message flags.
enum
{
more_flag = 1,
large_flag = 2,
command_flag = 4
... | fim | zeromq/libzmq | cpp |
<|fim_prefix|>/* SPDX-License-Identifier: MPL-2.0 */
#include "precompiled.hpp"
#include "v2_protocol.hpp"
#include "v3_1_encoder.hpp"
#include "msg.hpp"
#include "likely.hpp"
#include "wire.hpp"
#include <limits.h>
zmq::v3_1_encoder_t::v3_1_encoder_t (size_t bufsize_) :
encoder_base_t<v3_1_encoder_t> (bufsize_)... | fim | zeromq/libzmq | cpp |
<|fim_prefix|>/* SPDX-License-Identifier: MPL-2.0 */
#ifndef __ZMQ_V3_1_ENCODER_HPP_INCLUDED__
#define __ZMQ_V3_1_ENCODER_HPP_<|fim_suffix|>sages into data stream.
class v3_1_encoder_t ZMQ_FINAL : public encoder_base_t<v3_1_encoder_t>
{
public:
v3_1_encoder_t (size_t bufsize_);
~v3_1_encoder_t () ZMQ_FINAL;... | fim | zeromq/libzmq | cpp |
<|fim_suffix|> const zmq::options_t &options_,
zmq::vmci_address_t *out_vmci_addr_)
{
// Convert the textual address into address structure.
int rc = out_vmci_addr_->resolve (address_);
if (rc != 0)
return retired_fd;
// Create the socket.
... | fim | zeromq/libzmq | cpp |
<|fim_suffix|> vmci_address_t *out_vmci_addr_);
}
#endif
#endif
<|fim_prefix|>/* SPDX-License-Identifier: MPL-2.0 */
#ifndef __ZMQ_VMCI_HPP_INCLUDED__
#define __ZMQ_VMCI_HPP_INCLUDED__
#include <string>
#include "platform.hpp"
#include "fd.hpp"
#include "ctx.hpp"
#if defined ZMQ_HAVE_VMCI
#if defined... | fim | zeromq/libzmq | cpp |
<|fim_suffix|> s << address.svm_cid;
}
s << ":";
if (address.svm_port == VMADDR_PORT_ANY) {
s << "*";
} else {
s << address.svm_port;
}
addr_ = s.str ();
return 0;
}
const sockaddr *zmq::vmci_address_t::addr () const
{
return reinterpret_cast<const sockaddr *> (&addr... | fim | zeromq/libzmq | cpp |
<|fim_prefix|>/* SPDX-License-Identifier: MPL-2.0 */
#ifndef __ZMQ_VMCI_ADDRESS_HPP_INCLUDED__
#define __ZMQ_VMCI_ADDRESS_HPP_INCLUDED__
#include <string>
#include "platform.hpp"
#include "ctx.hpp"
#if defined(ZMQ_HAVE_VMCI)
#include <vmci_sockets.h>
namespace zmq
{
class vmci_address_t
{
public:
vmci_addres... | fim | zeromq/libzmq | cpp |
<|fim_suffix|>f (_addr->resolved.vmci_addr != NULL) {
LIBZMQ_DELETE (_addr->resolved.vmci_addr);
}
_addr->resolved.vmci_addr =
new (std::nothrow) vmci_address_t (this->get_ctx ());
alloc_assert (_addr->resolved.vmci_addr);
_s = vmci_open_socket (_addr->address.c_str (), options,
... | fim | zeromq/libzmq | cpp |
<|fim_suffix|> zmq::session_base_t *session_,
const options_t &options_,
address_t *addr_,
bool delayed_start_);
~vmci_connecter_t ();
protected:
std::string get_socket_name (fd_t fd_, socket_end_t socket_end_) const;
private... | fim | zeromq/libzmq | cpp |
<|fim_prefix|>/* SPDX-License-Identifier: MPL-2.0 */
#include "precompiled.hpp"
#include "vmci_listener.hpp"
#if defined ZMQ_HAVE_VMCI
#include <new>
//#include "stream_engine.hpp"
#include "vmci_address.hpp"
#include "io_thread.hpp"
#include "session_base.hpp"
#include "config.hpp"
#include "err.hpp"
#include "ip... | fim | zeromq/libzmq | cpp |
/* SPDX-License-Identifier: MPL-2.0 */
#ifndef __ZMQ_VMCI_LISTENER_HPP_INCLUDED__
#define __ZMQ_VMCI_LISTENER_HPP_INCLUDED__
#include "platform.hpp"
#if defined ZMQ_HAVE_VMCI
#include <string>
#include "fd.hpp"
#include "vmci_address.hpp"
#include "stream_listener_base.hpp"
namespace zmq
{
class vmci_listener_t Z... | fim | zeromq/libzmq | cpp |
<|fim_prefix|>/* SPDX-License-Identifier: MPL-2.0 */
#include "precompiled.hpp"
#include "vsock_address.hpp"
#if defined ZMQ_HAVE_VSOCK
#include <climits>
#include <string>
#include <sstream>
#include "err.hpp"
zmq::vsock_address_t::vsock_address_t ()
{
memset (&address, 0, sizeof address);
}
zmq::vsock_addre... | fim | zeromq/libzmq | cpp |
<|fim_suffix|> const sockaddr *addr () const;
socklen_t addrlen () const;
private:
struct sockaddr_vm address;
ctx_t *parent;
ZMQ_NON_COPYABLE_NOR_MOVABLE (vsock_address_t)
};
}
#endif
#endif
<|fim_prefix|>/* SPDX-License-Identifier: MPL-2.0 */
#ifndef __ZMQ_VSOCK_ADDRESS_HPP_INCLUDED__
#define... | fim | zeromq/libzmq | cpp |
<|fim_prefix|>/* SPDX-License-Identifier: MPL-2.0 */
#include "precompiled.hpp"
#include "vsock_connecter.hpp"
#include "vsock_address.hpp"
#if defined ZMQ_HAVE_VSOCK
#include <new>
#include "io_thread.hpp"
#include "platform.hpp"
#include "random.hpp"
#include "err.hpp"
#include "ip.hpp"
#include "address.hpp"
#i... | fim | zeromq/libzmq | cpp |
<|fim_suffix|>sion_base_t *session_,
const options_t &options_,
address_t *addr_,
bool delayed_start_);
~vsock_connecter_t ();
protected:
std::string get_socket_name (fd_t fd_, socket_end_t socket_end_) const;
private:
// ID of the ... | fim | zeromq/libzmq | cpp |
<|fim_suffix|> close ();
errno = err;
return -1;
}
zmq::fd_t zmq::vsock_listener_t::accept ()
{
// Accept one connection and deal with different failure modes.
// The situation where connection cannot be accepted due to insufficient
// resources is considered valid and treated by ignoring the c... | fim | zeromq/libzmq | cpp |
<|fim_prefix|>/* SPDX-License-Identifier: MPL-2.0 */
#ifndef __ZMQ_VSOCK_LISTENER_HPP_INCLUDED__
#define __ZMQ_VSOCK_LISTENER_HPP_INCLUDED__
#include "platform.hpp"
#if defined ZMQ_HAVE_VSOCK
#include <string>
#include "fd.hpp"
#include "vsock_address.hpp"
#include "stream_listener_b<|fim_suffix|>NOR_MOVABLE (vsoc... | fim | zeromq/libzmq | cpp |
<|fim_suffix|>*/
};
#endif
#endif
<|fim_prefix|>/* SPDX-License-Identifier: MPL-2.0 */
#ifndef __ZMQ_WINDOWS_HPP_INCLUDED__
#define __ZMQ_WINDOWS_HPP_INCLUDED__
#ifndef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
#endif
#ifndef NOMINMAX
#define NOMINMAX // Macros min(a,b) and max(a,b)
#endif
// Set tar... | fim | zeromq/libzmq | cpp |
<|fim_suffix|>igned char> (((value_) >> 16) & 0xff);
buffer_[6] = static_cast<unsigned char> (((value_) >> 8) & 0xff);
buffer_[7] = static_cast<unsigned char> (value_ & 0xff);
}
inline uint64_t get_uint64 (const unsigned char *buffer_)
{
return ((static_cast<uint64_t> (buffer_[0])) << 56)
| ((st... | fim | zeromq/libzmq | cpp |
<|fim_prefix|>/* SPDX-License-Identifier: MPL-2.0 */
#include "precompiled.hpp"
#include <string>
#include <sstream>
#include "macros.hpp"
#include "ws_address.hpp"
#include "stdint.hpp"
#include "err.<|fim_suffix|>lons as delemiters.
const char *delim = strrchr (name_, ':');
if (delim == NULL) {
errn... | fim | zeromq/libzmq | cpp |
/* SPDX-License-Identifier: MPL-2.0 */
#ifndef __ZMQ_WS_ADDRESS_HPP_INCLUDED__
#define __ZMQ_WS_ADDRESS_HPP_INCLUDED__
#if !defined ZMQ_HAVE_WINDOWS
#include <sys/socket.h>
#include <netinet/in.h>
#endif
#include "ip_resolver.hpp"
namespace zmq
{
class ws_address_t
{
public:
ws_address_t ();
ws_address_t ... | fim | zeromq/libzmq | cpp |
<|fim_prefix|>/* SPDX-License-Identifier: MPL-2.0 */
#include "precompiled.hpp"
#include <new>
#include <string>
#include "macros.hpp"
#include "ws_connecter.hpp"
#include "io_thread.hpp"
#include "err.hpp"
#include "ip.hpp"
#include "tcp.hpp"
#include "address.hpp"
#include "ws_address.hpp"
#include "ws_engine.hpp"
... | fim | zeromq/libzmq | cpp |
<|fim_prefix|>/* SPDX-License-Identifier: MPL-2.0 */
#ifndef __WS_CONNECTER_HPP_INCLUDED__
#define __WS_CONNECTER_HPP_INCLUDED__
#include "fd.hpp"
#include "stdint.hpp"
#include "stream_connecter_base.hpp"
namespace zmq
{
class ws_connecter_t ZMQ_FINAL : public stream_connecter_base_t
{
public:
// If 'delayed... | fim | zeromq/libzmq | cpp |
<|fim_prefix|>/* SPDX-License-Identifier: MPL-2.0 */
#include "precompiled.hpp"
#include <stdlib.h>
#include <string.h>
#include <cmath>
#include "ws_protocol.hpp"
#include "ws_decoder.hpp"
#include "likely.hpp"
#include "wire.hpp"
#include "err.hpp"
zmq::ws_decoder_t::ws_decoder_t (size_t bufsize_,
... | fim | zeromq/libzmq | cpp |
<|fim_suffix|>t short_size_ready (unsigned char const *);
int long_size_ready (unsigned char const *);
int mask_ready (unsigned char const *);
int flags_ready (unsigned char const *);
int message_ready (unsigned char const *);
int size_ready (unsigned char const *);
unsigned char _tmpbuf[8];
... | fim | zeromq/libzmq | cpp |
<|fim_prefix|>/* SPDX-License-Identifier: MPL-2.0 */
#include "precompiled.hpp"
#include "ws_protocol.hpp"
#include "ws_encoder.hpp"
#include "msg.hpp"
#include "likely.hpp"
#include "wire.hpp"
#include "random.hpp"
#include <limits.h>
zmq::ws_encoder_t::ws_encoder_t (size_t bufsize_, bool must_mask_) :
encoder_... | fim | zeromq/libzmq | cpp |
<|fim_prefix|>/* SPDX-License-Identifier: MPL-2.0 */
#ifndef __ZMQ_WS_ENCODER_HPP_INCLUDED__
#define __ZMQ_WS_ENCODER_HPP_INCLUDED__
#include "encoder.hpp"
namespace zmq
{
// Encoder for web socket framing protoc<|fim_suffix|>_t bufsize_, bool must_mask_);
~ws_encoder_t ();
private:
void size_ready ();
... | fim | zeromq/libzmq | cpp |
<|fim_prefix|>/* SPDX-License-Identifier: MPL-2.0 */
#include "precompiled.hpp"
#ifdef ZMQ_USE_NSS
#include <secoid.h>
#include <sechash.h>
#define SHA_DIGEST_LENGTH 20
#elif defined ZMQ_USE_BUILTIN_SHA1
#include "../external/sha1/sha1.h"
#elif defined ZMQ_USE_GNUTLS
#define SHA_DIGEST_LENGTH 20
#include <gnutls/gnut... | fim | zeromq/libzmq | cpp |
<|fim_suffix|>line_switch,
response_line_switchi,
response_line_switchin,
response_line_switching,
response_line_switching_space,
response_line_p,
response_line_pr,
response_line_pro,
response_line_prot,
response_line_proto,
response_line_protoc,
response_line_protoco,
re... | fim | zeromq/libzmq | cpp |
<|fim_suffix|> engine = new (std::nothrow)
wss_engine_t (fd_, options, endpoint_pair, _address, false, _tls_cred,
std::string ());
#else
zmq_assert (false);
#endif
else
engine = new (std::nothrow)
ws_engine_t (fd_, options, endpoint_pair, _address, f... | fim | zeromq/libzmq | cpp |
<|fim_suffix|>ction. The function may return retired_fd
// if the connection was dropped while waiting in the listen backlog
// or was denied because of accept filters.
fd_t accept ();
int create_socket (const char *addr_);
// Address to listen on.
ws_address_t _address;
bool _wss;
#if... | fim | zeromq/libzmq | cpp |
<|fim_prefix|>/* SPDX-License-Identifier: MPL-2.0 */
#ifndef __ZMQ_WS_PROTOCOL_HPP_INCLUDED__
#define __ZMQ_WS_PROTOCOL_HPP_INCLUDED__
namespace zmq
{
// Definition of constants for WS transport protocol.
class ws_protocol<|fim_suffix|>ng = 0x09,
opcode_pong = 0xA
};
enum
{
more_flag = 1... | fim | zeromq/libzmq | cpp |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.