LoginSignup
2
1

More than 3 years have passed since last update.

Fatal error: read tcp 127.0.0.1:xxxx->127.0.0.1:yyyy: read: connection reset by peer

Posted at

事象

サーバ・クライアント間でTCP/IPコネクションを確立している状態でクラアントからサーバにデータを送信すると以下のエラーが出てきた。

connection reset by peer 

原因

サーバからクライアントにRST(Reset TCP)パケットが送信されてコネクションがブチ切られている。
電話に例えると、発信者(クライアント)から受信者(サーバ)に電話した時に相手側が即効電話を切っていると同じ。

RSTとは

When an unexpected TCP packet arrives at a host, that host usually responds by sending a reset packet back on the same connection. A reset packet is simply one with no payload and with the RST bit set in the TCP header flags.

①データ送信(クライアント→サーバ)
スクリーンショット 2021-04-17 0.50.13.png

②RSTパケット送信(サーバ→クライアント)
スクリーンショット 2021-04-17 0.50.19.png

③コネクション終了
スクリーンショット 2021-04-17 0.50.30.png

Stack Over Flowでの説明がわかりやすい。

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1