| Previous | Next |
| ERROR_MORE_WRITES | ERROR_FLOPPY_ID_MARK_NOT_FOUND |
ERROR_COUNTER_TIMEOUT
A serial I/O operation completed because the timeout period expired.
ERROR_COUNTER_TIMEOUT is Win32 error 1121 (0x461). It describes a timeout completion for IOCTL_SERIAL_XOFF_COUNTER: the configured time interval elapsed and the counter did not reach zero. The result is therefore about one specialized serial control request, not a universal read or write timeout.
What the result implies
The serial stack accepted the XOFF counter request but did not observe enough qualifying transmission progress before the request-specific timer expired. The port can still be present and otherwise operational. Interpretation depends on the counter value, concurrent writes, flow-control state, and whether the connected peer stopped the transmitter.
- the application did not submit the expected amount of output after starting the counter
- hardware or software flow control prevented queued bytes from leaving the port
- the timeout was shorter than the worst-case transmission time for the configured baud rate
- writes were cancelled, purged, or redirected to a different handle
- the device or driver stalled while the request remained pending
Information required for diagnosis
- baud rate, frame format, DCB flow-control flags, and cable or virtual-link type
- XOFF character, initial counter, timeout value, and expected byte production rate
- queued and completed write lengths during the timer window
- CTS, DSR, XON/XOFF, and hold-state information returned in communications status
- the precise completion mechanism used by
GetOverlappedResultor an I/O completion port
Calculate whether the timeout was physically achievable. A large counter at a low baud rate can expire even when the port is healthy. Add protocol framing and flow-control pauses to that estimate rather than comparing only raw bytes per second.
Recovery and retry policy
A retry is reasonable only after deciding why progress stopped. If the timeout is a normal protocol guard, report it to the higher-level state machine and resynchronize with the peer. If output is held by CTS or XOFF, wait for the documented release condition instead of repeatedly creating new counters.
Never reuse an OVERLAPPED structure while the timed-out operation can still complete or be cancelled. Ensure that cancellation has been observed, drain stale completions, and preserve request generation identifiers so an old result cannot modify a new transaction.
Developer checks
- log submission and completion timestamps from a monotonic clock
- track each pending serial request by handle and unique operation ID
- surface flow-control holds separately from generic timeouts
- test at the slowest supported baud rate and with intentionally asserted CTS/XOFF
- avoid translating 1121 into a network timeout message that hides the serial context
Contrast with ERROR_MORE_WRITES
ERROR_MORE_WRITES identifies successful depletion of the XOFF counter by another write. ERROR_COUNTER_TIMEOUT identifies expiration before depletion. The two results describe alternative completion causes for the same IOCTL and should drive different protocol decisions.
Example
A modem-control application requests an XOFF counter of 256 characters with a one-second timeout while the port runs at 1200 baud and CTS is intermittently low. The counter cannot drain in time, so 1121 is expected. Increasing retries does not improve throughput; the timeout and flow-control assumptions must be corrected.
References
- Microsoft: System Error Codes (1000–1299)
- Microsoft: IOCTL_SERIAL_XOFF_COUNTER
- Microsoft: Communications errors
Looking for a different code? Search another status or error code.
