aboutsummaryrefslogtreecommitdiff
path: root/src/core/protocol.h
Commit message (Collapse)AuthorAge
* Converted property functions to use nng_err.Garrett D'Amore2025-04-27
|
* aio: introduce NNG_ESTOPPEDGarrett D'Amore2024-12-26
| | | | | | | | | | | This error code results when an AIO is stopped permanently, as a result of nni_aio_close or nni_aio_stop. The associated AIO object cannot be used again. This discrimantes against a file being closed, or a temporary cancellation which might allow the aio to be reused. Consumers must check for this error status in their callbacks, and not resubmit an operation that failed with this error. Doing so, will result in an infinite loop of submit / errors.
* NNG_OPT_RECVFD and NNG_OPT_SENDFD converted to functions.Garrett D'Amore2024-11-02
| | | | | | | | | | These options are removed entirely, and their functionality is now available via special functions, `nng_socket_get_send_poll_fd` and `nng_socket_get_recv_poll_fd`, making these first class methods on the socket. This eliminates a bit of wasteful code, and provides type safety for these methods.
* Update protocol.hBrian Carcich2024-03-16
| | | Fix comment typo
* Socket and context initialization never fails.Garrett D'Amore2021-12-25
| | | | | This makes these functions entirely bullet proof, and eliminates yet more error handling cases.
* Remove separate protocol initialization step.Garrett D'Amore2021-08-07
| | | | | Nothing is using this, but it adds complexity and also requires additional lock activity each time a socket is opened.
* Minor format and spelling in comments.Garrett D'Amore2021-07-31
|
* Several minor cleanups. Fix socket id stat for listener.v1.5.0Garrett D'Amore2021-07-09
|
* minor comment fixesGarrett D'Amore2021-06-02
|
* Fix comment in protocol.h (#1410)Evgeny Ermakov2021-01-19
|
* fixes #1386 remove NNI_PROTO_FLAG_NOMSGQGarrett D'Amore2020-12-27
|
* fixes #1104 move allocation of protocol objects to common coreGarrett D'Amore2020-01-03
| | | | fixes #1103 respondent could inline backtrace
* fixes #815 Eliminate socket filters on message queuesGarrett D'Amore2019-03-13
| | | | | | | This also eliminates the enforcement of NNG_OPT_RECVMAXSZ for inproc, which never really made much sense. This helps inproc go faster. While here, also clean up the entry point for protocols to support a drain option, since we don't use that anywhere.
* fixes #831 Unify option structures, o_type is unusedGarrett D'Amore2018-12-29
|
* fixes #540 nni_ep_opttype serves no purposeGarrett D'Amore2018-06-13
| | | | | | | | | | | | fixes #538 setopt should have an explicit chkopt routine fixes #537 Internal TCP API needs better name separation fixes #524 Option types should be "typed" This is a rework of the option management code, to make it both clearer and to prepare for further work to break up endpoints. This reduces a certain amount of dead or redundant code, and actually saves cycles when setting options, as some loops were not terminated that should have been.
* fixes #419 want to nni_aio_stop without blocking (#428)Garrett D'Amore2018-05-15
| | | | | | | | | | | | | | | | * fixes #419 want to nni_aio_stop without blocking This actually introduces an nni_aio_close() API that causes nni_aio_begin to return NNG_ECLOSED, while scheduling a callback on the AIO to do an NNG_ECLOSED as well. This should be called in non-blocking close() contexts instead of nni_aio_stop(), and the cases where we call nni_aio_fini() multiple times are updated updated to add nni_aio_stop() calls on all "interlinked" aios before finalizing them. Furthermore, we call nni_aio_close() as soon as practical in the close path. This closes an annoying race condition where the callback from a lower subsystem could wind up rescheduling an operation that we wanted to abort.
* fixes #334 Separate context for state machines from socketsGarrett D'Amore2018-04-10
| | | | | | | | | | | | | | | This provides context support for REQ and REP sockets. More discussion around this is in the issue itself. Optionally we would like to extend this to the surveyor pattern. Note that we specifically do not support pollable descriptors for non-default contexts, and the results of using file descriptors for polling (NNG_OPT_SENDFD and NNG_OPT_RECVFD) is undefined. In the future, it might be nice to figure out how to factor in optional use of a message queue for users who want more buffering, but we think there is little need for this with cooked mode.
* fixes #331 replace NNG_OPT_RAW option with constructorGarrett D'Amore2018-04-04
| | | | | | | | | | | | | This makes the raw mode something that is immutable, determined at socket construction. This is an enabling change for the separate context support coming soon. As a result, this is an API breaking change for users of the raw mode option (NNG_OPT_RAW). There aren't many of them out there. Cooked mode is entirely unaffected. There are changes to tests and documentation included.
* fixes #329 type checking not done for setoptGarrett D'Amore2018-04-04
|
* fixes #301 String option handling for getoptGarrett D'Amore2018-03-20
|
* fixes #296 Typed options should validate option typeGarrett D'Amore2018-03-20
| | | | | | | | | | | | | fixes #302 nng_dialer/listener/pipe_getopt_sockaddr desired This adds plumbing to pass and check the type of options all the way through. NNG_ZT_OPT_ORBIT is type UINT64, but you can use the untyped form to pass two of them if needed. No typed access for retrieving strings yet. I think this should allocate a pointer and copy that out, but that's for later.
* fixes #173 Define public HTTP server APIGarrett D'Amore2018-02-01
| | | | | | | | | | | | | | | | | | | | | | | This introduces enough of the HTTP API to support fully server applications, including creation of websocket style protocols, pluggable handlers, and so forth. We have also introduced scatter/gather I/O (rudimentary) for aios, and made other enhancements to the AIO framework. The internals of the AIOs themselves are now fully private, and we have eliminated the aio->a_addr member, with plans to remove the pipe and possibly message members as well. A few other minor issues were found and fixed as well. The HTTP API includes request, response, and connection objects, which can be used with both servers and clients. It also defines the HTTP server and handler objects, which support server applications. Support for client applications will require a client object to be exposed, and that should be happening shortly. None of this is "documented" yet, bug again, we will follow up shortly.
* fixes #143 Protocols and transports should be "configurable"Garrett D'Amore2017-11-02
| | | | | | | | | | | | | | | | | | | | This makes all the protocols and transports optional. All of them except ZeroTier are enabled by default, but you can now disable them (remove from the build) with cmake options. The test suite is modified so that tests still run as much as they can, but skip over things caused by missing functionality from the library (due to configuration). Further, the constant definitions and prototypes for functions that are specific to transports or protocols are moved into appropriate headers, which should be included directly by applications wishing to use these. We have also added and improved documentation -- all of the transports are documented, and several more man pages for protocols have been added. (Req/Rep and Surveyor are still missing.)
* fixes #137 Remove public access to numeric protocolsGarrett D'Amore2017-10-31
|
* fixes #112 Need to move some stuff from socket to message queuesGarrett D'Amore2017-10-23
|
* Refactor option handling APIs.Garrett D'Amore2017-09-27
| | | | | | | | | | | | This makes the APIs use string keys, and largely eliminates the use of integer option IDs altogether. The underlying registration for options is also now a bit richer, letting protcols and transports declare the actual options they use, rather than calling down into each entry point carte blanche and relying on ENOTSUP. This code may not be as fast as the integers was, but it is more intuitive, easier to extend, and is not on any hot code paths. (If you're diddling options on a hot code path you're doing something wrong.)
* Add init/fini to protocols to allow them to register options.Garrett D'Amore2017-08-23
|
* fixes #44 open protocol by "name" (symbol) instead numberGarrett D'Amore2017-08-09
| | | | | | | | | | | | | | fixes #38 Make protocols "pluggable", or at least optional This is a breaking change, as we've done away with the central registered list of protocols, and instead demand the user call nng_xxx_open() where xxx is a protocol name. (We did keep a table around in the compat framework though.) There is a nice way for protocols to plug in via an nni_proto_open(), where they can use a generic constructor that they use to build a protocol specific constructor (passing their ops vector in.)
* Give up on uncrustify; switch to clang-format.Garrett D'Amore2017-07-10
|
* Eliminate p_active, better names for pipe start and stop.Garrett D'Amore2017-03-19
|
* Reduce socket/pipe private data coupling.Garrett D'Amore2017-03-19
|
* Clean up worker vestiges.Garrett D'Amore2017-03-12
|
* Pipeline protocol now entirely callback driven.Garrett D'Amore2017-03-04
|
* Event notification via pollable FDs verified working.Garrett D'Amore2017-01-22
|
* Adds NNG_OPT_SENDFD and NNG_OPT_RECVFD socket options (untested).Garrett D'Amore2017-01-21
|
* Uncrustify last couple sets of changes.Garrett D'Amore2017-01-21
|
* Added protocol flags (which ones can send, and which can receive).Garrett D'Amore2017-01-21
|
* Move to generic socket & pipe workers, and up to 4 each.Garrett D'Amore2017-01-08
| | | | | This should eliminate all need for protocols to do their own thread management tasks.
* Simplify locking for protocols.Garrett D'Amore2017-01-07
| | | | | | | | | In an attempt to simplify the protocol implementation, and hopefully track down a close related race, we've made it so that most protocols need not worry about locks, and can access the socket lock if they do need a lock. They also let the socket manage their workers, for the most part. (The req protocol is special, since it needs a top level work distributor, *and* a resender.)
* Protocol initialization restructuring.Garrett D'Amore2017-01-02
|
* Rename nni_socket to nni_sock.Garrett D'Amore2017-01-02
|
* Change msgqueue -> msgq.Garrett D'Amore2017-01-02
|
* Uncrustify fixes.Garrett D'Amore2016-12-31
|
* Factor out repeated protocol code into common.Garrett D'Amore2016-12-29
|
* Substantial fixes for listen & dialers.Garrett D'Amore2016-12-25
| | | | | | | | | | At this point listening and dialing operations appear to function properly. As part of this I had to break the close logic up since otherwise we had a loop trying to reap a thread from itself. So there is now a separate reaper thread for pipes per-socket. I also changed lists to be a bit more rigid, and allocations now zero memory initially. (We had bugs due to uninitialized memory, and rather than hunt them all down, lets just init them to sane zero values.)
* Endpoint dialer implemented.Garrett D'Amore2016-12-22
|
* Work on endpoints. More C99 & type cleanups.Garrett D'Amore2016-12-22
|
* Use C99 structure initializers FTW. Various other changes.Garrett D'Amore2016-12-22
|
* Logic for socket shutdown, cleanup, and draining figured out.Garrett D'Amore2016-12-22
| | | | | There's work to do still, but I've left clear indications of the design in comments. Some ugly mysteries are now solved.
* Uncrustify clean now.Garrett D'Amore2016-12-21
|