Why am I getting a "Couldn't create an ENet host" error?
Asked Answered
R

1

0

I have some server code which is giving me the error "Couldn't create ENet host". I'm not sure why since my code is the same as the example I was referencing. I think it was even working at an earlier point in the project.. How would I fix this?

The code for my ServerManager class includes the following:

var multiplayerPeer:ENetMultiplayerPeer = ENetMultiplayerPeer.new()

func start(port:int):
	#Error thrown at this line
	multiplayerPeer.create_server(port)
	
	#This line says "Supplied MultiplayerPeer must be either Connecting or Connected"
	multiplayer.multiplayer_peer = multiplayerPeer
	
	multiplayer.peer_connected.connect(peer_connected)
	multiplayer.peer_disconnected.connect(peer_disconnected)
Royo answered 31/7, 2023 at 10:53 Comment(0)
R
0

Looks like rebooting my machine fixed the error.

Royo answered 1/8, 2023 at 1:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.