mIRC Homepage
Posted By: Sephiroth_ Connecting to Server - 23/10/10 06:39 PM
I had some problems with some scripts after updating to 7.14 so i had to change some stuff.
After restarting mIRC several times in a short time i got the errormessage:

* Connecting to IP (6667)
* Unable to connect to server (Address already in use)

After 2 two minutes of waiting i changed the IP to the FQDN and i was able to connect without a problem, after ~30 minutes i tried to reconnect to it using the IP address and it worked fine.

I hope it helps. wink
Posted By: drum Re: Connecting to Server - 25/10/10 08:10 AM
Is this a one-time occurrence or is it happening regularly? It sounds like mIRC was trying to use a local port that was not free yet.
Posted By: Sephiroth_ Re: Connecting to Server - 27/10/10 05:05 AM
Happens often, i connect to the same Server twice. A Bouncer.

Just restarted mIRC this time:
Code:
[07:06am] * Connect retry #3 IP (6667)
[07:06am] * Unable to connect to server (Address already in use)
[07:06am] * Connect cancelled
[07:06am] * Connecting to FQDN (6667)
[07:06am] -shroudbnc.info- *** 
Posted By: Riamus2 Re: Connecting to Server - 27/10/10 11:36 AM
If that only happens with the bouncer, then it's probably related more to that than to mIRC. But maybe someone knows more about that error than I do.
Posted By: Sephiroth_ Re: Connecting to Server - 27/10/10 04:08 PM
Connected to another server using /server -m 213.131.156.50 (thats wineasy1.se.quakenet.org) typed at the new connection just /server

Code:
[06:06pm] * Disconnected
[06:06pm] * Connecting to 213.131.156.50 (6667)
[06:06pm] * Unable to connect to server (Address already in use)
[06:06pm] * Connect retry #1 213.131.156.50 (6667)
[06:06pm] * Unable to connect to server (Address already in use)
[06:07pm] * Connect retry #2 213.131.156.50 (6667)
[06:07pm] * Unable to connect to server (Address already in use)
[06:08pm] * Connect retry #3 213.131.156.50 (6667)
[06:08pm] * Unable to connect to server (Address already in use)

Posted By: x64 Re: Connecting to Server - 08/11/10 09:18 AM
I would do a "netstat -a" at a command prompt and see how many ports you have in use. It sounds like you're running out of local ports somehow or you have a piece of software specifically making the attempt to open the port fail (software firewall).
Posted By: Sephiroth_ Re: Connecting to Server - 08/11/10 04:49 PM
I have tested around a bit more with it, it happens only if Server Connections is checked under Port Range and Randomize Ports is turned off. Well it shouldn't display this message until all available ports under the range are really in use.

I've set the range to a high value of available ports so this shouldn't happen but it does, no firewall is blocking it.

It happens under Win7 and WinXP with a clean mIRC installation.
Posted By: argv0 Re: Connecting to Server - 08/11/10 06:39 PM
Well there's your problem.

Checking "server connections" under port range makes mIRC use the ports in said port range for its local port. Obviously the next port in the range was in use when you tried to connect. Do you have multiple copies of mIRC running? Alternately, did you connect to more servers than your port range can support? My port range is 1024-1030. With the "Server Connections" setting on, I am only able to connect to 6 servers, and that assumes I have no DCCs active.

I can reproduce this if the port is in use, as expected. However I can't reproduce this with a single mIRC and no applications using that port range. It only happened once when I reconnected quickly, but likely the TCP connection was not yet fully closed in that attempt. It resumed functioning in the very next attempt. If that's the behaviour you're seeing for extremely fast reconnects, that's somewhat normal, but it shouldn't happen more than once in a row.

In short, don't check "Server Connections" unless you know what you're doing. It works as intended, but it probably is not what you want.
Posted By: Sephiroth_ Re: Connecting to Server - 08/11/10 07:07 PM
I have just one copy of mIRC running, (while testing two on the xp box and just one the win7)

I'm not connecting to more servers, i'm connecting to the same server ip twice. (A bouncer as mentioned before)

And the problem appears after each start of mIRC, i don't wanna turn it off for Server Connections, because it worked without any problem in previous versions.

I want to limit the amount of the connections mIRC is able to establish, including server connections and dccs. But i don't want to use 'workarounds' for a feature that worked in previous versions.

My settings are set to 15 connections where i connect to 4 servers (2 bouncer connectons, 2 irc servers directly) with a simple remote script, so this shouldn't produce this errormessage at every startup.
Posted By: drum Re: Connecting to Server - 09/11/10 01:51 PM
Originally Posted By: argv0
It only happened once when I reconnected quickly, but likely the TCP connection was not yet fully closed in that attempt. It resumed functioning in the very next attempt. If that's the behaviour you're seeing for extremely fast reconnects, that's somewhat normal, but it shouldn't happen more than once in a row.


This is NOT somewhat normal. mIRC should be checking the port to make sure it is actually available for use before attempting to use it. mIRC should skip over the currently unavailable port and use the next one in the port range, unless all of them are in use. mIRC assuming the port is available just because it is not using it anymore is a bug.
Posted By: Khaled Re: Connecting to Server - 10/11/10 04:47 PM
Thanks, I was able to reproduce this issue. It looks like there is a bug in the port handling routine that has made it through all of the v7.x betas. I still need to do more testing to confirm.

By default, the Port range option is enabled for "DCC Send, Get, and Chat conections" and the "Randomize" option is not enabled, so this issue affects all users who have not changed the default settings.
Posted By: MeStinkBAD Re: Connecting to Server - 10/11/10 09:23 PM
Originally Posted By: Sephiroth_
I want to limit the amount of the connections mIRC is able to establish, including server connections and dccs. But i don't want to use 'workarounds' for a feature that worked in previous versions.

My settings are set to 15 connections where i connect to 4 servers (2 bouncer connectons, 2 irc servers directly) with a simple remote script, so this shouldn't produce this errormessage at every startup.


Why are you doing this? mIRC is going to use the same number of connections. You end up creating 32 connections total (15 + 2 + 13 + 2). And this is BEFORE you initialize DCC.
Posted By: Sephiroth_ Re: Connecting to Server - 25/12/10 08:46 AM
The fix for 7.16/7.17 works so far, i haven't encountered the problm anymore.

Thanks. smile
© mIRC Discussion Forums