There are currently four types of events supplied by the
As mentioned, there are a few subtle differences running the driver as a host or client. Mainly when it comes to consumption of events.
Both your client and your server loop will want to consume the events that are produced by the
NetworkDriver. And you do so by either calling
PopEvent on each
NetworkConnection similar to how we did before.
You can try calling the
PopEventForConnection on the
NetworkDriver as we did in the ServerBehaviour example:
There is no real difference between these calls, both calls will do the same thing. Its just how you want to phrase yourself when writing the code.
And finally to receive a new
NetworkConnection on the Driver while Listening you can call
This event is only available if the
2. A socket timeout occurred.
3. Maximum connect attempts on the
If you call
Reviewing this table, note the following:
Connectevent is only available if the
To receive any
Connectevents on a
NetworkDriverthat is in the
Listeningstate, call the special function
Acceptjust as we did in the Creating a Server section in the Creating a minimal client and server workflow page.
If you call
NetworkConnection, this will not trigger an event inside your own driver.