aboutsummaryrefslogtreecommitdiff
path: root/src/platform/windows/win_tcpdial.c
Commit message (Collapse)AuthorAge
* Remove the ability to get sockaddrs from endpoints.Garrett D'Amore2025-10-27
| | | | | There is no valid use for this, once we added the ability to query the bound port.
* Add stream direct address functions for socket addresses.Garrett D'Amore2025-10-25
| | | | | | | | This is going to be used to facilitate debugging, and eliminate some inconveniences around these things. We plan to move the pipe functions to use these directly, hopefully moving away from the pipe_getopt hack. (The transport API will need to grow these. For now this is just the streams.)
* Converted property functions to use nng_err.Garrett 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.
* resolver: use explicit resolver item provided by callerGarrett D'Amore2024-12-28
| | | | | | This avoids the need to perform multiple allocations for dialing, eliminating additional potential failures. Cancellation is also made simpler and more perfectly robust.
* windows tcp: fix compilation warningGarrett D'Amore2024-12-28
|
* windows tcp: Lookup extended TCP function pointers at startupGarrett D'Amore2024-12-28
| | | | | | This avoids the need for a lock during listener or dialer initialization, and it avoids the need to carry these pointers on those objects. It also eliminates a potential failure case "post startup".
* tcp: use nni_aio_startGarrett D'Amore2024-12-26
|
* 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.
* Remove untyped nng_pipe_get, support for untyped sockaddr set.Garrett D'Amore2024-11-03
| | | | This is a step on the path to removing unsafe untyped option accesses.
* remove legacy support for configuration of transport options on socketGarrett D'Amore2024-10-20
| | | | | | | | | Transport specific options should be configured on the end point. This has the most impact for TLS, as TLS dialers and listeners will need to be allocated apriori, to configure TLS options. Some legacy tests were removed... we're going to remove the legacy libnanomsg compatibility layer anyway.
* windows: drop the hEvent initialization for win_io structures.Garrett D'Amore2024-05-30
| | | | We use overlapped I/O, so we don't need a separate hEvent.
* 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.
* Replace nni_aio_prov_set_extra with nni_aio_prov_set_data.Garrett D'Amore2021-12-31
| | | | | | This takes one less parameter, and is simpler. It will let us reclaim the aio_prov_extra data space as well, so that we can use it for other purposes.
* fixes #1372 nni_reap could be smallerGarrett D'Amore2020-12-19
|
* fixes #1071 tran_chkopt can be cleaned upGarrett D'Amore2020-11-15
| | | | | | | | | | | | | | | | | This is a sweeping cleanup of the transport logic around options, and also harmonizes the names used when setting or getting options. Additionally, legacy methods are now moved into a separate file and can be elided via CMake or a preprocessor define. Fundamentally, the ability to set to transport options via the socket is deprecated; there are numerous problems with this and my earlier approaches to deal with this have been somewhat misguided. Further these approaches will not work with future protocol work that is planned (were some options need to be negotiated with peers at the time of connection establishment.) Documentation has been updated to reflect this. The test suites still make rather broad use of the older APIs, and will be converted later.
* fixes #1311 reduce wasted use for nni_aioGarrett D'Amore2020-10-31
| | | | | | | | | | fixes #1317 IPv6 listener get port is incorrect fixes #1319 Want symbolic service names This is phase 1 of reducing the memory foot-print of aios, and also of pipes. This removes the largest consumer the socket address information, from the aio, which was only used by a few consumers.
* fixes #1062 Windows client connections cannot get NNG_OPT_LOCADDRGarrett D'Amore2019-12-28
|
* fixes #879 Desire NNG_OPT_TCP_BOUND_PORTGarrett D'Amore2019-02-16
| | | | | | We also have made some support changes, including new APIs for printing URLs, and some improvements to the NNG_OPT_URL to make use of this new property.
* fixes #872 create unified nng_stream APIGarrett D'Amore2019-02-16
| | | | | | | | | This is a major change, and includes changes to use a polymorphic stream API for all transports. There have been related bugs fixed along the way. Additionally the man pages have changed. The old non-polymorphic APIs are removed now. This is a breaking change, but the old APIs were never part of any released public API.
* fixes #825 TCP public API should use generic setopt/getoptGarrett D'Amore2018-12-31
| | | | | | | | | | | | This changes much of the internal API for TCP option handling, and includes hooks for some of this in various consumers. Note that the consumers still need to have additional work done to complete them, which will be part of providing public "raw" TLS and WebSocket APIs. We would also like to finish addressing the call sites of nni_tcp_listener_start() that assume the sockaddr is modified -- it would be superior to use the NNG_OPT_LOCADDR option. Thaat will be addressed in a follow up PR.
* fixes #608 Add TCP support to specify local network interfaceGarrett D'Amore2018-08-27
| | | | | This also fixes a leaked TCP connection on a failure path, which we noticed while working this change.
* fixes #664 aio cancellation could be betterGarrett D'Amore2018-08-20
| | | | | | | | | This changes the signature of the aio cancellation routines to take the argument for cancellation directly, so we do not need to lookup the argument using the nni_aio_get_prov_data. We should probably consider eliminating nni_aio_get_prov_data, and co, and changing the prov_extra to reflect prov_data. Later.
* fixes #595 mutex leak and other minor errors in TCPGarrett D'Amore2018-07-18
| | | | | | | | | | | | | | | | fixes #596 POSIX IPC should move away from pipedesc/epdesc fixes #598 TLS and TCP listeners could support NNG_OPT_LOCADDR fixes #594 Windows IPC should use "new style" win_io code. fixes #597 macOS could support PEER PID This large change set cleans up the IPC support on Windows and POSIX. This has the beneficial impact of significantly reducing the complexity of the code, reducing locking, increasing concurrency (multiple dial and accepts can be outstanding now), reducing context switches (we complete thins synchronously now). While here we have added some missing option support, and fixed a few more bugs that we found in the TCP code changes from last week.
* fixes #523 dialers could support multiple outstanding dial requestsGarrett D'Amore2018-07-16
fixes #179 DNS resolution should be done at connect time fixes #586 Windows IO completion port work could be better fixes #339 Windows iocp could use synchronous completions fixes #280 TCP abstraction improvements This is a rather monstrous set of changes, which refactors TCP, and the underlying Windows I/O completion path logic, in order to obtain a cleaner, simpler API, with support for asynchronous DNS lookups performed on connect rather than initialization time, the ability to have multiple connects or accepts pending, as well as fewer extraneous function calls. The Windows code also benefits from greatly reduced context switching, fewer lock operations performed, and a reduced number of system calls on the hot code path. (We use automatic event resetting instead of manual.) Some dead code was removed as well, and a few potential edge case leaks on failure paths (in the websocket code) were plugged. Note that all TCP based transports benefit from this work. The IPC code on Windows still uses the legacy IOCP for now, as does the UDP code (used for ZeroTier.) We will be converting those soon too.