Home > Back-end >  Netty do long TCP connection server has a lot of bad package
Netty do long TCP connection server has a lot of bad package

Time:09-19

With long do Netty TCP connection server, multiple devices connect to the server, all within the local area network (LAN)
Business, most of the frame is the client report, servers don't have to reply, the server sends to the equipment frame also need not reply

Use wireshark caught on, the server sends to the client, a large number of black scarlet letter bad package
My ip192.168.1.168 equipment ip192.168.1.150
Caught found every client send up a frame, although need not reply on my business, but TCP or an ACK packet is sent back to normal equipment, and followed by a exactly the same as the bad package, display TCP dup ACK

I sent to the client's frame, and also is a normal bag behind with a bad bag, bad package display TCP retransmission

And the client is to receive frames

Why do I sent to the client is a normal bag keep up with a bad bag? And there are a lot of is not my business packages, these are what? After the server receives the frame must have to reply to a frame?


 
Try {
ServerBootstrap bootstrap=new ServerBootstrap ()
Group (boss, worker)
Channel (NioServerSocketChannel. Class)
. LocalAddress (inetSocketAddress)
ChildOption (ChannelOption TCP_NODELAY, true)
ChildOption (ChannelOption SO_KEEPALIVE, true)
ChildHandler (new HvacChannelInitializer (context));
ChannelFuture future=the bootstrap. The bind (). The sync ();
If (future) isSuccess ()) {
The info (" [TCP Server] Server started @ {} : {} ", IP, tcpPort);
}
Future. Channel (.) closeFuture (). The sync ();
{} catch InterruptedException (e)
The log. The error (" [TCP Server] Server started failed ", e);
} the finally {
Boss. ShutdownGracefully ();
Worker. ShutdownGracefully ();
PreDestroy ();
}

CodePudding user response:

This error may be the underlying transport
Check the network equipment and cables

CodePudding user response:

reference 1st floor tianfang response:

may be the underlying transmission errorsCheck the network devices and network cable


Both can communication, can be resolved successfully
May be related to 360?
Company in 360 days with

CodePudding user response:

Bad package are in retransmission, retransmission error because

360 is a software, not to destroy the TCP packets
  • Related