UdpSocket class: Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
Line 7: Line 7:
The User Datagram Protocol is a low-level communications protocol that provides an alternative to [http://en.wikipedia.org/wiki/Transmission_Control_Protocol TCP]. The two main features that distinguish UDP from TCP are that it is connectionless and that it is message based.
The User Datagram Protocol is a low-level communications protocol that provides an alternative to [http://en.wikipedia.org/wiki/Transmission_Control_Protocol 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 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. Once the connection is established, the connected socket establish context for the exchanged data.


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://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol 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.
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://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol 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.
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==
==List of UdpSocket methods==
The [[List of UdpSocket methods|"List of UdpSocket methods"]] shows all the class methods.
The [[List of UdpSocket methods|"List of UdpSocket methods"]] shows all the class methods.

Revision as of 22:22, 21 April 2012

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. Once the connection is established, the connected socket establish context for the exchanged data.

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.