set sock [socket <address> <port>]
how do i make a timeout? if it not is connected in 10 sec i want it to take next.. like php: fsockopen($adress, $port ,$errno, $errstr, 2);
Your example is using Tcl sockets. You should use the -async option so that it returns immediately. Then set a timer for 10 seconds. If the socket hasn't connected before the timer executes, then kill it. If the socket does connect, kill the timer. See?
If you want to use eggdrop sockets, which are automatically asynchronous/nonblocking, you do the same thing.
In both cases, make sure you look up the domain name *first* because they will both block for that operation.