Tcl Source Code

View Ticket
Login
Ticket UUID: 59e7e7fdfbcd8ee34a5a51a9a83990c7115ecc03
Title: socket -async throws when the connect fails at once (illumos)
Type: Bug Created on: 2026-10-12 08:10:00
Submitter: serhiy.storchaka Assigned to: jan.nijtmans
Subsystem: 27. Channel Types Severity: Minor
Priority: 5 Medium Last modified: 2026-10-18 20:26:48
Status: Closed Closed by: jan.nijtmans
Resolution: Fixed Closed on: 2026-10-18 20:26:48
Version: 9.1.0
Description:

On illumos (OpenIndiana), a non-blocking connect() to a local port without a listener fails at once with ECONNREFUSED instead of EINPROGRESS. Then socket -async throws couldn't open socket: connection refused instead of returning a channel which reports the failure with fconfigure -error and the writable event, as socket(n) describes. This fails socket-14.2, 14.7.2, 14.8.2, 14.11.0, 14.12, 14.14-14.18 and http-4.14.

This was seen on Solaris before ([3428754]: test socket-14.2 was made to accept the error), but since the 2014 rework the tests expect the error to be reported only by fconfigure -error ([42d50ebd0c]).

Proposed fix in branch unix-async-connect-immediate-failure: an async connect which fails at once is reported like a failure in the background. socket-14.11.1, 14.16 and 14.17, which need the connect to be still in progress, get a new constraint asyncConnectPending.

User Comments:
jan.nijtmans added on 2026-10-18 20:26:48:

Fixed in [trunk], backported to core-9-0-branch

Many thanks!