Click or drag to resize

NetworkedMultiplayerENetCreateClient Method

Create client that connects to a server at address using specified port. The given address needs to be either a fully qualified domain name (e.g. "www.example.com") or an IP address in IPv4 or IPv6 format (e.g. "192.168.1.1"). The port is the port the server is listening on. The in_bandwidth and out_bandwidth parameters can be used to limit the incoming and outgoing bandwidth to the given number of bytes per second. The default of 0 means unlimited bandwidth. Note that ENet will strategically drop packets on specific sides of a connection between peers to ensure the peer's bandwidth is not overwhelmed. The bandwidth parameters also determine the window size of a connection which limits the amount of reliable packets that may be in transit at any given time. Returns if a client was created, if this NetworkedMultiplayerENet instance already has an open connection (in which case you need to call CloseConnection(UInt32) first) or if the client could not be created. If client_port is specified, the client will also listen to the given port; this is useful for some NAT traversal techniques.

Namespace:  Godot
Assembly:  GodotSharp (in GodotSharp.dll) Version: 1.0.0
Syntax
C#
public Error CreateClient(
	string address,
	int port,
	int inBandwidth = 0,
	int outBandwidth = 0,
	int clientPort = 0
)

Parameters

address
Type: SystemString

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

port
Type: SystemInt32

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

inBandwidth (Optional)
Type: SystemInt32

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

outBandwidth (Optional)
Type: SystemInt32

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

clientPort (Optional)
Type: SystemInt32

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

Return Value

Type: Error

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

See Also