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

	<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>2004-02-28T16:08:43-04:00</updated>

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

		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2004-02-28T16:05:39-04:00</updated>

		<published>2004-02-28T16:05:39-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=34084#p34084</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=34084#p34084"/>
		<title type="html"><![CDATA[Socket problem ..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=34084#p34084"><![CDATA[
Can you post what you tried?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Sat Feb 28, 2004 4:05 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Ofloo]]></name></author>
		<updated>2004-02-28T16:08:43-04:00</updated>

		<published>2004-02-28T16:03:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=34083#p34083</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=34083#p34083"/>
		<title type="html"><![CDATA[Socket problem ..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=34083#p34083"><![CDATA[
Doesn't mather allready tryed <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":(" title="Sad"> i added the flush to make it writable incase tcl made it readable <br><br>cause ive noticed if u get data out a channel and then wana send data that this is not possible .. so by applying a flush it is .. but also tryed without and with .. so .. ive been trying various combinations seems like i can't find a solution can't find the error ?? where would i add vwait ? and wait on what variable to be set ..?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3151">Ofloo</a> — Sat Feb 28, 2004 4:03 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2004-02-28T15:59:09-04:00</updated>

		<published>2004-02-28T15:59:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=34082#p34082</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=34082#p34082"/>
		<title type="html"><![CDATA[Socket problem ..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=34082#p34082"><![CDATA[
Also, if you're testing in the shell, you need something like vwait so that it waits around. Otherwise it will exit right away.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Sat Feb 28, 2004 3:59 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2004-02-28T15:52:38-04:00</updated>

		<published>2004-02-28T15:52:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=34080#p34080</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=34080#p34080"/>
		<title type="html"><![CDATA[Socket problem ..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=34080#p34080"><![CDATA[
Get rid of the string matches and the flush.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Sat Feb 28, 2004 3:52 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Ofloo]]></name></author>
		<updated>2004-02-28T11:21:57-04:00</updated>

		<published>2004-02-28T11:21:57-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=34073#p34073</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=34073#p34073"/>
		<title type="html"><![CDATA[Socket problem ..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=34073#p34073"><![CDATA[
ic ur right but still doesn't work also changed the vars below cause they overwrited them selfs forgot about that !<br><br>the connection remains open and still doesn't close i allready tryed to add a flush infront so it can become writeable but it seems that this doesn't work either ..<br><div class="codebox"><p>Code: </p><pre><code>proc proxy_scan {nick host} {  global proxy  foreach port $proxy(port) {    catch {socket -async $host $port} proxy(socket)    if {[string match -nocase "sock?" $proxy(socket)] &amp;&amp; ![string match -nocase {} $proxy(socket)]} {      flush $proxy(socket)      fileevent $proxy(socket) writable [list open_sock $nick $proxy(socket) $host $port]    }  }}proc open_sock {nick socket host port} {  catch {    set error [fconfigure $socket -error]    close $socket  } errors  eval report_sock [list $nick $host $port $error]}proc report_sock {nick host port error} {  if {[string match -nocase {} $error]} {    operwall "Possible open proxy found on $host $port \($nick\)"  }}</code></pre></div><blockquote class="uncited"><div>By the way, hopefully you are passing it ip addresses and not hosts (as the variable name implies) because tcl does *not* do async dns lookups. </div></blockquote>no didn't know that i used there hosts thing is it does connect tho i can see it on netcat it opens but thats it so it connects but does not close netcat will only close the sock if it is dropped.<br><br>so if ur question is is it connecting yes .. tnx for the tip tho ill add it once i get it right ..<br><div class="codebox"><p>Code: </p><pre><code>#!/usr/bin/tclshset proxy(port) "1080 1081 3380 3381"proc proxy_scan {nick host} {  global proxy  foreach port $proxy(port) {    catch {socket -async $host $port} proxy(socket)    if {[string match -nocase "sock?" $proxy(socket)] &amp;&amp; ![string match -nocase {} $proxy(socket)]} {      flush $proxy(socket)      fileevent $proxy(socket) writable [list open_sock $nick $proxy(socket) $host $port]    }  }}proc open_sock {nick socket host port} {#  catch {    set error [fconfigure $socket -error]    close $socket#  } errors  eval report_sock [list $nick $host $port $error]}proc report_sock {nick host port error} {  if {[string match -nocase {} $error]} {    puts "Possible open proxy found on $host $port \($nick\)"  }}proxy_scan somenick [lindex $argv 0]</code></pre></div>tryed that in shell script doesn't realy mather .. if i use numeric ips ..<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3151">Ofloo</a> — Sat Feb 28, 2004 11:21 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2004-02-28T01:02:16-04:00</updated>

		<published>2004-02-28T01:02:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=34067#p34067</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=34067#p34067"/>
		<title type="html"><![CDATA[Socket problem ..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=34067#p34067"><![CDATA[
Oh ya one more thing, the after command is used like the utimer command, except you give it milliseconds instead of seconds. set timerid [after 5000 myproc], waits 5 seconds (5000 ms). To kill it, do "after cancel $timerid"<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Sat Feb 28, 2004 1:02 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2004-02-28T00:57:11-04:00</updated>

		<published>2004-02-28T00:57:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=34065#p34065</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=34065#p34065"/>
		<title type="html"><![CDATA[Socket problem ..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=34065#p34065"><![CDATA[
Well the reason it's probably not working is your if command. I mean take a look at it, for a minute. In english it says, "if $proxy(socket) matches "sock?" AND $proxy(socket) matches {}, then do this". It's never going to match both of those at the same time.<br><br>Also it's really sloppy to use catch like that. You should have it in an if statement, because it returns 1 when there's an error, and 0 when there isn't one. Then you don't need that string match at all.<br><br>By the way, hopefully you are passing it ip addresses and not hosts (as the variable name implies) because tcl does *not* do async dns lookups.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Sat Feb 28, 2004 12:57 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[strikelight]]></name></author>
		<updated>2004-02-27T19:08:03-04:00</updated>

		<published>2004-02-27T19:08:03-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=34059#p34059</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=34059#p34059"/>
		<title type="html"><![CDATA[Socket problem ..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=34059#p34059"><![CDATA[
&lt;snip...&gt;<br><br>n/m..<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2005">strikelight</a> — Fri Feb 27, 2004 7:08 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Ofloo]]></name></author>
		<updated>2004-02-27T18:30:18-04:00</updated>

		<published>2004-02-27T18:30:18-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=34057#p34057</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=34057#p34057"/>
		<title type="html"><![CDATA[Socket problem ..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=34057#p34057"><![CDATA[
sorry tryed bot .. readable and writeable ..<br><br>i know about after the thing is havn't figured out how to use it yet i must be doing something wrong cause the socket connects and remains open i set up netcat on my host and it just stays open doing nothing ..<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3151">Ofloo</a> — Fri Feb 27, 2004 6:30 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2004-02-27T18:22:19-04:00</updated>

		<published>2004-02-27T18:22:19-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=34055#p34055</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=34055#p34055"/>
		<title type="html"><![CDATA[Socket problem ..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=34055#p34055"><![CDATA[
Using socket -async, fconfigure, fileevent is the right way. For timers use the after command. Also, you're using fileevent readable, when it should really be writable.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Fri Feb 27, 2004 6:22 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Ofloo]]></name></author>
		<updated>2004-02-27T17:31:55-04:00</updated>

		<published>2004-02-27T17:31:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=34053#p34053</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=34053#p34053"/>
		<title type="html"><![CDATA[Socket problem ..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=34053#p34053"><![CDATA[
I did to technical also checked the forum the thing is its not for a channel its to check an entire irc server i am writing a complete service in tcl the thing is there is something wrong with fileevent it takes to long before it has checked it almost like it is waiting untill it becomes writable do you got a solution on that .. i mean something that times it out or closes to socket i can't use utimer or any other eggdrop commands sinds its a socket bot that emulates a server and not an eggdrop<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3151">Ofloo</a> — Fri Feb 27, 2004 5:31 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[GodOfSuicide]]></name></author>
		<updated>2004-02-27T17:08:16-04:00</updated>

		<published>2004-02-27T17:08:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=34052#p34052</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=34052#p34052"/>
		<title type="html"><![CDATA[Socket problem ..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=34052#p34052"><![CDATA[
<blockquote class="uncited"><div>couldn't open "../logs/service.log": too many open files</div></blockquote>you have opened too many files allready, they might have not been closed when you experimented previously or they are still not  close correctly.<br><br>i didnt work with sockets yet so i cant help you except to tell you to check back the manual <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1433">GodOfSuicide</a> — Fri Feb 27, 2004 5:08 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Ofloo]]></name></author>
		<updated>2004-02-27T16:17:11-04:00</updated>

		<published>2004-02-27T16:17:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=34051#p34051</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=34051#p34051"/>
		<title type="html"><![CDATA[Socket problem ..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=34051#p34051"><![CDATA[
Now i am stuck no more ideas ..<br>error <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":(" title="Sad"> <blockquote class="uncited"><div>couldn't open "../logs/service.log": too many open files</div></blockquote><div class="codebox"><p>Code: </p><pre><code>proc proxy_scan {nick host} {  global proxy  foreach port $proxy(port) {    catch {socket -async $host $port} proxy(socket)    if {[string match -nocase "sock?" $proxy(socket)] &amp;&amp; [string match -nocase {} $proxy(socket)]} {      fileevent $proxy(socket) readable [list open_sock $nick $proxy(socket) $host $port]    }  }}proc open_sock {nick socket host port} {  global proxy  catch {    set proxy(error) [fconfigure $socket -error]    close $socket  } proxy(error)  eval report_sock [list $nick $host $port]}proc report_sock {nick host port} {  if {[string match -nocase {} $proxy(error)]} {    operwall "Possible open proxy found on $host $port \($nick\)"  }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3151">Ofloo</a> — Fri Feb 27, 2004 4:17 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Ofloo]]></name></author>
		<updated>2004-02-27T15:46:24-04:00</updated>

		<published>2004-02-27T15:46:24-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=34050#p34050</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=34050#p34050"/>
		<title type="html"><![CDATA[Socket problem ..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=34050#p34050"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>proc proxy_scan {nick host} {  global proxy  foreach port $proxy(port) {    catch {socket -async $host $port} proxy(socket)    if {[string match -nocase "sock?" $proxy(socket)] &amp;&amp; ![string match -nocase {} $proxy(socket)]} {      fconfigure $proxy(socket) -blocking 0      fileevent $proxy(socket) writable [open_sock $nick $proxy(socket) $host $port]      close $proxy(socket)    }  }}proc open_sock {nick socket host port} {  operwall "Possible open proxy found on $host $port \($nick\)"}</code></pre></div>i have tryed something simular looking for a way to add a timeout would be great full if u could set me on the right track ..<br><br>thing is if i use -async everything is a socket if i don't well then it works but .. it freezes after a while <br><br>and async is worse it says that everything has an open port .. i know u have to check for writeable socket but .. how do you do that ... the script with -async above is not working<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3151">Ofloo</a> — Fri Feb 27, 2004 3:46 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[GodOfSuicide]]></name></author>
		<updated>2004-02-27T15:37:19-04:00</updated>

		<published>2004-02-27T15:37:19-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=34049#p34049</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=34049#p34049"/>
		<title type="html"><![CDATA[Socket problem ..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=34049#p34049"><![CDATA[
maybe adding a timeout ?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1433">GodOfSuicide</a> — Fri Feb 27, 2004 3:37 pm</p><hr />
]]></content>
	</entry>
	</feed>
