#include <XMLConfigInput.h>
◆ XMLConfigInput()
nidas::core::XMLConfigInput::XMLConfigInput |
( |
| ) |
|
|
inline |
◆ accept()
Like ServerSocket::accept(), this method will return a connected socket.
As with listen(), it registers with a McSocketListener to listen on the multicast address, then waits until a request is received with a matching request type and socket type. accept() will return with a pointer to a connected TCP Socket for a McSocket<Socket>, or to a DatagramSocket for a McSocket<DatagramSocket>, with a default destination address of the requesting host and port. The caller owns the pointer to the socket and is responsible for closing and deleting it when done.
- Exceptions
-
◆ close()
Unregister this McSocket from the multicasting and listening threads.
- Exceptions
-
◆ connect()
Do a request(), and then wait until a TCP connection is established, or a UDP datagram is received back.
Returns the pointer to the connected TCP Socket or the DatagramSocket. McSocket then owns the pointer to the socket and is responsible for closing and deleting it when done.
- Exceptions
-
◆ connected()
Virtual method that is called when a socket connection is established.
This must be implemented in derived classes if the user wants to implement an asynchronous, two-step connection using listen() instead of accept() for incoming requests or request() instead of connect() for outgoing requests.
- Parameters
-
sock | The socket which is ready for I/O. McSocket then owns the pointer to the socket and is responsible for closing and deleting it when done. |
Reimplemented in nidas::core::McSocket::MyMcSocket.
◆ getInet4McastSocketAddress()
Get the multicast address for listening to requests.
◆ getInterface()
◆ getInterfaces()
Return all network interfaces on this system.
- Exceptions
-
◆ getRequestType()
Get the request type number.
◆ joinMulticaster()
◆ listen()
Register with a McSocketListener to listen on the multicast address.
When a request is received on the socket port, with a matching request type and socket type, McSocketListener will either do a Socket::connect() to establish a TCP connection back to the requesting host and port if the socket type is SOCK_STREAM, or if the socket type is SOCK_DGRAM, will create a DatagramSocket with a default destination address of the requesting host and port. Once this has been done, McSocketListener will call the offer() method of this McSocket. offer() then calls the virtual connected() method, passing a pointer to the connected socket. Use either listen() or accept() to wait for a connection.
- Exceptions
-
◆ offer() [1/2]
◆ offer() [2/2]
How a McSocketListener passes back a connected TCP socket or DatagramSocket.
offer() calls the connected() virtual method. McSocket will own the pointer to the socket and is responsible for closing and deleting it when done.
- Parameters
-
sock | A pointer to a Socket. May be null, in which case err will be a non-zero errno that occured. |
err | If sock is null, an errno. |
◆ request()
Start issuing requests for a connection by multicasting McSocketDatagrams.
When a response is received, either in the form of a TCP socket connection in the case of a socket type of SOCK_STREAM, or a datagram is received in the case of a socket type of SOCK_DGRAM, then the connected() method is called.
- Exceptions
-
◆ setInet4McastSocketAddress()
Set the multicast address for listening to requests.
- Parameters
-
val | Multicast address to listen for McSocketDatagrams. |
◆ setInterface()
Set a specific interface for the multicasts.
If a request() or connect() is done, then requests will be sent on this interface. If an listen() or accept() is done, then an MulticastSocket::joinInterface() will be done on this interface to listen for incoming datagrams. If the interface is not set, or is left at the default of INADDR_ANY, then McSocket will send on or join all available interfaces capable of multicast, including the loopback interface.
◆ setRequestType()
Set the request type value.
This can be any number, agreed upon by the McSocket sending requests and the McSocket listening for requests.
- Parameters
-
◆ _connectCond
◆ _iface
◆ _mcastAddr
◆ _multicaster
The thread we start which multicasts for connections.
◆ _multicaster_mutex
◆ _newpktinfo
◆ _newsocket
◆ _offerErrno
◆ _requestType
◆ _socketOffered
The documentation for this class was generated from the following file: