#include <psockbun.h>
Inheritance diagram for PMonitoredSocketChannel:

Public Member Functions | |
Construction | |
| PMonitoredSocketChannel (const PMonitoredSocketsPtr &sockets, bool shared) | |
| Construct a monitored socket bundle channel. | |
Overrides from class PSocket | |
| virtual PBoolean | IsOpen () const |
| Determine if the channel is currently open. | |
| virtual PBoolean | Close () |
| Close the channel, shutting down the link to the data source. | |
| virtual PBoolean | Read (void *buffer, PINDEX length) |
| Override of PChannel functions to allow connectionless reads. | |
| virtual PBoolean | Write (const void *buffer, PINDEX length) |
| Override of PChannel functions to allow connectionless writes. | |
New functions for class | |
| void | SetInterface (const PString &iface) |
| Set the interface descriptor to be used for all reads/writes to this channel. | |
| PString | GetInterface () |
| Get the current interface descriptor being used/. | |
| bool | GetLocal (PIPSocket::Address &address, WORD &port, bool usingNAT) |
| Get the local IP address and port for the currently selected interface. | |
| void | SetRemote (const PIPSocket::Address &address, WORD port) |
| Set the remote address/port for all Write() functions. | |
| void | SetRemote (const PString &hostAndPort) |
| Set the remote address/port for all Write() functions. | |
| void | GetRemote (PIPSocket::Address &addr, WORD &port) const |
| Get the current remote address/port for all Write() functions. | |
| void | SetPromiscuous (bool flag) |
| Set flag for receiving UDP data from any remote address. | |
| bool | GetPromiscuous () |
| Get flag for receiving UDP data from any remote address. | |
| void | GetLastReceived (PIPSocket::Address &addr, WORD &port) const |
| Get the IP address and port of the last received UDP data. | |
| PString | GetLastReceivedInterface () const |
| Get the interface the last received UDP data was recieved on. | |
| const PMonitoredSocketsPtr & | GetMonitoredSockets () const |
| Get the monitored socket bundle being used by this channel. | |
Protected Attributes | |
| PMonitoredSocketsPtr | socketBundle |
| bool | sharedBundle |
| PString | currentInterface |
| bool | promiscuousReads |
| PIPSocket::Address | remoteAddress |
| bool | closing |
| WORD | remotePort |
| PIPSocket::Address | lastReceivedAddress |
| WORD | lastReceivedPort |
| PString | lastReceivedInterface |
| PMutex | mutex |
| PMonitoredSocketChannel::PMonitoredSocketChannel | ( | const PMonitoredSocketsPtr & | sockets, | |
| bool | shared | |||
| ) |
Construct a monitored socket bundle channel.
| sockets | Monitored socket bundle to use in channel |
| shared | Monitored socket is shared by other channels |
| virtual PBoolean PMonitoredSocketChannel::Close | ( | ) | [virtual] |
Close the channel, shutting down the link to the data source.
Reimplemented from PChannel.
| PString PMonitoredSocketChannel::GetInterface | ( | ) |
Get the current interface descriptor being used/.
| void PMonitoredSocketChannel::GetLastReceived | ( | PIPSocket::Address & | addr, | |
| WORD & | port | |||
| ) | const [inline] |
Get the IP address and port of the last received UDP data.
| addr | Remote IP address |
| port | Remote port number |
| PString PMonitoredSocketChannel::GetLastReceivedInterface | ( | ) | const [inline] |
Get the interface the last received UDP data was recieved on.
| bool PMonitoredSocketChannel::GetLocal | ( | PIPSocket::Address & | address, | |
| WORD & | port, | |||
| bool | usingNAT | |||
| ) |
Get the local IP address and port for the currently selected interface.
| address | IP address of local interface |
| port | Port listening on |
| usingNAT | Require NAT address/port |
| const PMonitoredSocketsPtr& PMonitoredSocketChannel::GetMonitoredSockets | ( | ) | const [inline] |
Get the monitored socket bundle being used by this channel.
| bool PMonitoredSocketChannel::GetPromiscuous | ( | ) | [inline] |
Get flag for receiving UDP data from any remote address.
| void PMonitoredSocketChannel::GetRemote | ( | PIPSocket::Address & | addr, | |
| WORD & | port | |||
| ) | const [inline] |
Get the current remote address/port for all Write() functions.
| addr | Remote IP address |
| port | Remote port number |
| virtual PBoolean PMonitoredSocketChannel::IsOpen | ( | ) | const [virtual] |
| virtual PBoolean PMonitoredSocketChannel::Read | ( | void * | buffer, | |
| PINDEX | length | |||
| ) | [virtual] |
| void PMonitoredSocketChannel::SetInterface | ( | const PString & | iface | ) |
Set the interface descriptor to be used for all reads/writes to this channel.
The iface parameter can be a partial descriptor eg "%eth0".
| iface | Interface descriptor |
| void PMonitoredSocketChannel::SetPromiscuous | ( | bool | flag | ) | [inline] |
Set flag for receiving UDP data from any remote address.
If the flag is false then data received from anything other than the configured remote address and port is ignored.
| flag | New flag |
| void PMonitoredSocketChannel::SetRemote | ( | const PString & | hostAndPort | ) |
Set the remote address/port for all Write() functions.
| hostAndPort | String of the form host[:port] |
| void PMonitoredSocketChannel::SetRemote | ( | const PIPSocket::Address & | address, | |
| WORD | port | |||
| ) |
Set the remote address/port for all Write() functions.
| address | Remote IP address |
| port | Remote port number |
| virtual PBoolean PMonitoredSocketChannel::Write | ( | const void * | buffer, | |
| PINDEX | length | |||
| ) | [virtual] |
bool PMonitoredSocketChannel::closing [protected] |
PString PMonitoredSocketChannel::currentInterface [protected] |
WORD PMonitoredSocketChannel::lastReceivedPort [protected] |
PMutex PMonitoredSocketChannel::mutex [protected] |
bool PMonitoredSocketChannel::promiscuousReads [protected] |
WORD PMonitoredSocketChannel::remotePort [protected] |
bool PMonitoredSocketChannel::sharedBundle [protected] |
1.4.7