0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-10 14:08:56 +02:00

ircd::net: Rename sockopts to sock_opts.

This commit is contained in:
Jason Volk 2018-01-07 02:02:41 -08:00
parent 11e1e9f0dc
commit 9dbae8b27a
5 changed files with 14 additions and 14 deletions

View file

@ -64,7 +64,7 @@ struct ircd::net::close_opts
/// If specified, these socket options will be applied when conducting
/// the disconnect (useful for adding an SO_LINGER time etc).
const sockopts *sopts { nullptr };
const sock_opts *sopts { nullptr };
};
/// Allows for implicit construction of close_opts in arguments to close()

View file

@ -49,7 +49,7 @@ namespace ircd::net
#include "remote.h"
#include "resolve.h"
#include "listener.h"
#include "sockopts.h"
#include "sock_opts.h"
#include "open.h"
#include "close.h"
#include "read.h"

View file

@ -61,9 +61,9 @@ struct ircd::net::open_opts
/// The duration allowed for the TCP connection.
milliseconds connect_timeout { 8000ms };
/// Pointer to a sockopts structure which will be applied to this socket
/// Pointer to a sock_opts structure which will be applied to this socket
/// if given. Defaults to null; no application is made.
const sockopts *sopts { nullptr };
const sock_opts *sopts { nullptr };
/// Option to toggle whether to perform the SSL handshake; you want true.
bool handshake { true };

View file

@ -20,11 +20,11 @@
*/
#pragma once
#define HAVE_IRCD_NET_SOCKOPTS_H
#define HAVE_IRCD_NET_SOCK_OPTS_H
namespace ircd::net
{
struct sockopts;
struct sock_opts;
bool blocking(const socket &);
bool nodelay(const socket &);
@ -44,14 +44,14 @@ namespace ircd::net
void read_lowat(socket &, const size_t &bytes);
void write_lowat(socket &, const size_t &bytes);
void set(socket &, const sockopts &);
void set(socket &, const sock_opts &);
}
/// Socket options convenience aggregate. This structure allows observation
/// or manipulation of socket options all together. Pass an active socket to
/// the constructor to observe all options. Use net::set(socket, sockopts) to
/// the constructor to observe all options. Use net::set(socket, sock_opts) to
/// set all non-ignored options.
struct ircd::net::sockopts
struct ircd::net::sock_opts
{
/// Magic value to not set this option on a set() pass.
static constexpr int8_t IGN { std::numeric_limits<int8_t>::min() };
@ -65,6 +65,6 @@ struct ircd::net::sockopts
ssize_t read_lowat { IGN };
ssize_t write_lowat { IGN };
sockopts(const socket &); // Get options from socket
sockopts() = default;
sock_opts(const socket &); // Get options from socket
sock_opts() = default;
};

View file

@ -357,8 +357,8 @@ ircd::net::open(socket &socket,
// net/sopts.h
//
/// Construct sockopts with the current options from socket argument
ircd::net::sockopts::sockopts(const socket &socket)
/// Construct sock_opts with the current options from socket argument
ircd::net::sock_opts::sock_opts(const socket &socket)
:blocking{net::blocking(socket)}
,nodelay{net::nodelay(socket)}
,keepalive{net::keepalive(socket)}
@ -374,7 +374,7 @@ ircd::net::sockopts::sockopts(const socket &socket)
/// ignored for updating.
void
ircd::net::set(socket &socket,
const sockopts &opts)
const sock_opts &opts)
{
if(opts.blocking != opts.IGN)
net::blocking(socket, opts.blocking);