1

Our school project is a BitTorrent client. Today i suddenly got a {tcp_error,#Port<0.2095>,emsgsize} error and my question is what caused this error? I have option {packet,4} on gen_tcp so my guess is that the length off the package does not match the 4 first bytes? That would be really strange because all BitTorrent messages except for the handshake have first 4 bytes len. Yesterday we were able to download and now i get these messages. Note that some messages arrives just fine. Thanks for your thoughts on the problem.

Anders Abel
  • 67,989
  • 17
  • 150
  • 217
sakray
  • 21
  • 2

2 Answers2

2

you will get an emsgsize error when the packet is bigger than your receive buffer (recbuf option) or when the packet is bigger than the specified maximum packet size (packet_size options).

sg2342
  • 61
  • 2
-1

Probably one of the packets is not sent with the correct header, which Erlang is interpreting as a header that claims the packet is very large.

r3m0t
  • 1,850
  • 16
  • 21