4 registered members (dBc, clonman, TipmyPip, 1 invisible),
18,936
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
[ANet] Restarting server
#345230
10/24/10 12:13
10/24/10 12:13
|
Joined: May 2009
Posts: 445 Peine, Germany
Razoron
OP
Senior Member
|
OP
Senior Member
Joined: May 2009
Posts: 445
Peine, Germany
|
Hi, currently, I'm working on the server restart function. For that, I deinitialize the compltete server and all clients to reconnect. But why it isn't possible to recreate a server on the same port:
#include <acknex.h>
#include "anet.h"
int main()
{
wait(1);
if(enet_init() == ANET_ERROR)
{
error("Couldn't init ANet.");
}
if(enet_init_server(2700, 10, "") == ANET_ERROR)
{
error("Couldn't init first server.");
}
while(MY_CONNECTION != SERVER_MODE)
{
wait(1);
}
if(enet_init_client("localhost", 2700, "") == ANET_ERROR)
{
error("Couldn't init client.");
}
while(MY_CONNECTION != CLIENT_SERVER_MODE)
{
wait(1);
}
error("All hosts created. Destroying now...");
enet_destroy_host();
while(MY_CONNECTION != NO_CONNECTION)
{
wait(1);
}
if(enet_init_server(2700, 10, "") == ANET_ERROR)
{
error("Couldn't init second server.");
}
}
I can't create the second server, but all hosts are destroyed. Tell me why  .
|
|
|
Re: [ANet] Restarting server
[Re: Razoron]
#345298
10/24/10 21:30
10/24/10 21:30
|
Joined: Jul 2005
Posts: 1,930 Austria
Dark_samurai
Serious User
|
Serious User
Joined: Jul 2005
Posts: 1,930
Austria
|
Hi Razoron, I think I accidently deleted two lines of code when I maintained some stuff in one of the last versions. So the problem is in the ANet source. I've sent you a beta version. Please try it out and tell me if it works now  Thanks for the report!
ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)! get free version
|
|
|
Re: [ANet] Restarting server
[Re: Razoron]
#345908
10/30/10 17:44
10/30/10 17:44
|
Joined: Dec 2008
Posts: 1,218 Germany
Rackscha
Serious User
|
Serious User
Joined: Dec 2008
Posts: 1,218
Germany
|
Ah, now that explains why my Bomberman has issues with closing and reconnecting the server, just by updating Anet^^".
Good to read it can be fixed soon.
MY Website with news of my projects: (for example my current Muliplayer Bomberman, GenesisPrecompiler for LiteC and TileMaster, an easy to use Tile editor) Sparetime-Development
|
|
|
|