Skip to content

Connecting timeout issue #116

@ghost

Description

Dear Kirc Staff:

I would like to suggest a small modification. It does appear that in some cases kirc gets stuck while trying to connect to a remote host that may have strong firewall policies. I can think of this example:

./kirc -s www.google.com -n test

Kirc will be hanged and will wait for remote host response for a very long period of time. I recommend the following solutions (requires including <sys/time.h>):

Adding in line 669:

struct timeval timeout;
timeout.tv_sec = 3;
timeout.tv_usec = 0;

where a timeout of 3 seconds is set, and then adding the following to line 680:

setsockopt(conn, SOL_SOCKET, SO_SNDTIMEO, &timeout, sizeof(struct timeval));

This will cause Kirc to exit and display an error message as a connecting timeout of 3 seconds is reached.

I'm open to feedback or ideas, and certainly discuss further if this is not a proper solution.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions