UdpSocket class

From m204wiki
Revision as of 19:04, 17 April 2012 by Alex (talk | contribs)
Jump to navigation Jump to search

The UdpSocket class allows User Language programs to send and receive UDP (User Datagram Protocol) messages. Both client and server applications may be written using the UdpSocket class.

Note: To use the UdpSocket class, you must have licensed Janus Sockets and Janus SOAP.

Why UDP?

The User Datagram Protocol is a low-level communications protocol that provides an alternative to TCP. The two main features that distinguish UDP from TCP are that it is connectionless and that it is message based.

UDP is connectionless in that UDP does not establish a connection between two endpoints in a conversation. Instead, messages are simply sent between two endpoints. Because there is no connection between the endpoints, the messages are each independent units and it is up to the applications that use UDP to establish context for the messages. TCP, is a connection-based protocol where a connection is established between two endpoints and then data is streamed between the two end-points.

UDP and TCP both have many higher-level protocols layered above them and, in general, it's preferable to use the higher-level protocols as they tend to take care of more of the interaction details. For example, if a client wishes to use a request/response protocol to communicate with a server, HTTP provides an ideal communications protocol. Most systems provide both client and server HTTP APIs. Model 204 is no exception; with HTTP Helper providing a client API and Janus Web Server providing a server API. However, there might be reasons to use a lower-level TCP or UDP API. The first is that there might not be an API to support a required protocol. For example, there is currently no telnet client API available in Model 204, so if one is required, it might be possible to use the Janus Sockets API to implement the required parts of the telnet protocol using the Sockets class.


List of UdpSocket methods

The "List of UdpSocket methods" shows all the class methods.