<?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/9125" />

	<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-02-10T11:57:42-04:00</updated>

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

		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2005-02-10T11:57:42-04:00</updated>

		<published>2005-02-10T11:57:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=46489#p46489</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=46489#p46489"/>
		<title type="html"><![CDATA[Async socket waits untill ends]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=46489#p46489"><![CDATA[
<blockquote class="uncited"><div>where exactly cause ive tryed it and i got would wait forever and script breaks</div></blockquote>Try this:<div class="codebox"><p>Code: </p><pre><code>proc open_sock {host port} { if {[catch {socket -async $host $port} sock]} {puts "Connection to $host:$port failed: $sock"return 0} else {fileevent $sock writable [list check_sock $sock $host $port] return 1}} proc check_sock {sock host port} { global pendingif {[fconfigure $sock -error]==""} { puts "Connected to $host:$port" } else { puts "Connection to $host:$port failed: [fconfigure $sock -error]" } close $sockincr pending -1;}proc doit args {global pendingset pending 0foreach {host port} $args {incr pending [open_sock $host $port]}while {$pending} {vwait pending}puts done.}doit localhost 22 localhost 23 localhost 25 localhost 110</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Thu Feb 10, 2005 11:57 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Ofloo]]></name></author>
		<updated>2005-02-10T01:25:11-04:00</updated>

		<published>2005-02-10T01:25:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=46470#p46470</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=46470#p46470"/>
		<title type="html"><![CDATA[Async socket waits untill ends]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=46470#p46470"><![CDATA[
and yes sorry hehe by shell i meanth shell script as in tclsh not as in eggdrop shell..<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3151">Ofloo</a> — Thu Feb 10, 2005 1:25 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Ofloo]]></name></author>
		<updated>2005-02-10T01:04:20-04:00</updated>

		<published>2005-02-10T01:04:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=46469#p46469</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=46469#p46469"/>
		<title type="html"><![CDATA[Async socket waits untill ends]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=46469#p46469"><![CDATA[
where exactly cause ive tryed it and i got would wait forever and script breaks<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3151">Ofloo</a> — Thu Feb 10, 2005 1:04 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2005-02-09T11:56:58-04:00</updated>

		<published>2005-02-09T11:56:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=46451#p46451</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=46451#p46451"/>
		<title type="html"><![CDATA[Re: Async socket waits untill ends]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=46451#p46451"><![CDATA[
Move the vwait to after your while loop? (remove it from the proc)<br><blockquote class="uncited"><div>Eggdrop won't exit when your script ends, so you don't need the vwait.</div></blockquote>I don't think he's running it in eggdrop's interpreter:<blockquote class="uncited"><div><div class="codebox"><p>Code: </p><pre><code>#!/usr/bin/tclsh</code></pre></div></div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Wed Feb 09, 2005 11:56 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2005-02-09T11:43:15-04:00</updated>

		<published>2005-02-09T11:43:15-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=46446#p46446</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=46446#p46446"/>
		<title type="html"><![CDATA[Async socket waits untill ends]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=46446#p46446"><![CDATA[
Eggdrop won't exit when your script ends, so you don't need the vwait.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Wed Feb 09, 2005 11:43 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Ofloo]]></name></author>
		<updated>2005-02-08T16:30:32-04:00</updated>

		<published>2005-02-08T16:30:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=46413#p46413</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=46413#p46413"/>
		<title type="html"><![CDATA[Async socket waits untill ends]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=46413#p46413"><![CDATA[
well its required in a shell script otherwize the app would close ..<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3151">Ofloo</a> — Tue Feb 08, 2005 4:30 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2005-02-06T14:33:56-04:00</updated>

		<published>2005-02-06T14:33:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=46345#p46345</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=46345#p46345"/>
		<title type="html"><![CDATA[Async socket waits untill ends]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=46345#p46345"><![CDATA[
Probably cos of the 'vwait done($sock)'<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Sun Feb 06, 2005 2:33 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Ofloo]]></name></author>
		<updated>2005-02-06T08:36:18-04:00</updated>

		<published>2005-02-06T08:36:18-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=46331#p46331</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=46331#p46331"/>
		<title type="html"><![CDATA[Async socket waits untill ends]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=46331#p46331"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>#!/usr/bin/tclshproc open_sock {host port} {   global done   if {[catch {socket -async $host $port} sock]} {      puts "Connection to $host:$port failed: $sock"   } else {      fileevent $sock writable [list check_sock $sock $host $port]      vwait done($sock)   }}proc check_sock {sock host port} {   global done   if {[fconfigure $sock -error]==""} {      puts "Connected to $host:$port"   } else {      puts "Connection to $host:$port failed: [fconfigure $sock -error]"   }   close $sock   set done($sock) 1}</code></pre></div>i am using an async socket in a while to connect to multiple targets at once but there appears to be no difference when i use a async socket or a regular one.. it waits untill the proc has ended .. why is this ?<br><br>i am using foreach ... to go true the process any suggestions to speed it up?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3151">Ofloo</a> — Sun Feb 06, 2005 8:36 am</p><hr />
]]></content>
	</entry>
	</feed>
