Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
IRC bot test
kristnjov
5/22/2007 6:20:00 PM
Hey!
I'm trying to create a very simple IRC bot using Ruby. I don't have very
much experience with sockets programming and I have a rather simple
question for you.
I have been able to receive information from the connection to the
server and identify to it and all of that, and I have been able to
implement timestamps when the program prints to stdout. The problem is
that I use a receive buffer at 512 bytes and sometimes the rows get
"split" like this:
20:13:13 !! :irc.du.se 372 krisss :- Maybe buy shells to IRC from at
http://www.K...
. If that one
20:13:13 !! :irc.
20:13:13 !! du.se 372 krisss :- mentioned before isnt't enough,
http://ww...
is around, too!
How should I go about making it printing it "correctly"?
--Deniz Dogan
1 Answer
Stefan Rusterholz
5/22/2007 8:30:00 PM
0
Deniz Dogan wrote:
> The problem is
> that I use a receive buffer at 512 bytes and sometimes the rows get
> "split" like this:
That's indeed the problem IMHO which is why I suggest you solve that
instead. You can use gets("\r\n") to get one full message at a time.
Regards
Stefan
--
Posted via
http://www.ruby-...
.
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
IRC bot test
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password