Can't create Enet server.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Mauppi1

I don’t know if it’s me or the engine, but when i try to create an Enet server it throws: Could not create Enet server.

Btw, i haven’t used Imgur before, so i don’t know if the images are there…

The images work fine. :slight_smile: And the code excerpt you provided in your second screenshot looks alright too! However, the errors indicate there still went something wrong. Note that create_server returns an error code, you should check it:

var peer = NetworkedMultiplayerENet.new()
var error = peer.create_server(272, 2)
if error: print("ERROR CODE: ", error)
get_tree().set_network_peer(peer)

It might help you (or us, if you post it here) to fix the problem.

njamster | 2020-04-21 16:49

Sorry, i am very late. It throws an ERR_CANT_CREATE code.

Mauppi1 | 2020-05-07 10:06

:bust_in_silhouette: Reply From: backendcoder

Port numbers below 1024 may require elevated permissions. 272 was used in the example code.

:bust_in_silhouette: Reply From: phucotaku

i think i understand your problem, this error occurs when you try to create a sever many times, only need to create it once, it’s already created, if you want to create another one, you have to disconnect with the old one, otherwise it will show the above error, maybe your server is already created but you don’t know, use a few commands to test it