shouldn't you bind to host/port and then listen (in case of server) or connect (in case of client)?
i.e. I don't think this will work on Linux (as you claim)
Also check if this will help https://stackoverflow.com/q/62281097/4046632
From the link in the answer it says that on some Windows OS `A call to the bind function with a raw socket for the IPPROTO_TCP protocol is not allowed", so my question about bind may not be 100 percent correct.
i.e. I don't think this will work on Linux (as you claim)
Also check if this will help https://stackoverflow.com/q/62281097/4046632
From the link in the answer it says that on some Windows OS `A call to the bind function with a raw socket for the IPPROTO_TCP protocol is not allowed", so my question about bind may not be 100 percent correct.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs