#include <RefCountingSocket.h>
Inheritance diagram for RefCountingSocket:
Public Member Functions | |
RefCountingSocket (const RefCountingSocket &) | |
RefCountingSocket (MNSelector &sel, MNSocket &sock) | |
RefCountingSocket (MNSelector &sel, int port) | |
virtual | ~RefCountingSocket () |
void | startUdpServer (bool sender) |
void | stopUdpServer () |
virtual int | reader (MNRope *&rope, struct sockaddr_in *&dest)=0 |
virtual void | writer ()=0 |
bool | join_multicast (int port, const char *address) |
bool | is_multicast_joined () const |
void | set_multicast_ttl (int val) |
int | get_multicast_ttl () |
int | get_descriptor () |
void | set_multicast_if (const char *ifname) |
int | send (struct iovec *iov, size_t iov_size, int target_port, const char *target_addr) |
int | send (MNRope *rope, const struct sockaddr_in &target_addr) |
int | send (struct iovec *iov, size_t iov_size, const struct sockaddr_in &target_addr) |
MNSelector & | getSelector () |
|
|
|
|
|
|
|
Destructor. This destructor is not thread-safe. The socket has been deactivated. The application is responsible for preventing write access to the object when the destructor is called. Arrival of data should be deactivated before this function is call using the stopUDPServer()/stopTCPServer() method explicitly (although it will be called in the destructor as well. |
|
|
|
Retrieve the current TTL value.
|
|
Returns the selector of the MNUDPServerSocket/MNTCPServerSocket socket that is actually used. The selector can be reuse by other objects that need to wait for sockets. |
|
|
|
|
|
Called when data is received.
Implemented in MNRTPbase.
|
|
Send the array of iovec structures to the given addr.
|
|
Send the rope to the given addr.
|
|
|
|
Change the default interface for multicast packets.
|
|
Change the current TTL value.
|
|
Creates the thread in RefCountedSocket, if it does not exist yet. |
|
Terminates the reception of data. After this call, the socket can not be restarted and should be deleted. The call blocks the calling thread until it is safe to assume that no more data will arrive. It is safe to delete the object. |
|
Implemented in MNRTPbase.
|