[
https://issues.apache.org/jira/browse/FLINK-2490?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14694936#comment-14694936
]
ASF GitHub Bot commented on FLINK-2490:
---------------------------------------
Github user mxm commented on a diff in the pull request:
https://github.com/apache/flink/pull/992#discussion_r36955259
--- Diff:
flink-staging/flink-streaming/flink-streaming-core/src/main/java/org/apache/flink/streaming/api/functions/source/SocketTextStreamFunction.java
---
@@ -69,14 +68,14 @@ public void run(SourceContext<String> ctx) throws
Exception {
public void streamFromSocket(SourceContext<String> ctx, Socket socket)
throws Exception {
try {
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
BufferedReader reader = new BufferedReader(new
InputStreamReader(
socket.getInputStream()));
while (isRunning) {
- int data;
+ String data;
try {
- data = reader.read();
+ data = reader.readLine();
--- End diff --
Please use `read()` because of the custom delimiter.
> Remove unwanted boolean check in function
> SocketTextStreamFunction.streamFromSocket
> -----------------------------------------------------------------------------------
>
> Key: FLINK-2490
> URL: https://issues.apache.org/jira/browse/FLINK-2490
> Project: Flink
> Issue Type: Bug
> Components: Streaming
> Affects Versions: 0.10
> Reporter: Huang Wei
> Priority: Minor
> Fix For: 0.10
>
> Original Estimate: 168h
> Remaining Estimate: 168h
>
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)