Reputation: 21
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.
Upvotes: 1
Views: 1252
Reputation: 1870
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.
Upvotes: -1
Reputation: 61
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).
Upvotes: 2