#include <PracticalSocket.h>
|
| UDPSocket () throw (SocketException) |
|
| UDPSocket (unsigned short localPort) throw (SocketException) |
|
| UDPSocket (const string &localAddress, unsigned short localPort) throw (SocketException) |
|
void | disconnect () throw (SocketException) |
|
void | sendTo (const void *buffer, int bufferLen, const string &foreignAddress, unsigned short foreignPort) throw (SocketException) |
|
int | recvFrom (void *buffer, int bufferLen, string &sourceAddress, unsigned short &sourcePort) throw (SocketException) |
|
void | setMulticastTTL (unsigned char multicastTTL) throw (SocketException) |
|
void | joinGroup (const string &multicastGroup) throw (SocketException) |
|
void | leaveGroup (const string &multicastGroup) throw (SocketException) |
|
string | getBroadcastAddress () throw (SocketException) |
|
unsigned int | getLocalIPAddress () throw (SocketException) |
|
void | setReuseAddr (bool reuse) throw (SocketException) |
|
void | setMulticastLoop (bool loop) throw (SocketException) |
|
int | select_t (int sec, int usec) |
|
void | setNonBlocking (bool nonblock) |
|
void | connect (const string &foreignAddress, unsigned short foreignPort) throw (SocketException) |
|
void | send (const void *buffer, int bufferLen) throw (SocketException) |
|
int | recv (void *buffer, int bufferLen) throw (SocketException) |
|
string | getForeignAddress () throw (SocketException) |
|
unsigned short | getForeignPort () throw (SocketException) |
|
| ~Socket () |
|
string | getLocalAddress () throw (SocketException) |
|
unsigned short | getLocalPort () throw (SocketException) |
|
void | setLocalPort (unsigned short localPort) throw (SocketException) |
|
void | setLocalAddressAndPort (const string &localAddress, unsigned short localPort=0) throw (SocketException) |
|
|
static void | cleanUp () throw (SocketException) |
|
static unsigned short | resolveService (const string &service, const string &protocol="tcp") |
|
| CommunicatingSocket (int type, int protocol) throw (SocketException) |
|
| CommunicatingSocket (int newConnSD) |
|
| Socket (int type, int protocol) throw (SocketException) |
|
| Socket (int sockDesc) |
|
int | sockDesc |
|
br::pucrio::telemidia::ginga::core::system::compat::UDPSocket::UDPSocket |
( |
| ) |
|
throw | ( | SocketException |
| ) | | |
Construct a UDP socket
- Exceptions
-
br::pucrio::telemidia::ginga::core::system::compat::UDPSocket::UDPSocket |
( |
unsigned short |
localPort | ) |
|
throw | ( | SocketException |
| ) | | |
Construct a UDP socket with the given local port
- Parameters
-
- Exceptions
-
br::pucrio::telemidia::ginga::core::system::compat::UDPSocket::UDPSocket |
( |
const string & |
localAddress, |
|
|
unsigned short |
localPort |
|
) |
| |
throw | ( | SocketException |
| ) | | |
Construct a UDP socket with the given local port and address
- Parameters
-
localAddress | local address |
localPort | local port |
- Exceptions
-
void br::pucrio::telemidia::ginga::core::system::compat::UDPSocket::disconnect |
( |
| ) |
|
throw | ( | SocketException |
| ) | | |
Unset foreign address and port
- Returns
- true if disassociation is successful
- Exceptions
-
string br::pucrio::telemidia::ginga::core::system::compat::UDPSocket::getBroadcastAddress |
( |
| ) |
|
throw | ( | SocketException |
| ) | | |
Returns the broadcast address for the first connected interface
unsigned int br::pucrio::telemidia::ginga::core::system::compat::UDPSocket::getLocalIPAddress |
( |
| ) |
|
throw | ( | SocketException |
| ) | | |
Returns the IP address for the first connected interface
- Returns
- int for the local IP address
void br::pucrio::telemidia::ginga::core::system::compat::UDPSocket::joinGroup |
( |
const string & |
multicastGroup | ) |
|
throw | ( | SocketException |
| ) | | |
Join the specified multicast group
- Parameters
-
multicastGroup | multicast group address to join |
- Exceptions
-
void br::pucrio::telemidia::ginga::core::system::compat::UDPSocket::leaveGroup |
( |
const string & |
multicastGroup | ) |
|
throw | ( | SocketException |
| ) | | |
Leave the specified multicast group
- Parameters
-
multicastGroup | multicast group address to leave |
- Exceptions
-
int br::pucrio::telemidia::ginga::core::system::compat::UDPSocket::recvFrom |
( |
void * |
buffer, |
|
|
int |
bufferLen, |
|
|
string & |
sourceAddress, |
|
|
unsigned short & |
sourcePort |
|
) |
| |
throw | ( | SocketException |
| ) | | |
Read read up to bufferLen bytes data from this socket. The given buffer is where the data will be placed
- Parameters
-
buffer | buffer to receive data |
bufferLen | maximum number of bytes to receive |
sourceAddress | address of datagram source |
sourcePort | port of data source |
- Returns
- number of bytes received and -1 for error
- Exceptions
-
int br::pucrio::telemidia::ginga::core::system::compat::UDPSocket::select_t |
( |
int |
sec, |
|
|
int |
usec |
|
) |
| |
Applies select() with the given timeout value
- Parameters
-
sec | int value for the sec portion of timeval structure (select) |
usec | int value for the usec portion of timeval structure (select) |
- Returns
- int with the select() value
void br::pucrio::telemidia::ginga::core::system::compat::UDPSocket::sendTo |
( |
const void * |
buffer, |
|
|
int |
bufferLen, |
|
|
const string & |
foreignAddress, |
|
|
unsigned short |
foreignPort |
|
) |
| |
throw | ( | SocketException |
| ) | | |
Send the given buffer as a UDP datagram to the specified address/port
- Parameters
-
buffer | buffer to be written |
bufferLen | number of bytes to write |
foreignAddress | address (IP address or name) to send to |
foreignPort | port number to send to |
- Returns
- true if send is successful
- Exceptions
-
void br::pucrio::telemidia::ginga::core::system::compat::UDPSocket::setMulticastLoop |
( |
bool |
loop | ) |
|
throw | ( | SocketException |
| ) | | |
Sets the IP Multicast Loop option for the socket (sockopt IP_MULTICAST_LOOP)
- Parameters
-
loop | boolean value for the loop parameter |
- Exceptions
-
void br::pucrio::telemidia::ginga::core::system::compat::UDPSocket::setMulticastTTL |
( |
unsigned char |
multicastTTL | ) |
|
throw | ( | SocketException |
| ) | | |
Set the multicast TTL
- Parameters
-
multicastTTL | multicast TTL |
- Exceptions
-
void br::pucrio::telemidia::ginga::core::system::compat::UDPSocket::setNonBlocking |
( |
bool |
nonblock | ) |
|
Defines socket blocking mode
- Parameters
-
bool | nonblock (true = nonblocking mode, false = blocking mode) |
void br::pucrio::telemidia::ginga::core::system::compat::UDPSocket::setReuseAddr |
( |
bool |
reuse | ) |
|
throw | ( | SocketException |
| ) | | |
Sets the Reuse Address option for the socket (sockopt SO_REUSEADDR)
- Parameters
-
reuse | boolean value for the reuse parameter |
- Exceptions
-
The documentation for this class was generated from the following files:
- gingacc-system/include/system/compat/PracticalSocket.h
- gingacc-system/src/compat/PracticalSocket.cpp