GetConnection

GetConnection
int GetConnection()

Documentation

Checks for new connections at port 45150. Intended for server code. If you encounter problems, it's likely you need to open port 45150 on your firewall or router.

Example Usage

int i = GetConnection();
if (socket_count < SOCKET_MAX_COUNT)
{
	socket[socket_count] = i;
	SocketSendString(i, "RPL_CONNECTIONOK");
	Log("A new client connected via socket "+str(i));
	socket_count++;
}
else
{
	SocketSendString(i, "ERR_SERVERFULL");
	Log("Socket "+ str(i) +" was refused a connection, because the server's full.");
	SocketClose(i);
}
Talkback

There are no talkbacks on this documentation page yet. Post the first?

Post a new comment?

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.