NanoSocket
- this
this(Protocol protocol, int domain = AF_SP)
- this
this(in Protocol protocol, in BindTo bindTo, int domain = AF_SP)
- this
this(in Protocol protocol, in ConnectTo connectTo, int domain = AF_SP)
- ~this
~this()
- this(this)
@disable this(this)
this(this) disabled to avoid sockets being destroyed
Copying this object is disabled.
- Option
enum Option
- Protocol
enum Protocol
- bind
void bind(in string uri, in string file = __FILE__, in size_t line = __LINE__)
- close
void close()
- connect
void connect(in string uri, in string file = __FILE__, in size_t line = __LINE__)
- getOption
T getOption(Option option)
- protocol
Protocol protocol()
- receive
ubyte[] receive(Flag!"blocking" blocking = Yes.blocking)
- send
ubyte[] send(T[] data, Flag!"blocking" blocking = Yes.blocking)
Sends the bytes as expected. If the protocol is Request, then returns
the response, otherwise returns an empty array.
- setOption
inout(NanoSocket) setOption(Option option, T val)
set socket option to a value
- toString
string toString()
- trySend
ubyte[] trySend(T[] data, Duration duration, Flag!"blocking" recvBlocking = Yes.blocking)
Tries to send bytes to the other side.
duration is how long to try for
recvBlocking controls whether or not to block on reception of a response.
This only matters when the protocol is request/response
Returns the response if in request mode, otherwise an empty byte slice.
- uri
string uri()
- INVALID_FD
auto INVALID_FD
NanoSocket - high level wrapper for a nanomsg socket