UDP Session object represents a running UDP session. It implements the IUdpSession interface. A reference to a session object is obtained through the INetworkManager.createUdpSession method.
UDP Session API is asynchronous. All methods (except IUdpSession.stop) return promise objects. This means that they complete immediately and the caller needs to schedule a continuation to get the result of the operation. This can be done using the call to
Promise.then or using ES2017
Client UDP session should be started with a call to IUdpSession.connect method. It returns a promise that is completed as soon as connection is established. Server UDP session should be started with a call to IUdpSession.bind method.
To stop a session, call IUdpSession.stop method. When UDP session object is collected by garbage collector, the session is closed automatically.
UDP Session object implements the IUdpSession.send method with three overloads that allows the user script to send the data to the UDP session. Method returns promise that completed as soon as data sending is finished.
To receive data from a session, call IUdpSession.receive method. It returns a promise object (