Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/19/24 18:45
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AndrewAMD, Ayumi, kzhao, 7th_zorro), 739 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
[ANet] Restarting server #345230
10/24/10 12:13
10/24/10 12:13
Joined: May 2009
Posts: 445
Peine, Germany
Razoron Offline OP
Senior Member
Razoron  Offline 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:
Code:
#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 laugh.

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 Offline
Serious User
Dark_samurai  Offline
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 laugh

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: Dark_samurai] #345328
10/25/10 12:20
10/25/10 12:20
Joined: May 2009
Posts: 445
Peine, Germany
Razoron Offline OP
Senior Member
Razoron  Offline OP
Senior Member

Joined: May 2009
Posts: 445
Peine, Germany
Yep, thanks it works now laugh.

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 Offline
Serious User
Rackscha  Offline
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


Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1