mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: May 2008
Posts: 7
A
av0ider Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
A
Joined: May 2008
Posts: 7
Hello,

I'm here to report a bug with $portfree and /socklisten - both of which continually return NO ports free, depending on the location of the folder in which mIRC is located.
I'm running mIRC 6.35, on Windows Vista (32 bit, ultimate, no service pack).

Two vanilla copies of mIRC, with no remote files loaded, and not connected to a server, are located in two different folders.
Both are being executed with the -portable switch.

Copy one is in C:\Users\av0ider\Desktop\mIRC
Copy two is in C:\Users\av0ider\Desktop\Stuff\mIRC


I'm typing the following lines in to the status window:

//echo -a $portfree(5555)
//socklisten test_socket

I open copy ONE.
On copy ONE, I receive results of:
$true
And no result on the second command - it finishes successfully.


I close copy one, and open copy TWO.
On copy TWO, I receive results of:
$false
* /socklisten: port error


These results are consistant after rebooting, opening copy TWO first, which still fails. Opening copy ONE and trying again results in success.

These results are not just for port 5555.
The following script has been loaded and tested on both copies:

Code:
alias port_test {

  var %x 5000
  
  while (%x <= 9000) {
  
    echo -a %x - $portfree(%x)
    inc %x
    
  }
  
}


Results were predictable: Nothing but $false on copy TWO, mostly $true but occasional $false on copy ONE.

This makes absolutely no sense to me whatsoever - there is no way a program is blocking all those ports, and this is reflected by copy ONE succeeding in listening on a socket.

It's not a big deal - I can solve the problem by just moving my folders around, and I'm happy with that - I just thought that you might like it called to your attention.

Hope this can be resolved. smile

Last edited by av0ider; 07/01/09 02:21 PM.
Joined: Apr 2004
Posts: 871
Sat Offline
Hoopy frood
Offline
Hoopy frood
Joined: Apr 2004
Posts: 871
Sounds like a local firewall, perhaps even Windows' built-in one..


Saturn, QuakeNet staff
Joined: May 2008
Posts: 7
A
av0ider Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
A
Joined: May 2008
Posts: 7
Windows firewall is disabled, no other software firewalls installed.
I can understand that it might prevent sockets from listening, but preventing the $portfree command? That sounds like odd behavior to me.

Joined: Apr 2004
Posts: 871
Sat Offline
Hoopy frood
Offline
Hoopy frood
Joined: Apr 2004
Posts: 871
As far as I know, part of the $portfree procedure is actually creating a listening socket on the requested port to see if that succeeds. That would certainly explain why $portfree behaves exactly like /socklisten.

Strange nonetheless. I can't think of anything within mIRC that could cause what you're seeing, i.e. it would have to be WinSock or even a lower layer that's blocking all sorts of listening access to one of your copies. But if you say you don't have any sort of firewall..


Saturn, QuakeNet staff
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
If you closed the mIRC process completely, you're showing that it is explicitly *not* a problem with mIRC but rather with some other component on your machine. The OS is responsible for releasing ALL handles (including sockets) when a program exits; if it does not, that would be a problem with the OS, not mIRC. Of course, as sat suggested, it could also be a firewall, anti-virus or even a trojan/virus.

You say you don't have any firewalls running-- do you have Norton or any other anti-virus software running?


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: May 2008
Posts: 7
A
av0ider Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
A
Joined: May 2008
Posts: 7
With both copies of mIRC open at once, I get a result of $false and $true on the revelant copies for
//echo -a $portfree(5555)
Or any random number.
It is not simply when running one copy of mIRC at a time. Just to test I made a Python script that does nothing but listen on a socket with the same port. It executes fine.

I have no firewall, antivirus, antimalware, or any such processes running on my machine.
The only process on my machine that interferes with network traffic (AFAIK, of course..) is an application called SteamWatch. The behavior of mIRC is the same with the service running or stopped.

Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
My point was that if you were able to reproduce this in the scenario you described above (the initial program with the open socket handle being closed but the socket handle not being released) it would imply that mIRC is not the problem.

I am unable to reproduce this on Vista x64 SP1. Can you list steps on how you managed to reproduce this with two instances of mIRC running at the same time?

Also list the results of typing the following in mIRC:

//echo -a $os $version $md5($mircexe,2) $script(0) $dll(0) $com(0) $isdde($ddename)


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: May 2008
Posts: 7
A
av0ider Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
A
Joined: May 2008
Posts: 7
I'm unable to reproduce this on my other two machines, either, but have had this problem on other machines in the past. I've previously assumed user error, but the fact that it happens repeatedly under similar circumstances (always after making a copy of an existing mIRC folder) seemed strange.

The way the situation came about was simple: An existing copy of mIRC with a few server-specific scripts was copied and pasted to another location, and those scripts deleted. From that point forwards, $portfree has seemed to fail on the second copy.

//echo -a $os $version $md5($mircexe,2) $script(0) $dll(0) $com(0) $isdde($ddename)

returns:
1) Vista 6.35 2f63a83968f9586fe4fb48134253619c 1 0 0 $true
1) Vista 6.35 2f63a83968f9586fe4fb48134253619c 1 0 0 $true

The only script loaded is the one I referred to earlier, testing $portfree.

Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Are your other 2 machines Vista as well?


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Dec 2002
Posts: 5,430
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,430
mIRC uses several methods to check whether a port is in use, one of which involves reading the local TCP table to see which connections are open and which ports are in use.

I can't think of any reason why the same copy of mIRC will work fine in one folder and not in another.

If one copy of mIRC is able to handle sockets without a problem and the other copy cannot, this usually indicates that Windows, or some other software on your computer, is blocking one of the copies of mIRC for some reason.

Joined: May 2008
Posts: 7
A
av0ider Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
A
Joined: May 2008
Posts: 7
I appreciate the replies, Sat, argv0, and Khaled.

Given your replies I can only assume that isn't mIRC's fault, and must be some component of Windows must be causing the issue.
I only wish it were a sensible problem that I could find the root cause for - it certainly doesn't seem to be any 3rd party (non-M$) services or applications, since I've tried disabling them all.

Oh well. No one ever said computers were logical. smirk

Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
I experienced an issue tonight I never had seen. av0ider suggested it was the same issue as this one. Sorry I cannot tell you how to reproduce it. If I could I'd have fixed it.

I use a few mirc's at once. They are all in their own folder. I am in a different house tonight on a different router. When I left home I connected just fine. When I got here I connected fine with other mirc's but one, which connects to 3 seperate servers, didn't connect.

I use /server irc.addres.com 6667 to connect with this one.

* Connect retry #1 irc.koach.com (6667) (dns pool)
-
* Unable to create socket

This was the error I recieved. This mIRC will not connect to any server for some reason. I can connect to the server on any other mirc. I use Vista Home Premium 6.0.6000. I have no AV software and Windows Firewall is off. UAC is off.

I'm replacing mIRC to fix it. Just thought you all would like to know. I've never seen this issue. Thank You.


Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Again, this error usually suggests something is wrong with Windows, not mIRC. mIRC uses standard calls to get socket handles-- the same way any program would. If this is failing, it means the OS is not giving mIRC a socket handle it requested, which either means its blocked by a firewall or it's exceeded its resource limit. Perhaps your mIRC exceeded some resource limit, in which case restarting it might help. The fact that other mIRC's work shows that it's not an issue with mIRC, just your specific scenario.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
Any other mIRC works fine. No firewall exists. Resources are just fine considering no other applications are running. (not including Windows processes) I restarted it many times.

But whatever, dismiss it if you like. I'm just wanting to let Khaled know about issues that are arising with Vista.

Joined: Feb 2003
Posts: 307
T
Fjord artisan
Offline
Fjord artisan
T
Joined: Feb 2003
Posts: 307
Hi,

I have never seen such behavior.
The only problem i can get is if you bind a socket, then you connect to it (client sockect), then close it and try to restart the binding.

Until the windows doesn't timeout the client socket that connected to your port you can't bind the same port (something that in my opinion makes no sence since you can have multiple client sockets if you don't restart a binding).
Old mirc versions (older then 6.03??) didn't have this limitation.

Otherwise it works just fine.


Link Copied to Clipboard