mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
New mIRC taking much longer on opening sockets #225004 23/08/10 07:16 PM
Joined: Jul 2006
Posts: 242
H
HaleyJ Offline OP
Fjord artisan
OP Offline
Fjord artisan
H
Joined: Jul 2006
Posts: 242
Hi all,

I have just noticed that my sockets are taking ages to open. I then realised it is only since I downloaded the new version. I have used this code on mIRC 6.35 and on mIRC 7.1 and got two vastly different results.

Code:
alias test_socket {
  set -e %socket_time $ticks
  sockopen test_socket www.google.com 80 
}
on *:sockopen:test_socket:{ 
  echo $color(info) -a It took  $calc(($ticks - %socket_time) / 1000) seconds for $sockname to open.
  unset %socket_time 
  sockclose $sockname
}


mIRC 7.1 returned It took 15.031 seconds for test_socket to open.

mIRC 6.35 returned It took 0.078 seconds for test_socket to open.

I find it very troubling, and wonder what the problem could be.


Newbie
Re: New mIRC taking much longer on opening sockets [Re: HaleyJ] #225007 23/08/10 07:33 PM
Joined: Dec 2002
Posts: 339
D
drum Offline
Fjord artisan
Offline
Fjord artisan
D
Joined: Dec 2002
Posts: 339
Can you identify whether the connection is successful or not? What error (if any) is reported if you use this code?

Code:
alias test_socket {
  set -e %socket_time $ticks
  sockopen test_socket www.google.com 80 
}
on *:sockopen:test_socket:{
  echo -a Time: $calc(($ticks - %socket_time) / 1000) seconds
  unset %socket_time 
  if ($sockerr > 0) {
    echo -a Connection failed: $sockerr / $sock($sockname).wsmsg
    return
  }
  echo -a Connection successful
  sockclose $sockname
}

Re: New mIRC taking much longer on opening sockets [Re: HaleyJ] #225008 23/08/10 07:33 PM
Joined: Dec 2002
Posts: 122
S
STING Offline
Vogon poet
Offline
Vogon poet
S
Joined: Dec 2002
Posts: 122
Can't reproduce it here.
7.1 is slower, but not noticable.

Do you have the UPnP settings enabled?

mIRC 7.1:
It took 0.063 seconds for test_socket to open.
It took 0.062 seconds for test_socket to open.
It took 0.078 seconds for test_socket to open.
It took 0.062 seconds for test_socket to open.
It took 0.062 seconds for test_socket to open.
It took 0.063 seconds for test_socket to open.
It took 0.078 seconds for test_socket to open.
It took 0.062 seconds for test_socket to open.
It took 0.078 seconds for test_socket to open.
It took 0.062 seconds for test_socket to open.
It took 0.078 seconds for test_socket to open.
It took 0.062 seconds for test_socket to open.
It took 0.078 seconds for test_socket to open.
It took 0.062 seconds for test_socket to open.

mIRC 6.35:
It took 0.032 seconds for test_socket to open.
It took 0.047 seconds for test_socket to open.
It took 0.046 seconds for test_socket to open.
It took 0.032 seconds for test_socket to open.
It took 0.046 seconds for test_socket to open.
It took 0.047 seconds for test_socket to open.
It took 0.031 seconds for test_socket to open.
It took 0.031 seconds for test_socket to open.
It took 0.047 seconds for test_socket to open.
It took 0.031 seconds for test_socket to open.
It took 0.031 seconds for test_socket to open.
It took 0.031 seconds for test_socket to open.

Re: New mIRC taking much longer on opening sockets [Re: HaleyJ] #225010 23/08/10 07:49 PM
Joined: Jul 2006
Posts: 3,588
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,588
Can't reproduce this either with OP code, it makes sense to me that the connexion is successful since it get a result

Last edited by Wims; 23/08/10 07:54 PM.

Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: New mIRC taking much longer on opening sockets [Re: Wims] #225011 23/08/10 07:52 PM
Joined: Dec 2002
Posts: 339
D
drum Offline
Fjord artisan
Offline
Fjord artisan
D
Joined: Dec 2002
Posts: 339
Originally Posted By: Wims
Can't reproduce this either with OP code, it makes sense to me that the connexion is successful since it get a result


The ON SOCKOPEN event will be triggered even if the connection fails. You must check $sockerr to find out.

Re: New mIRC taking much longer on opening sockets [Re: drum] #225012 23/08/10 07:54 PM
Joined: Jul 2006
Posts: 3,588
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,588
Oops, that's true.


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: New mIRC taking much longer on opening sockets [Re: drum] #225013 23/08/10 08:08 PM
Joined: Jul 2006
Posts: 242
H
HaleyJ Offline OP
Fjord artisan
OP Offline
Fjord artisan
H
Joined: Jul 2006
Posts: 242
I can confirm that the socket does open successfully.

mIRC 7.1 Returns

Time: 15.047 seconds
Connection successful

mIRC 6.35 Returns

Time: 0.031 seconds
Connection successful





Newbie
Re: New mIRC taking much longer on opening sockets [Re: HaleyJ] #225016 23/08/10 09:17 PM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
You didn't mention if you have upnp enabled. That is most likely the cause.


Invision Support
#Invision on irc.irchighway.net
Re: New mIRC taking much longer on opening sockets [Re: HaleyJ] #225017 23/08/10 09:23 PM
Joined: Dec 2002
Posts: 4,588
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 4,588
I have not been able to reproduce this so far. The connection is immediate in my tests. Which version of Windows are you using?

UPnP is unlikely to be the cause of any issues since UPnP is only used when mIRC needs to listen for an incoming connection not when opening an outgoing connection. However you can try disabling UPnP in the Options/Connect/Options/Ports dialog to see if that helps.

Also in the Ports dialog, if you disable the Port Range options, does that help?

Re: New mIRC taking much longer on opening sockets [Re: Khaled] #225034 24/08/10 08:40 AM
Joined: Jul 2006
Posts: 242
H
HaleyJ Offline OP
Fjord artisan
OP Offline
Fjord artisan
H
Joined: Jul 2006
Posts: 242
Hi,

Sorry for taking so long to reply.

I am using Windows XP Pro

I went to options/ports in 7.1 and could not find how to disable the range. I have enclosed a screenshot below, unless you want me to clear both boxes? not sure what you meant.

Also disabling uPNP had no effect!

Even if it is upnp why is mIRC6.35 not affected?

Many thanks.

http://img412.imageshack.us/img412/5692/mircscreenshot.jpg



Newbie
Re: New mIRC taking much longer on opening sockets [Re: HaleyJ] #225040 24/08/10 02:51 PM
Joined: Feb 2003
Posts: 307
T
tontito Offline
Fjord artisan
Offline
Fjord artisan
T
Joined: Feb 2003
Posts: 307
version 6.35 has no upnp support, that is why we were talking about it.

Re: New mIRC taking much longer on opening sockets [Re: HaleyJ] #225048 24/08/10 06:36 PM
Joined: Dec 2002
Posts: 4,588
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 4,588
Yes, if you could uncheck all boxes in the "Port Range" section and then let us know if that helps.

Re: New mIRC taking much longer on opening sockets [Re: Khaled] #225052 24/08/10 07:23 PM
Joined: Jul 2006
Posts: 242
H
HaleyJ Offline OP
Fjord artisan
OP Offline
Fjord artisan
H
Joined: Jul 2006
Posts: 242
Hi there,

Just did that and still get the same problem.

Time: 15.063 seconds
Connection successful

Regards,


Newbie
Re: New mIRC taking much longer on opening sockets [Re: HaleyJ] #225055 24/08/10 07:40 PM
Joined: Dec 2002
Posts: 2,962
S
starbucks_mafia Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
Have you tried disabling any anti-virus or firewall software that may be hampering mIRC in the name of security?

It could be you've added mIRC 6.35 to a whitelist previously.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Re: New mIRC taking much longer on opening sockets [Re: starbucks_mafia] #225062 24/08/10 08:21 PM
Joined: Jul 2006
Posts: 242
H
HaleyJ Offline OP
Fjord artisan
OP Offline
Fjord artisan
H
Joined: Jul 2006
Posts: 242
Hi starbucks,

I disabled windows firewall, and my AV, still the same result. I did the same with my routers firewall etc.

Take in mind mIRC 6.35 opens sockets instantly.

If it helps to debug I am happy for you to connect to my machine.

-

Time: 15.047 seconds
Connection successful

Its always seems to be round the 15 second mark for some reason.


Last edited by HaleyJ; 24/08/10 08:35 PM.

Newbie
Re: New mIRC taking much longer on opening sockets [Re: HaleyJ] #225084 25/08/10 11:05 AM
Joined: Dec 2002
Posts: 122
S
STING Offline
Vogon poet
Offline
Vogon poet
S
Joined: Dec 2002
Posts: 122
Maybe it's an option to use a network analyzer like Wireshark, to see what the difference in behaviour is between 6.35 & 7.1.

Re: New mIRC taking much longer on opening sockets [Re: HaleyJ] #225090 25/08/10 04:11 PM
Joined: Mar 2008
Posts: 87
B
BhaaL Offline
Babel fish
Offline
Babel fish
B
Joined: Mar 2008
Posts: 87
I also noticed this with my HTTP-Check script (checks an URL and tells me the title, or whether it redirects to a potentially dangerous site).

6.35 was pretty quick, 7.1 takes considerably longer. I also noticed this with /dns queries, so I think it might be related to that (remember that IPv6 is now available from within mIRC).

UPnP is disabled, all ports in the configuration are unchecked, and I don't have a firewall that could affect this.

Re: New mIRC taking much longer on opening sockets [Re: BhaaL] #225097 25/08/10 06:23 PM
Joined: Jul 2006
Posts: 242
H
HaleyJ Offline OP
Fjord artisan
OP Offline
Fjord artisan
H
Joined: Jul 2006
Posts: 242
Originally Posted By: BhaaL
I also noticed this with my HTTP-Check script (checks an URL and tells me the title, or whether it redirects to a potentially dangerous site).

6.35 was pretty quick, 7.1 takes considerably longer. I also noticed this with /dns queries, so I think it might be related to that (remember that IPv6 is now available from within mIRC).

UPnP is disabled, all ports in the configuration are unchecked, and I don't have a firewall that could affect this.


Could you tell us the result when you execute the following code, both in 6.35 and in 7.1

Code:
alias test_socket {
  set -e %socket_time $ticks
  sockopen test_socket www.google.com 80 
}
on *:sockopen:test_socket:{
  echo -a Time: $calc(($ticks - %socket_time) / 1000) seconds
  unset %socket_time 
  if ($sockerr > 0) {
    echo -a Connection failed: $sockerr / $sock($sockname).wsmsg
    return
  }
  echo -a Connection successful
  sockclose $sockname
}


Usage /test_socket


Newbie
Re: New mIRC taking much longer on opening sockets [Re: HaleyJ] #225152 26/08/10 04:43 PM
Joined: Mar 2008
Posts: 87
B
BhaaL Offline
Babel fish
Offline
Babel fish
B
Joined: Mar 2008
Posts: 87
Code:
Time: 0.172 seconds
Connection successful


I did some testing with /dns using the same piece of code (except /dns instead of /sockopen, and on DNS instead of on SOCKOPEN). The first request for a domain takes 10+ seconds, the following ones are quick (cached?)
I guess its the same thing when doing /sockopen domain.tld instead, since someone needs to resolve the IP first.

Re: New mIRC taking much longer on opening sockets [Re: BhaaL] #225153 26/08/10 04:45 PM
Joined: Jun 2007
Posts: 933
5
5618 Offline
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
Originally Posted By: BhaaL
I guess its the same thing when doing /sockopen domain.tld instead, since someone needs to resolve the IP first.
Which obviously means his tests should be as fast as in 6.35 when he uses one of the IPs of www.google.com
We'll see...

Page 1 of 2 1 2