Beckhoff / ADS

Beckhoff protocol to communicate with TwinCAT devices.
MIT License
513 stars 194 forks source link

A bug? (m_SockAddress.sin_port = 703, shouldn't it be 48898?) #61

Closed lianhub closed 6 years ago

lianhub commented 6 years ago

I think I may find a bug:

Shouldn't the port be 48898? Anybody can confirm my conclusion? or maybe I am wrong?

Thanks, Jerry

pbruenn commented 6 years ago

Unfortunately that's no bug. sin_port is in "network byteorder/big endian" so you would have to convert it back into host byteorder with ntohs() and will see it is correct. You could use Wireshark[1] to see the packet on wire (in network byte order, but wireshark will decode correctly).

[1] https://www.wireshark.org

lianhub commented 6 years ago

OK, I see the logic! Thanks Pbruenn, so this issue can be closed now!