Client.Connect Method
Namespace: Riptide
Assembly: RiptideNetworking.dll
Connect(string, int, byte, Message, bool)
Attempts to connect to a server at the given host address.
public bool Connect(string hostAddress, int maxConnectionAttempts = 5, byte messageHandlerGroupId = 0, Message message = null, bool useMessageHandlers = true)
Parameters
string | hostAddress |
The host address to connect to. |
int | maxConnectionAttempts |
How many connection attempts to make before giving up. |
byte | messageHandlerGroupId |
The ID of the group of message handler methods to use when building messageHandlers. |
Message | message |
Data that should be sent to the server with the connection attempt. Use Create() to get an empty message instance. |
bool | useMessageHandlers |
Whether or not the client should use the built-in message handler system. |
Returns
bool | true if a connection attempt will be made. false if an issue occurred (such as |
Remarks
Riptide's default transport expects the host address to consist of an IP and port, separated by a colon. For example: 127.0.0.1:7777
. If you are using a different transport, check the relevant documentation for what information it requires in the host address.
Setting useMessageHandlers
to false will disable the automatic detection and execution of methods with the MessageHandlerAttribute, which is beneficial if you prefer to handle messages via the MessageReceived event.