Yes, although I admit I'm just learning about all the implications of that.
It seemed to me that even if the actual transmission/write blocks
indefinitely, that should be happening "asynchronously" in another thread
or something and shouldn't stop the Async version of sendText from
returning since it's supposed to return "before the message is
transmitted". It looks like I was wrong there though, so I'll have to look
in to change the connector type.

Thanks!

On Thu, Jun 29, 2017 at 1:39 PM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Z, V, etc.,
>
> On 6/29/17 1:16 PM, V User wrote:
> > Hello! I have a question about the RemoteEndpoint.Async sendText
> > method. The spec states: "Initiates the asynchronous transmission
> > of a text message. This method returns before the message is
> > transmitted." To me, this implies that the method should return
> > immediately regardless of network status (i.e. it should still
> > return immediately even if the socket connection has died without
> > closing), but I've observed it blocking on writes to a broken
> > connection.
> >
> > I'm also dealing with a known issue with timeouts on Tomcat 7 with
> > a BIO connector
> > (https://bz.apache.org/bugzilla/show_bug.cgi?id=56304). Looking at
> > the source, the Basic/blocking sendText method calls
> > sendPartialString, which uses a Future in the same way that the
> > Async sendText method does, and then calls get on that Future with
> > the configured timeout, so I'd imagine that if the Basic/blocking
> > method has broken timeouts then the Async timeouts will be broken
> > as well.
> >
> > Am I mis-interpreting the spec by expecting Async sendText to
> > return immediately if the socket connection is broken? Is this just
> > an extension of the issue with BIO connectors?
> >
> > My version information is: Server version: Apache Tomcat/7.0.64
> > Server built:   Aug 19 2015 17:18:06 UTC Server number:  7.0.64.0
> > OS Name:        Linux OS Version:     3.13.0-57-generic
> > Architecture:   amd64 JVM Version:    1.8.0_131-b11 JVM Vendor:
> > Oracle Corporation
> >
> > Thanks, Z
>
> Are you in fact using a BIO connector? Because you can't really expect
> non-blocking semantics with an underlying pro-blocking connector.
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAllVO1AACgkQHPApP6U8
> pFiZshAApYCGkyjEoMBgCcn9p8UI9HU9Psk62dK8AW40COsc+EeRG7ZdJMB0a1Qs
> ajVcN/hwoPzq5Ml1MbWZOoY0qyRPyb0of9e2ZXKi3xX5PpIAe/CJDrnrU9eyzZ9z
> VTNlkTfD7lcAjfgmlNM23daiAbLs1e5teO4fjGrgARWeElK0wJfbeYZvFIQmUY+N
> sYrsegoy5qYoQ9A5pi9x4ZnrJNsokTZ0FJm/HKpZ9lLzvoCOVkqONNZtd/ak+TO4
> 12AQzU2hRzyRmcSwRRJtbMQ6BzoOiTmKcIodlnwDtWkw1DNg6VVOWMTvF7gpXedq
> fDDRxU5p3ME9kyYgUHwh8DaFOmyOBeP0egmiQlYvDJQnK3JfEeukJrW1NP8BvpCM
> TOQVnEjz3JHrBuozXqjrW2kGODJTM/h+eubYgHHOc1zCuxkgKBJfwvdsV4WsszNB
> BryveNLku1/Zy2fwaEtXUhYS0BP3izswb0RzBClCLoIc1CLnz4ULQ96wGACkzeKj
> mWG/4+/LxF+ek/mYAj0jFEFTZUaPI33zkzlHqhd/TxnEf3cszWOZQY3cL5kV0Zmn
> lx8BM3KxTW/qSCadWLcv9glSsiO5qWExsX0aBgqHFGDv1lZSg+FVhAc1tIG6ewc0
> G3KLIZJNHNhwBpNxlt+dNSk3Ri/v7aRYnU+oZCut2jcq/Ztiu64=
> =EYgI
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>

Reply via email to