Request timeouts

538 views
Skip to first unread message

Martin Konicek

unread,
Feb 27, 2012, 12:37:20 PM2/27/12
to dispatc...@googlegroups.com
Hi,
it seems Dispatch doesn't have support for setting request timeouts. Is this intentional? I searched Dispatch code for the string "timeout" and there are no hits apart from gae.scala.

Martin Konicek

unread,
Feb 28, 2012, 8:45:39 AM2/28/12
to dispatc...@googlegroups.com
OK here is the solution:

val h = new dispatch.Http {
    import org.apache.http.params.CoreConnectionPNames
    client.getParams.setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, 2000)
    client.getParams.setParameter(CoreConnectionPNames.SO_TIMEOUT, 5000)
Reply all
Reply to author
Forward
0 new messages