<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/9722" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2005-05-30T19:13:26-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/9722</id>

		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2005-05-30T19:13:26-04:00</updated>

		<published>2005-05-30T19:13:26-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=50001#p50001</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=50001#p50001"/>
		<title type="html"><![CDATA[socket timeout]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=50001#p50001"><![CDATA[
read demonds post again.<br>All my scripts using real async connection are using IPs for connect and socket.<br><br>check as example my google script:<div class="codebox"><p>Code: </p><pre><code>dnslookup www.google.de getgoogledns:cbdnslookup www.filemirrors.com getfmdns:cbproc getgoogledns:cb {ip host status} { set ::googleip $ip }proc getfmdns:cb {ip host status} { set ::fmip $ip }</code></pre></div>This is running when the script is loaded, however, you could use dnslookup everytime, but that would only be necesarry for dynamic IPs, not for static IPs <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile">.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2382">De Kus</a> — Mon May 30, 2005 7:13 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ex]]></name></author>
		<updated>2005-05-30T15:51:05-04:00</updated>

		<published>2005-05-30T15:51:05-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=49994#p49994</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=49994#p49994"/>
		<title type="html"><![CDATA[socket timeout]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=49994#p49994"><![CDATA[
i am pretty sure because changed the program to fileevents<br><div class="codebox"><p>Code: </p><pre><code>proc test:rss { url port get offset } {        global noff        set ::sid [socket $url $port]        set noff($::sid) 1        fconfigure $::sid -buffering line -blocking 0        fileevent $::sid readable "gotdata $::sid $offset"        puts $::sid "GET $get HTTP/1.0"        puts $::sid "User-Agent: bot by ex"        puts $::sid "Host: $url"        puts $::sid "Connection: close"        puts $::sid ""        flush $::sid}proc gotdata { sid offset } {        global noff geturl        if {[gets $sid bl] &gt; 0} {                putlog "$bl $noff($sid)"                if {[regexp {^.*&lt;title&gt;(.+?)&lt;/title&gt;.*} $bl num title]} {                        if {$noff($sid) &lt; $offset} {                                incr noff($sid)                        } else {                                set geturl($sid) $title                        }                } elseif { [regexp ^.*link&gt;(.+?)&lt;/link.* $bl num link] &amp;&amp; [info exists geturl($sid)] } {                        set title [ns:clean:news $geturl($sid)]                        putlog "\002$title\002 \xbb\xbb $link"                        unset noff($sid)                        unset geturl($sid)                        close $sid                }        }}</code></pre></div>and it still crashs while trying to connect to eggheads.org<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6242">ex</a> — Mon May 30, 2005 3:51 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[demond]]></name></author>
		<updated>2005-05-30T14:31:29-04:00</updated>

		<published>2005-05-30T14:31:29-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=49992#p49992</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=49992#p49992"/>
		<title type="html"><![CDATA[socket timeout]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=49992#p49992"><![CDATA[
if you are certain that your [socket] call blocks because of DNS resolving problem, use eggdrop's asynchronous resolver (the dns module) via [dnslookup] (check out tcl-commands.doc)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5056">demond</a> — Mon May 30, 2005 2:31 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ex]]></name></author>
		<updated>2005-05-30T14:04:57-04:00</updated>

		<published>2005-05-30T14:04:57-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=49991#p49991</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=49991#p49991"/>
		<title type="html"><![CDATA[socket timeout]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=49991#p49991"><![CDATA[
yes i read it. but the problem is, that the eggdrop doesn't arrive at any following line<br><br>even:<div class="codebox"><p>Code: </p><pre><code>set utimer [utimer 10 [list close:socket [set sock [socket -async $url 80]]]]</code></pre></div>does not help<br><br>at the moment it crash while trying to connect to eggheads.org<br>they are obviosly down.<br>i think it hangs, when trying to resolve the hostname<br>and no matter what scripting follows. it always hangs on the line with socket.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6242">ex</a> — Mon May 30, 2005 2:04 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[demond]]></name></author>
		<updated>2005-05-30T11:34:42-04:00</updated>

		<published>2005-05-30T11:34:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=49986#p49986</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=49986#p49986"/>
		<title type="html"><![CDATA[socket timeout]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=49986#p49986"><![CDATA[
did you bother to read through TCL docs, following the links I posted? If not, do so, and pay attention to the examples<br><br>from <a href="http://www.tcl.tk/man/tcl8.5/TclCmd/socket.htm" class="postlink">socket</a> manpage:<blockquote class="uncited"><div>-async<br>    The -async option will cause the client socket to be connected asynchronously. This means that the socket will be created immediately but may not yet be connected to the server, when the call to socket returns. When a gets or flush is done on the socket before the connection attempt succeeds or fails, if the socket is in blocking mode, the operation will wait until the connection is completed or fails. If the socket is in nonblocking mode and a gets or flush is done on the socket before the connection attempt succeeds or fails, the operation returns immediately and fblocked on the socket returns 1.</div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5056">demond</a> — Mon May 30, 2005 11:34 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ex]]></name></author>
		<updated>2005-05-30T10:46:28-04:00</updated>

		<published>2005-05-30T10:46:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=49984#p49984</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=49984#p49984"/>
		<title type="html"><![CDATA[socket timeout]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=49984#p49984"><![CDATA[
ok tried it <br><div class="codebox"><p>Code: </p><pre><code>proc get:rss2 { url port get offst news } {        set ::sid [socket $url $port]        fconfigure $::sid -buffering line -blocking 0        fileevent $::sid readable gotdata:rss}proc gotdata:rss { } {...}</code></pre></div>thats the way someone aut of #tcl channel showed me.<br><br>but it also hangs in the line with 'socket' in it.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6242">ex</a> — Mon May 30, 2005 10:46 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[demond]]></name></author>
		<updated>2005-05-30T03:17:52-04:00</updated>

		<published>2005-05-30T03:17:52-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=49976#p49976</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=49976#p49976"/>
		<title type="html"><![CDATA[socket timeout]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=49976#p49976"><![CDATA[
no, but the correct way to implement this is either set the socket in non-blocking mode and read from/write to it only when ready (using <a href="http://www.tcl.tk/man/tcl8.5/TclCmd/fconfigure.htm" class="postlink">fconfigure</a> and <a href="http://www.tcl.tk/man/tcl8.5/TclCmd/fileevent.htm" class="postlink">fileevent</a>) or use eggdrop's built-in socket commands ([connect] and [control])<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5056">demond</a> — Mon May 30, 2005 3:17 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ex]]></name></author>
		<updated>2005-05-30T02:36:32-04:00</updated>

		<published>2005-05-30T02:36:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=49974#p49974</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=49974#p49974"/>
		<title type="html"><![CDATA[socket timeout]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=49974#p49974"><![CDATA[
When my eggdrop tries to acces a webserver and this server is currently offline, the following line causes a ping timeout for my eggdrop often because  he is totally blocked while trying to connect<br><div class="codebox"><p>Code: </p><pre><code>proc get:rss { url port get offset } {        if { [catch {set sock [socket -async $url $port]}] } {                putlog "error: Can't reach $url $port"                return 0        } else {                 ...</code></pre></div>is there any possibility to set a timeout for socket ? so that he doesn't try to reach for longer than 5 seconds or something like that?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6242">ex</a> — Mon May 30, 2005 2:36 am</p><hr />
]]></content>
	</entry>
	</feed>
