Skip to content

Commit 27e71ab

Browse files
authored
TCP Events Doc Polishing
1 parent 7dcc0bb commit 27e71ab

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/reference/asciidoc/ip.adoc

+11-2
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,8 @@ The following example shows how to configure a connection interceptor factory ch
723723
=== TCP Connection Events
724724

725725
Beginning with version 3.0, changes to `TcpConnection` instances are reported by `TcpConnectionEvent` instances.
726-
`TcpConnectionEvent` is a subclass of `ApplicationEvent` and can thus be received by any `ApplicationListener` defined in the `ApplicationContext` -- for example <<./event.adoc#appevent-inbound,an event inbound channel adapter>>.
726+
`TcpConnectionEvent` is a subclass of `ApplicationEvent` and can thus be received by any `ApplicationListener` defined in the `ApplicationContext`, or an `@EventListener` method.
727+
Also see <<./event.adoc#appevent-inbound,an event inbound channel adapter>>.
727728

728729
`TcpConnectionEvents` have the following properties:
729730

@@ -733,9 +734,15 @@ Beginning with version 3.0, changes to `TcpConnection` instances are reported by
733734
* `source`: The `TcpConnection`.
734735
You can use this, for example, to determine the remote IP Address with `getHostAddress()` (cast required).
735736

737+
Available `TcpConnectionEvent` s, related to a specific connection include:
738+
739+
* `TcpConnectionOpenEvent`
740+
* `TcpConnectionCloseEvent`
741+
* `TcpConnectionExceptionEvent`
742+
736743
In addition, since version 4.0, the standard deserializers discussed in <<tcp-connection-factories>> now emit `TcpDeserializationExceptionEvent` instances when they encounter problems while decoding the data stream.
737744
These events contain the exception, the buffer that was in the process of being built, and an offset into the buffer (if available) at the point where the exception occurred.
738-
Applications can use a normal `ApplicationListener` or an `ApplicationEventListeningMessageProducer` (see <<./event.adoc#appevent-inbound,Receiving Spring Application Events>>) to capture these events, allowing analysis of the problem.
745+
Applications can use a normal `ApplicationListener`, an `@EventListener` method, or an `ApplicationEventListeningMessageProducer` (see <<./event.adoc#appevent-inbound,Receiving Spring Application Events>>) to capture these events, allowing analysis of the problem.
739746

740747
Starting with versions 4.0.7 and 4.1.3, `TcpConnectionServerExceptionEvent` instances are published whenever an unexpected exception occurs on a server socket (such as a `BindException` when the server socket is in use).
741748
These events have a reference to the connection factory and the cause.
@@ -753,6 +760,8 @@ IMPORTANT: To avoid delaying the listening thread from accepting connections, th
753760
Starting with version 4.3.2, a `TcpConnectionFailedEvent` is emitted whenever a client connection cannot be created.
754761
The source of the event is the connection factory, which you can use to determine the host and port to which the connection could not be established.
755762

763+
To use a single `ApplicationListener` (or `@EventListener` method) to receive all of these events (including `TcpConnectionEvent` s), configure the listener to receive `IpIntegrationEvent` s.
764+
756765
[[tcp-adapters]]
757766
=== TCP Adapters
758767

0 commit comments

Comments
 (0)