Serial Port Monitor Protocol Analyzer Data Logger - Com Port Monitoring and Analyzing Software for Windows
UDP Session Object
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 await keyword.
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 (Promise<Uint8Array>).