From f89963dc9b9c856a9f4f2e7eea45ab662b439099 Mon Sep 17 00:00:00 2001 From: Artem Bilan Date: Thu, 11 Dec 2014 13:14:07 +0200 Subject: [PATCH] INT-3575 TcpNetConnection: flush stream in send() JIRA: https://jira.spring.io/browse/INT-3575 --- .../integration/ip/tcp/connection/TcpNetConnection.java | 3 ++- src/reference/docbook/ip.xml | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNetConnection.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNetConnection.java index 79902e98fc..512d64a5ad 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNetConnection.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNetConnection.java @@ -93,6 +93,7 @@ public class TcpNetConnection extends TcpConnectionSupport { this.lastSend = System.currentTimeMillis(); try { ((Serializer) this.getSerializer()).serialize(object, this.socketOutputStream); + this.socketOutputStream.flush(); } catch (Exception e) { this.publishConnectionExceptionEvent(e); @@ -125,7 +126,7 @@ public class TcpNetConnection extends TcpConnectionSupport { /** * If there is no listener, and this connection is not for single use, * this method exits. When there is a listener, the method runs in a - * loop reading input from the connections's stream, data is converted + * loop reading input from the connection's stream, data is converted * to an object using the {@link Deserializer} and the listener's * {@link TcpListener#onMessage(Message)} method is called. For single use * connections with no listener, the socket is closed after its timeout diff --git a/src/reference/docbook/ip.xml b/src/reference/docbook/ip.xml index 54be4c2e2a..249bf4365d 100644 --- a/src/reference/docbook/ip.xml +++ b/src/reference/docbook/ip.xml @@ -581,7 +581,7 @@ Normally, inbound adapters use a type="server" connection factory, which listens for incoming connection requests. - In some cases, it is desireable to establish the connection + In some cases, it is desirable to establish the connection in reverse, whereby the inbound adapter connects to an external server and then waits for inbound messages on that connection. @@ -650,7 +650,7 @@ As with inbound adapters, inbound gateways normally use a type="server" connection factory, which listens for incoming connection requests. - In some cases, it is desireable to establish the connection + In some cases, it is desirable to establish the connection in reverse, whereby the inbound gateway connects to an external server and then waits for, and replies to, inbound messages on that connection.