Exemple #1
0
//===========================================================================
//
// Parameter:				-
// Returns:					-
// Changes Globals:		-
//===========================================================================
int Net_Send( socket_t *sock, netmessage_t *msg ){
	int size;

	size = msg->size;
	msg->size = 0;
	NMSG_WriteLong( msg, size - 4 );
	msg->size = size;
	//WinPrint("Net_Send: message of size %d\n", sendmsg.size);
	return WINS_Write( sock->socket, msg->data, msg->size, NULL );
} //end of the function Net_SendSocketReliable
Exemple #2
0
//===========================================================================
//
// Parameter:				-
// Returns:					-
// Changes Globals:		-
//===========================================================================
int WINS_Broadcast( int socket, byte *buf, int len ){
	int ret;

	if ( socket != net_broadcastsocket ) {
		if ( net_broadcastsocket != 0 ) {
			WinError( "Attempted to use multiple broadcasts sockets\n" );
		}
		ret = WINS_MakeSocketBroadcastCapable( socket );
		if ( ret == -1 ) {
			WinPrint( "Unable to make socket broadcast capable\n" );
			return ret;
		}
	}

	return WINS_Write( socket, buf, len, &broadcastaddr );
} //end of the function WINS_Broadcast
Exemple #3
0
int
WINS_Broadcast(int socket, byte *buf, int len)
{
    int ret;

    if (socket != net_broadcastsocket) {
	if (net_broadcastsocket != 0)
	    Sys_Error("Attempted to use multiple broadcasts sockets");
	ret = WINS_MakeSocketBroadcastCapable(socket);
	if (ret == -1) {
	    Con_Printf("Unable to make socket broadcast capable\n");
	    return ret;
	}
    }

    return WINS_Write(socket, buf, len, (struct qsockaddr *)&broadcastaddr);
}
Exemple #4
0
int WINS_Broadcast (int socket, byte *buf, int len)
{
#ifdef ID_PC
	int ret;

	if (socket != net_broadcastsocket)
	{
		if (net_broadcastsocket != 0)
			Sys_Error("Attempted to use multiple broadcasts sockets\n");
		WINS_GetLocalAddress();
		ret = WINS_MakeSocketBroadcastCapable (socket);
		if (ret == -1)
		{
			Con_Printf("Unable to make socket broadcast capable\n");
			return ret;
		}
	}

	return WINS_Write (socket, buf, len, &broadcastaddr);
#else
	return 0;
#endif
}