mIRC Homepage
Posted By: Wims new switch for /sockopen - 26/06/10 01:34 AM
I think having a switch that automatically close a connexion before trying to open it for /sockopen would be a good idea, same for /socklisten
Posted By: ziv Re: new switch for /sockopen - 26/06/10 08:25 AM
How about:

Code:
alias sockopen {
  if $left($1,1) == - && $sock($2) != $null sockclose $2 | sockopen $1-
  elseif $sock($1) != $null sockclose $1 | sockopen $1-
}

alias socklisten {
  if $left($1,1) == - && $sock($2) != $null sockclose $2 | socklisten $1-
  elseif $sock($1) != $null sockclose $1 | socklisten $1-
}


That would make sure whenever you try to open an existing sock, that sock will be closed first, then opened-anew.

Good luck,
ziv.
Posted By: Wims Re: new switch for /sockopen - 26/06/10 12:19 PM
Yeah, and almost anyone could write is own code for the suggestion he is making, the point is that this one is over-used, I'm pretty sure that 99% of the time, people just do /sockclose name | sockopen name ip port, which is fine, but it would make a lot of sense to have this built-in
Posted By: Tomao Re: new switch for /sockopen - 26/06/10 03:23 PM
I always thought that a socket would close by itself when its task was completed.
Posted By: Wims Re: new switch for /sockopen - 26/06/10 04:27 PM
Well, a socket never close itself afaik, it's either you or the person you're connected to that close it, but I guess losing the internet connexion is also a way.
Posted By: Jigsy Re: new switch for /sockopen - 26/06/10 04:53 PM
I second this.
Posted By: Tomao Re: new switch for /sockopen - 26/06/10 06:13 PM
Originally Posted By: Wims
I guess losing the internet connexion is also a way.
You never lose your sense of whimsicality :P
© mIRC Discussion Forums