hemant
9/19/2006 12:04:00 PM
On 9/19/06, Francis Cianfrocca <garbagecat10@gmail.com> wrote:
> Two points:
> First, if you're connecting to this program using telnet, the behavior
> will depend on the platform that you run telnet on. The telnet client
> on Windows sends data byte-by-byte as you type it in. On Linux, Mac or
> other Unix, telnet buffers the data line by line.
>
> Second, and extremely important: you do *not* need to spin a thread to
> send your data. The whole point of EventMachine is that it allows you
> to handle many connections at once, without using threads. Threads
> slow your program down and make it harder to debug.
>
> If you really want to hammer your telnet client with random data based
> on @local_symbols, use EventMachine#add_periodic_timer rather than
> spinning a thread.
>
>
Thanks for replying.
Random values were just the placeholders, the actual data would be
more important i guess. But my understanding of add_periodic_timer
says that, it would be global to entire program. But what i want is
basically, a method which would be client specific. By being client
specific, I mean...each connection, should have a callback, which
would start sending the data. Please correct me, If i am wrong.
Basically what i want is...push the data to the clients
asynchronously. Using recieve_data I can change @local_symbols and
hence the data pushed to the client should change accordingly.
So, How do i do this?
--
There was only one Road; that it was like a great river: its springs
were at every doorstep, and every path was its tributary.