Problems tcp/ip tcp_connect/2 to tcp_connect/3 while upgrading from 8.x to 9.x or 10.x

I am involved in the development of a platform using SWI Prolog ver. 8.x.
But with the advent of newer versions, things have become messed up, especially when we try to use the TCP protocol to open sockets and communicate amongst them. I am also not sure how an IP is treated by the tcp/ip protocol - should it be a string, atom, or compound term? Not sure how to change, for instance, an IP ‘198.xxx.xxx.40’ to a compatible form. Could you also explain StreamPair?

I don’t think much changed except IPv6 support and some new calls to use stream pairs for convenience. A stream pair is simply the combination of an input and output stream. read/write/etc. simply work on the relevant part of the pair. What exactly is going wrong? Caan you show a snippet of what you are doing as now we have no clue with part of the socket API you are trying to use.