Codeux Software and its projects are no longer maintained at a full-time capacity.
This article may contain information which is no longer accurate or relevant.
Users of Textual can find a community driven support channel on
Libera Chat.
Sorry for any inconvenience.
Connecting to IRC involves multiple steps from the moment Textual initiates a
connection to when the data reaches a server. Understanding these steps can
help diagnose connectivity issues, including network timeouts. The process can be
broken down into three steps: initiating the connection, routing to the destination,
and data arriving at the destination.
Initiating the Connection: macOS
When Textual connects to a server, macOS first determines how to establish the connection. This involves:
- DNS Resolution: If connecting to a domain name (e.g., irc.example.com), macOS queries a Domain Name System (DNS) server to resolve the domain to an IP address.
- Socket Creation: macOS creates a network socket, which acts as an endpoint for sending and receiving data.
- Protocol Selection: Depending on server settings, the connection may use IPv4 or IPv6.
- TCP Handshake: macOS initiates a Transmission Control Protocol (TCP) handshake with the server.
- TLS Encryption: If the server supports Transport Layer Security (TLS), an additional handshake occurs to encrypt the communication.
Possible Timeouts at This Stage
- DNS Failure: If the DNS server does not respond, the connection cannot be established.
- Firewall/Local Network Issues: If a firewall blocks the connection, the TCP handshake will not complete.
- TLS Handshake Failure: If the security certificate is invalid or incompatible, the connection may be rejected.
- Resource Exhaustion: macOS may refuse to create a network socket because too many are already open, memory is low, the battery is empty, or the system is sleeping.
Routing to Destination: The Data's Journey Across Networks
Once the connection is established, data must travel across various networks to reach the server. This process includes:
- Local Network Transmission: The data first travels from your Mac to your router via Ethernet or Wi-Fi.
- ISP Routing: The router forwards the data to your internet provider, which directs it through its infrastructure.
- Internet Backbone: The data is passed between multiple intermediary networks that make up the global internet.
- Final ISP Hop: The data reaches the internet provider that hosts the server.
Possible Timeouts at This Stage
- Packet Loss: If a network along the path is congested or malfunctioning, a message may be delayed or lost.
- TTL Expiration: Each message has a Time-to-Live (TTL) value that decreases with every network it passes through.
If it reaches zero before arriving at the server, it is discarded.
Data Arriving at Destination: Reaching the Server
Once the data reaches the server, the final steps involve:
- Server Processing: The server processes the incoming request and verifies that Textual is allowed to connect.
- Data Flow: Messages, commands, and responses are transmitted between Textual and the server.
Possible Timeouts at This Stage
- Server Overload: If the server is under heavy load, it may take too long to respond.
- Idle Timeouts: If the connection remains inactive for too long, the server may close it.
- Firewall Rules: The server may block certain internet providers or fail to respond if under lockdown.
Understanding these steps can help diagnose connection issues by pinpointing where the failure or delay occurs.
Whether it is a DNS issue, network congestion, or a server-side timeout, knowing how data moves through the network
can lead to more effective troubleshooting.
Configuring Textual
With a clearer understanding of networking and the potential causes of connection issues, you can now
adjust various settings in Textual to improve connection stability:
Per-Server Connection Preferences
Several settings that can be configured in the Advanced section of Server Properties (Command + U). These include:
Connection Type: IPv4 / IPv6 / Automatic
IPv4 and IPv6 are different protocols for establishing connections. IPv4 requires more network routing, which can sometimes introduce latency or other side effects. However, this doesn’t always lead to disconnections.
Experimenting with this setting may help, but keep in mind that not all internet providers support IPv6.
Periodically PING the server to verify the connection
If no data is received from the server within a certain time period, then Textual sends a test message to confirm the connection is still active. It is recommended to keep this setting enabled.
Force a disconnect when no PING response is received
If the server does not respond to a test message within a certain time period, then the connection is disconnected to allow faster reconnect. It is recommended to keep this setting enabled.
Force a disconnect on reachability changes
If Textual detects an internet disruption (e.g., losing Wi-Fi connection), it will automatically disconnect from the server. Textual will notify you if this is the reason for the disconnection. It is recommended to keep this setting enabled.
Legacy Sockets
By default, Textual uses Apple’s Network framework to manage connections. If you are unfamiliar with this, don’t worry.
Just know that Textual can be configured to bypass it. To do so, navigate to “Hidden Preferences” in the Help menu.
Uncheck “Prefer modern sockets.” This setting forces Textual to use an alternative method for establishing connections.
Why One IRC Client May Stay Connected While Textual Times Out
Several factors can contribute to one client maintaining a stable connection while Textual experiences frequent timeouts:
- Network Configuration Differences: Different clients may be configured to use different connection methods, such as IPv4 vs. IPv6, SSL/TLS vs. plain text, or different DNS servers.
- Keep-Alive Settings: Different clients may use different timeout values for PING responses. If a client expects a response too quickly and does not receive one, it may assume the connection is lost and disconnect, while another client with a longer timeout setting remains connected.
- Firewall and NAT Handling: A router or firewall may treat different clients differently based on their connection type, port usage, or security settings, potentially interfering with one but not the other.
- ISP-Specific Routing Issues: If one client is using a different network route due to DNS configuration, proxy, or VPN usage, it may have a more stable connection than another client on the same network.
- Server-Side Configuration: Some servers enforce stricter timeout rules for certain connection types or may prioritize specific clients based on their behavior.
Understanding these differences can help troubleshoot why one client stays connected while Textual times out.