Click or drag to resize

NetworkedMultiplayerENetCreateServer Method

Create server that listens to connections via port. The port needs to be an available, unused port between 0 and 65535. Note that ports below 1024 are privileged and may require elevated permissions depending on the platform. To change the interface the server listens on, use SetBindIp(String). The default IP is the wildcard "*", which listens on all available interfaces. max_clients is the maximum number of clients that are allowed at once, any number up to 4095 may be used, although the achievable number of simultaneous clients may be far lower and depends on the application. For additional details on the bandwidth parameters, see CreateClient(String, Int32, Int32, Int32, Int32). Returns if a server was created, if this NetworkedMultiplayerENet instance already has an open connection (in which case you need to call CloseConnection(UInt32) first) or if the server could not be created.

Namespace:  Godot
Assembly:  GodotSharp (in GodotSharp.dll) Version: 1.0.0
Syntax
C#
public Error CreateServer(
	int port,
	int maxClients = 32,
	int inBandwidth = 0,
	int outBandwidth = 0
)

Parameters

port
Type: SystemInt32

[Missing <param name="port"/> documentation for "M:Godot.NetworkedMultiplayerENet.CreateServer(System.Int32,System.Int32,System.Int32,System.Int32)"]

maxClients (Optional)
Type: SystemInt32

[Missing <param name="maxClients"/> documentation for "M:Godot.NetworkedMultiplayerENet.CreateServer(System.Int32,System.Int32,System.Int32,System.Int32)"]

inBandwidth (Optional)
Type: SystemInt32

[Missing <param name="inBandwidth"/> documentation for "M:Godot.NetworkedMultiplayerENet.CreateServer(System.Int32,System.Int32,System.Int32,System.Int32)"]

outBandwidth (Optional)
Type: SystemInt32

[Missing <param name="outBandwidth"/> documentation for "M:Godot.NetworkedMultiplayerENet.CreateServer(System.Int32,System.Int32,System.Int32,System.Int32)"]

Return Value

Type: Error

[Missing <returns> documentation for "M:Godot.NetworkedMultiplayerENet.CreateServer(System.Int32,System.Int32,System.Int32,System.Int32)"]

See Also