mIRC Home    About    Download    Register    News    Help

Print Thread
#90921 18/07/04 08:44 PM
Joined: Apr 2004
Posts: 66
C
Cyrex Offline OP
Babel fish
OP Offline
Babel fish
C
Joined: Apr 2004
Posts: 66
The mIRC help file says:

The sockopen event is triggered when a /sockopen command is successful and a connection has been made.


If I use I use the following script:

Code:
alias sreslv {
  sockopen reslv fgzdfdfdfds342fsdfsfdsdsfdsbbvbuh.net 6667
}


on *:SOCKOPEN:reslv:{
  echo -a Connected to IRC server!
  sockclose $sockname
}


mIRC triggers the on SOCKOPEN event as if it actually connected to the bogus address specified in my sreslv alias. That's not possible, since the address and port are not valid. Why is it triggering?

#90922 18/07/04 10:08 PM
Joined: Dec 2002
Posts: 774
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 774
help file also says:

$sockerr
$sockerr is set to a value after each socket command/event and must be checked after each socket command and before processing an event to see if an error occurred.


Is the on SOCKOPEN issue solved after reading that?

Last edited by theRat; 18/07/04 10:08 PM.

Code:
//if ( khaled isgod ) echo yes | else echo no
#90923 18/07/04 10:10 PM
Joined: Apr 2004
Posts: 66
C
Cyrex Offline OP
Babel fish
OP Offline
Babel fish
C
Joined: Apr 2004
Posts: 66
Hmmm, I always thought that if the socket could not connect to the destination address, the on SOCKOPEN event would not trigger. That would be the logical thing to do anyway...

#90924 18/07/04 10:36 PM
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
I'm guessing the socket would still open (considering there's no way of knowing if the address exists without opening a socket), then it will return an error in $sockerr if the address doesn't exist.


New username: hixxy

Link Copied to Clipboard