If all your sockets really are non-blocking (which you better
double-check),
I can only understand the behavior you describe as being one where
those big writes are never seeing EWOULDBLOCK, and so never have
reason to stop.
That would probably mean you are doing localhost testing,
or on a very fast local network.

You would need to throttle your writes if you want to yield every
once in a while, and not starve out accepts -- I'm assuming
here a single threaded architecture.

-mda

On Sat, 22 Apr 2006 01:24:24 -0700, [EMAIL PROTECTED] said:
> 
> Hello, all ...
> 
> I'm using libEvent to write a streaming media server, mainly to test  
> epoll() on Linux / kqueue on Mac OSX / etc. for scalability.  Right  
> now, my test server waits for n connections to be established (n  
> specified on the command line), calling event_add() for each  
> connection, then calls event_dispatch() and sends bytes to each  
> client.  The sockets are non-blocking, but right now, event_dispatch 
> () blocks until all clients have received all of the bytes (i'm  
> streaming a 40MB MPEG file for now as a test).  I would like to have  
> the number of connections be more variable, so I want to continue  
> accepting new connections from other clients, while i'm handling  
> events for the ones I have.  However, since event_dispatch() is  
> blocking, my accept() isn't happening.
> 
> I could solve this by adding another thread (assuming libEvent is  
> thread-safe), but i'd rather not do that.  Can I make event_dispatch 
> () not block, or is there some other way to do what I want to do?
> 
> Regards,
> 
> John
> 
> Falling You - exploring the beauty of voice and sound
> http://www.fallingyou.com
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> _______________________________________________
> Libevent-users mailing list
> Libevent-users@monkey.org
> http://monkey.org/mailman/listinfo/libevent-users
_______________________________________________
Libevent-users mailing list
Libevent-users@monkey.org
http://monkey.org/mailman/listinfo/libevent-users

Reply via email to