set rfile [open eggdrop.conf r]
foreach line [split [read $rfile] \n] {
#sock is where i send it to it allready exists.
puts $sock "$line"
}
close $rfile
hmm k stupid me i have been focusing on the config file while it was the socket that closed to fast how do i keep a server socket open long enough to send data true it and only close the sock after the data is send ..
the sock closes auto .. so i am not using close well on the end i do but ..
"Connection reset by peer" generally means the person who sent the data closed the socket before all of the data arrived. Maybe your test program that sends the file through the socket is exiting (not just closing the socket but actually exiting) before all the data is sent. One solution is to use an acknowledgement: send the file, wait for the server to send a reply like "ok". Another is to use fileevent writable to see when the socket isn't blocking (but I'm not totally sure if this will work 100%).
Also ofloo, I feel like you are kind of aggressive when people don't understand your questions and give "wrong" solutions, even though it's really your fault for not explaining it properly. Look at your initial post:
"how do i read the bots config file without getting errors ..? or executing that code ..??"
how do you A or B means, how do I A, or how do I B. Which in your case means "how do I read the bot's config file without getting errors, or how do I execute the code?"
how do you A or B means, how do I A, or how do I B. Which in your case means "how do I read the bot's config file without getting errors, or how do I execute the code?"
true but i didn't mean it agressive as he did a i did a :p so it means to me that he was joking and i did the same thing so not sur what u mean by agressive
edited : hmm it seems that the :p is on the wrong line but i meanth to put it there sorry didn't mean to make it sound like that sorry spock