thats my code below:
bool Server::Create( int port )
{
reliableClientsSet = SDLNet_AllocSocketSet( MAX_CONNECTIONS );
if( !reliableClientsSet )
{
printf(“SDLNet_AllocSocketSet: %s\n”, SDLNet_GetError());
return false;
}
if(SDLNet_ResolveHost( &ip, NULL, port ) == -1 )
{
printf("SDLNet_ResolveHost: %s\n", SDLNet_GetError());
return false;
}
return OpenReliable( port );
}
bool Server::OpenReliable( int port )
{
serverReliable = SDLNet_TCP_Open(&ip);
if( !serverReliable ) //crashes here!!!
{
printf(“SDLNet_TCP_Open: %s\n”, SDLNet_GetError());
return false;
}
/*
//add to server socket to set
int noUsed = SDLNet_TCP_AddSocket( reliableClients, serverReliable );
if( noUsed == -1 )
{
printf(“SDLNet_AddSocket: %s\n”, SDLNet_GetError());
return false;
}*/
bServer = true;
return true;
}
is there not init function for sdl_net?-------------------------------
Fabian “SupaGu” Mathews
From: tsm@accesscomm.ca (Tyler Montbriand)
Reply-To: sdl at libsdl.org
To: sdl at libsdl.org
Subject: Re: [SDL] SDL_net: SDLNet_TCP_Open & windows
Date: Wed, 18 Feb 2004 10:38:02 -0600
On Wednesday 18 February 2004 05:00, Fabian Mathews wrote:
what can i say, SDLNet_TCP_Open & windows dont mix.
Windows fails to open a tcp socket.
I’ve never had a problem myself. Other than that, I’m not too sure what to
tell you - wait, I shall use my psychic powers to debug your malfunctioning
code!
ommmMMmmMMmmmmm…
ommmMMmmMMmmmmm…
…sorry, it’s just not happening today.
j/k, but I think you get my point - could you please post your source code
so
that we can take a look? If it is a bug in SDL_net we need to know what
conditions it happens in, and if it isn’t an SDL_net bug we might be able to
help you.
SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl
Help STOP SPAM with the new MSN 8 and get 2 months FREE*
http://join.msn.com/?page=features/junkmail