spring integration SocketException:Connection reset

My server code:
https://stackoverflow.com/a/41765722/3871754

My client code:
https://alvinalexander.com/blog/post/java/simple-java-socket-client-class-program

When I run client, I get:
o.s.i.i.tcp.connection.TcpNetConnection : Read exception 127.0.0.1 SocketException:Connection reset

How to make it works?