[RDY] fix TCP connection (issue #870)

This fixes the broken TCP connection. It does not change the functions used to copy the IP address. Maybe there are some more improvements to be made here as described in issue #870.
With `int32_t` we have the same problem as before with `int` on 64-bit systems.
Using `int64_t` here instead of `int32_t` should work.