aboutsummaryrefslogtreecommitdiff
path: root/src/sp/transport/tcp/tcp.c
Commit message (Collapse)AuthorAge
* Replace nng_pipe_get_addr, nng_stream_get_addr, and the NNG_OPT_REMADDR option.Garrett D'Amore2025-10-27
| | | | | | | | | | | More direct access methods are provided instead. This results in much lower friction when using, and is a step on the path to removing NNG_OPT_LOCADDR as well. We need to figure a solution for NNG_OPT_LOCADDR for dialers; for listeners there is little use in it either, and it will be removed. (Dialers will probably get a new NNG_OPT_BIND_IP option.)
* NNG_OPT_BOUND_PORT replaces NNG_OPT_TCP/UDP_BOUND_PORT.Garrett D'Amore2025-10-26
| | | | | | | | | | This is easier and agnostic about the underlying L3 protocol. We plan to remove direct NNG_OPT_LOCADDR support from listeners (and probably both NNG_OPT_LOCADDR and NNG_OPT_REMADDR have numbered days left in their lifetime. They will be replaced with more direct typed access functions as has been done for pipes already.) While here fixed some include for IWYU in the POSIX platform.
* Plumb sockaddrs all the way through pipes, make them failsafe.Garrett D'Amore2025-10-25
| | | | These functions can no longer fail.
* header file fixesGarrett D'Amore2025-10-09
|
* fixes #2173 New TLS cert API - replaces the properties for CN and ALTNAMES.Garrett D'Amore2025-10-05
| | | | | | This will replace the NNG_OPT_TLS_PEER_ALTNAMES and NNG_OPT_TLS_PEER_CN properties, and gives a bit more access to the certificate, as well as direct access to the raw DER form, which should allow use in other APIs.
* Introduce DTLS transport for NNG.Garrett D'Amore2025-06-01
| | | | | | | | | | | | | This introduces a new experimental transport for DTLS, that provides encryption over UDP. It has a simpler protocol than the current UDP SP protocol (but we intend to fix that by making the UDP transport simpler in a follow up!) There are a few other fixes in the TLS layer itself, and in the build, that were needed to accomplish this work. Also there was an endianness bug in the UDP protocol handling, which is fixed here.
* Converted rest of transports to nng_err.Garrett D'Amore2025-04-27
|
* Converted property functions to use nng_err.Garrett D'Amore2025-04-27
|
* Transport listen: use nng_errGarrett D'Amore2025-04-27
|
* AIO: Use nng_err for cancellation callback instead of int.Garrett D'Amore2025-04-27
| | | | | | This is part of our work to improve type safety/awareness, and also improve debugger support, for NNG error codes. There are still quite a few more but this should help.
* api: pipes should use nng_errGarrett D'Amore2025-01-14
|
* fix for potential leaking connectionsGarrett D'Amore2024-12-26
|
* tcp: use nni_aio_startGarrett D'Amore2024-12-26
|
* transports: all transports use the new inline approachGarrett D'Amore2024-12-15
| | | | | | We can retire the old approach that used separate allocations, and all of the supporting code. This also gives us a more natural signature for the end point initializations.
* tcp transport: use preallocated SP objectsGarrett D'Amore2024-12-15
| | | | This follows a pattern we started earlier with IPC.
* tcp transport: inline aios (eliminate failure paths)Garrett D'Amore2024-12-15
|
* streams: add explicit stop functionsGarrett D'Amore2024-12-12
| | | | | | | | | | | | This allows us to explicitly stop streams, dialers, and listeners, before we start tearing down things. This hopefully will be useful in resolving use-after-free bugs in http, tls, and websockets. The new functions are not yet documented, but they are nng_stream_stop, nng_stream_dialer_stop, and nng_stream_listener_stop. They should be called after close, and before free. The close functions now close without blocking, but the stop function is allowed to block.
* tcp: implement ep stopGarrett D'Amore2024-12-11
|
* tcp: remove NNG_OPT_URLGarrett D'Amore2024-11-23
|
* Collect the bound port as part of the URL at bind time.Garrett D'Amore2024-11-21
| | | | This is a step on cleaning up our logic around NNG_OPT_URL.
* URL u_port should be a number not a string.Garrett D'Amore2024-11-17
| | | | | | | | | | | The idea here is to reduce the dynamic allocations used for URLs, and also the back and forth with parsing begin strings and port numbers. We always resolve to a port number, and this is easier for everyone. The real goal in the long term is to eliminate dynamic allocation of the URL fields altogether, but that requires a little more work. This is a step in the right direction.
* tcp/tls: Remove support for local interface address in dialer URLsGarrett D'Amore2024-11-17
| | | | | This was an undocumented capability provided for libnanomsg. The correct way to obtain the same functionality is to use `NNG_OPT_LOCADDR`.
* Remove registration functions (unused).Garrett D'Amore2024-11-04
|
* Free SP protocol streams before discarding aio objects.Garrett D'Amore2024-05-30
| | | | | | | | This seems to alleviate the use after free crashes, although it does not seem like it should. Current theory is that this closes the handle ensuring that it is unregistered from the I/O subsystem, thus preventing callbacks from firing and referring to objects that have been freed.
* Another attempt at the close deadlock, fix use-after-free.Garrett D'Amore2024-05-30
| | | | | | | | When closing pipes, we defer them to be reaped, but also leave them in the match list where they might be picked up by ep_match, or leak. It's best to reap these proactively and ensure that they are not allowed to life longer once they have errored during the negotiation phase.
* Logging improvements (#1816)Garrett D'Amore2024-04-21
| | | | | | | | | | | | * Add nng_str_sockaddr to get string representation of socket address. * Added nng_log_get_level() is meant to allow users to obtain the current level and avoid some possibly expensive operations just to collect debugging information when debugging is not in effect. We use a custom logger for NUTS, and this fits within the NUTS test framework well, so that if -v is supplied we get more content. All tests now get this by default.
* Log messages when peer sends too large message.Garrett D'Amore2024-04-17
| | | | | Also while here, remove unused sockaddr members from some structs. This should save a bit of memory for servers with a lot of conns.
* fixes #1496 Provide NNG_ENABLE_IPV6 option (disabled by default)Garrett D'Amore2024-02-25
| | | | | | | | | This also checks if the build system has the definitions for AF_INET6, which might help in some embedded IPv4 only settings. The resolver test is enhanced to include a check for IPv6 enabled in the kernel. IPv6 support is enabled by default, of course.
* tcp and tls: setting recv max on endpoint does not change pipesGarrett D'Amore2023-12-29
| | | | | Again, this was racy code, and not well tested. Set this option before starting the endpoint if you need to be sure.
* fixes #1713 SP pipe_send leaks message if aio is canceledGarrett D'Amore2023-11-26
|
* Minor formatting fix.Garrett D'Amore2023-02-07
|
* Revert "fixes#1175 nng_listen occasionally fails when reusing ipc socket on ↵Garrett D'Amore2023-02-05
| | | | | | Windows (#1562)" This reverts commit 1892e1d6d102d1fbd37e2c3bbb59dc35d81c8b33.
* src: sp: tcp: Finish receive aio on close (#1636)Dmitry Shifrin2023-02-05
| | | | Finish receive aio on tcp pipe close
* fixes#1175 nng_listen occasionally fails when reusing ipc socket on Windows ↵Garrett D'Amore2023-02-05
| | | | (#1562)
* fixes #1518 Disconnect during negotiation breaks listenerGarrett D'Amore2021-10-16
|
* Fix premature transport registration. Mark it deprecated.Garrett D'Amore2021-08-01
| | | | | | | Originally the idea was to better support having the transports be separate loadable modules. This isn't needed for the builtin transports, so we make the explicit initialization of them deprecated, and document it as such.
* Simplify the SP transport initialization process.Garrett D'Amore2021-07-31
|
* More symbol renamingGarrett D'Amore2021-07-11
|
* More work on moving SP stuff out of common. Remove unused defs.Garrett D'Amore2021-07-10
|
* fixes #1421 Failure in tcp and tls local source handlingGarrett D'Amore2021-02-07
|
* fixes #1345 Restructure the source treeGarrett D'Amore2021-01-01
This is not quite complete, but it sets the stage for other protocols (such as zmq or mqtt) to be added to the project.