Sunday, October 9, 2022

[SOLVED] how to initialize sockets in linux environemnt

Issue

I have a code snippet to initialize a sockets in windows. How would I initialize the socket in Linux environment.

    WSADATA wsa
    if(WAStartup(MkeWORD(2,2), $wsa) !=0 )
    {
    exit(0);
    }

Solution

On Linux you don't initialize a network environment like WSA. Sockets can be used out of the box. See https://man7.org/linux/man-pages/man2/socket.2.html for documentation.



Answered By - TeaAge Solutions
Answer Checked By - Senaida (WPSolving Volunteer)