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
How about:
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.
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
I always thought that a socket would close by itself when its task was completed.
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.
I guess losing the internet connexion is also a way.
You never lose your sense of whimsicality :P