Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

Socket Plugin Connect Problem

$
0
0
I'm preparing an client, I tested it on windows and it worked perfectly.

But when I switched to my Linux VPS ubuntu, the server simply closes when using socket_connect

Code:

Code:

public OnPlayerConnect(playerid)
{
        new pIP[16];
        new string[32];

        bac_Socket[playerid] = socket_create(UDP);
        GetPlayerIp(playerid, pIP, sizeof(pIP));

        IsACConnected[playerid] = false;
        IsCheater[playerid] = false;
        UpdateNeeded[playerid] = false;

        format(string, sizeof(string), "connected |%d| ,%s,", playerid, CURRENT_VERSION); // azeite
   
        socket_connect(bac_Socket[playerid], pIP, 4000);
        socket_send(bac_Socket[playerid], string, sizeof(string));

        return 1;
}

Result:
Server log:

Code:

socket_connect(): Socket ID 0 has failed to connect.
I believe it happened because port 4000(TCP/UDP) is not released on Linux. If that is the problem, please tell me how to release it.

> sorry my bad english

Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>