Announcement Announcement Module
Collapse
No announcement yet.
Client socket timeout Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Client socket timeout

    I was hoping Gary could give some insight into this...

    AbstractClientConnectionFactory, line 64, disallows a 0 setting for so-timeout, preventing having an infinite timeout. Java Socket allows this, although the JavaDoc is very confusing on this matter.

    Is there a better way to request an infinite timeout, or should I just set it particularly high?

  • #2
    Hmmm.... in this context (client connections having a timeout), we only considered the request/reply use case, in which case it really doesn't make sense to have an infinite timeout. This use case is implemented either in a gateway, or collaborating in/out channel adapters. In the latter case, the request/response cycle can be completely asynchronous (e.g. send a second request before the first reply is received).

    I suppose one could configure collaborating in/out channel adapters for entirely asynchronous (and unrelated) communications between two systems over a single socket, in which case, an infinite timeout might be appropriate. We didn't consider this use case. If you have a use case for this, please enter a jira 'improvement' issue and we'll take a look.

    As you said, a reasonable work-around would be to set a high timeout.

    Comment


    • #3
      Originally posted by Gary Russell View Post
      I suppose one could configure collaborating in/out channel adapters for entirely asynchronous (and unrelated) communications between two systems over a single socket, in which case, an infinite timeout might be appropriate. We didn't consider this use case. If you have a use case for this, please enter a jira 'improvement' issue and we'll take a look.
      Thanks very much for getting back to me.

      My use case is connecting to a server, and having collaborating adapters. However, traffic can originate on my side (with a corresponding reply packet) or on the server side (we end up as peers, basically). I can't compel the other side to connect to me, so I have to connect to them.

      I'll go ahead and file a JIRA issue. For now, I'm setting the timeout to an hour.

      Comment


      • #4
        You can set it to several weeks, using a SpEL expression...

        Code:
        ...
            so-timeout="#{T(Integer).MAX_VALUE}"
        ...

        Comment

        Working...
        X