hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anders Wallgren" <and...@electric-cloud.com>
Subject Intended usage of DefaultConnectingIOReactor in httpcore
Date Tue, 23 Jan 2007 21:48:18 GMT
I'm having problems putting DefaultConnectingIOReactor to use.  It seems
the intended use it to call connect() from another thread, while
execute() is (basically), sitting on a select() in some other thread.  I
say this because the timeout on the select is quite large and there is
no way to cause DefaultConnectingIOReactor to wakeup the select call,
from what I can see.

 

My experience is that calling register() on the selector while the
selector is in a select() call in another thread makes the call to
register() block for long periods of time.  Usually, the pattern is to
queue up the new connections, then call wakeup() on the selector to have
it configure the outbound connection.  My experience here isn't deep,
and largely through trial and error, so I might be completely wrong on
this.

 

The sample code in NHttpClient makes a few calls to connect() before
calling execute() from the same thread, so this code isn't really a
real-world example, it would seem.  I've poked through the wiki but
haven't found anything relevant to the design of this piece of the code.

 

What am I missing?

 

anders

 

 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message