28.09.2017, 21:40
Anyone have any idea why this happens? I'm trying to connect my web chat page (which is hosted in the website host) to the .pwn script (which is hosted in the VPS) but it doesn't work properly, It doesn't even show if the socket connected or not in the console.
I have tested it in the localhost and it worked flawless. I tried contacting the hosters, they told me the ports are already opened, here's my codes:
I don't get it, what IP should I use? Server IP or the website IP?
Any help would be appreciated, thanks in advance.
I have tested it in the localhost and it worked flawless. I tried contacting the hosters, they told me the ports are already opened, here's my codes:
PHP код:
// .PWN script
gSocket = socket_create(TCP);
if(is_socket_valid(gSocket)) {
socket_set_max_connections(gSocket, MAX_PLAYERS);
socket_bind(gSocket, "SERVERIP");
socket_listen(gSocket, 7778);
}
PHP код:
// PHP Script
set_time_limit(0);
ob_implicit_flush();
$address = 'SERVERIP';
$port = 7778;
socket_connect($socket, $address, $port);
Any help would be appreciated, thanks in advance.