Method AddDriver
AddDriver(NetworkDriver)
Add a NetworkDriver instance to the MultiNetworkDriver. This driver
instance must not already have any active connections, and must have the same number of
pipelines as previously added instances. Drivers that are intended to take on a server
role must also already be in the listening state.
Declaration
public int AddDriver(NetworkDriver driver)
Parameters
| Type | Name | Description |
|---|---|---|
| NetworkDriver | driver | NetworkDriver instance to add. |
Returns
| Type | Description |
|---|---|
| int | An ID identifying the NetworkDriver inside the |
Remarks
The MultiNetworkDriver takes ownership of the NetworkDriver. While
it is possible to keep operating on the NetworkDriver once it's been
added, this is not recommended (at least for the operations that are already covered by
the MultiNetworkDriver API).
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | If the |
| ArgumentException | If the driver already has active connections, or if it doesn't have as many pipelines as previously added drivers. Note that this exception is only thrown when safety checks are enabled (i.e. in the editor), otherwise the driver will be added anyway. |