#include <SocketDatagram_t.h>
Inheritance diagram for vpr::SocketDatagram_t:


Public Types | |
| typedef SocketConfig_ | Config |
| typedef Config::SocketDatagramImpl | SocketDatagramImpl |
Public Methods | |
| SocketDatagram_t () | |
| Default constructor. More... | |
| SocketDatagram_t (const vpr::InetAddr &local_addr, const vpr::InetAddr &remote_addr) | |
| Constructor. More... | |
| SocketDatagram_t (const SocketDatagram_t &sock) | |
| Copy constructor. More... | |
| virtual | ~SocketDatagram_t () |
| Destructor. More... | |
| vpr::ReturnStatus | recvfrom (void *msg, const vpr::Uint32 len, const int flags, vpr::InetAddr &from, vpr::Uint32 &bytes_read, const vpr::Interval timeout=vpr::Interval::NoTimeout) |
| Receives a message from some source. More... | |
| vpr::ReturnStatus | recvfrom (std::string &msg, const vpr::Uint32 len, const int flags, vpr::InetAddr &from, vpr::Uint32 &bytes_read, const vpr::Interval timeout=vpr::Interval::NoTimeout) |
| Receives a message from some source. More... | |
| vpr::ReturnStatus | recvfrom (std::vector< vpr::Uint8 > &msg, const vpr::Uint32 len, const int flags, vpr::InetAddr &from, vpr::Uint32 &bytes_read, const vpr::Interval timeout=vpr::Interval::NoTimeout) |
| Receives a message from some source. More... | |
| vpr::ReturnStatus | sendto (const void *msg, const vpr::Uint32 len, const int flags, const vpr::InetAddr &to, vpr::Uint32 &bytes_sent, const vpr::Interval timeout=vpr::Interval::NoTimeout) |
| Sends a message to the designated recipient. More... | |
| vpr::ReturnStatus | sendto (const std::string &msg, const vpr::Uint32 len, const int flags, const vpr::InetAddr &to, vpr::Uint32 &bytes_sent, const vpr::Interval timeout=vpr::Interval::NoTimeout) |
| Sends a message to the designated recipient. More... | |
| vpr::ReturnStatus | sendto (const std::vector< vpr::Uint8 > &msg, const vpr::Uint32 len, const int flags, const vpr::InetAddr &to, vpr::Uint32 &bytes_sent, const vpr::Interval timeout=vpr::Interval::NoTimeout) |
| Sends a message to the designated recipient. More... | |
Public Attributes | |
| boost::shared_ptr< SocketDatagramImpl > | mSocketDgramImpl |
| Platform-specific datagram socket implementation object. More... | |
Protected Methods | |
| virtual vpr::ReturnStatus | getOption (const vpr::SocketOptions::Types option, struct vpr::SocketOptions::Data &data) const |
| Retrieves the value for the given option as set on the socket. More... | |
| virtual vpr::ReturnStatus | setOption (const vpr::SocketOptions::Types option, const struct vpr::SocketOptions::Data &data) |
| Sets a value for the given option on the socket using the given data block. More... | |
Definition at line 61 of file SocketDatagram_t.h.
|
|||||
|
Reimplemented from vpr::Socket_t< SocketConfig_ >. Definition at line 65 of file SocketDatagram_t.h. Referenced by SocketDatagram_t. |
|
|||||
|
Definition at line 66 of file SocketDatagram_t.h. Referenced by SocketDatagram_t. |
|
|||||||||
|
Default constructor.
Definition at line 71 of file SocketDatagram_t.h. References mSocketDgramImpl, and SocketDatagramImpl. Referenced by SocketDatagram_t.
00071 : mSocketDgramImpl() 00072 { 00073 mSocketDgramImpl = boost::shared_ptr<SocketDatagramImpl>(new SocketDatagramImpl); 00074 Socket_t<SocketConfig_>::mSocketImpl = mSocketDgramImpl; 00075 } |
|
||||||||||||||||
|
Constructor. This takes a reference to a vpr::InetAddr object giving the local socket address and a reference to a vpr::InetAddr object giving the remote address.
Definition at line 87 of file SocketDatagram_t.h. References Config, mSocketDgramImpl, vpr::Socket_t< SocketConfig_ >::Socket_t, and SocketDatagramImpl.
00089 : Socket_t<Config>()
00090 {
00091 mSocketDgramImpl = boost::shared_ptr<SocketDatagramImpl>(new SocketDatagramImpl(local_addr, remote_addr));
00092 Socket_t<SocketConfig_>::mSocketImpl = mSocketDgramImpl;
00093 }
|
|
||||||||||
|
Copy constructor.
Definition at line 100 of file SocketDatagram_t.h. References mSocketDgramImpl, and SocketDatagram_t.
00101 : mSocketDgramImpl(sock.mSocketDgramImpl) 00102 { 00103 Socket_t<SocketConfig_>::mSocketImpl = mSocketDgramImpl; 00104 } |
|
|||||||||
|
Destructor. This currently does nothing.
Definition at line 112 of file SocketDatagram_t.h.
00113 {
00114 /* nothing */ ;
00115 }
|
|
||||||||||||||||||||||||||||||||
|
Receives a message from some source. The source's address is writen into the by-reference parameter from. Definition at line 121 of file SocketDatagram_t.h. References mSocketDgramImpl, and vpr::Interval::NoTimeout. Referenced by recvfrom.
00125 {
00126 return mSocketDgramImpl->recvfrom(msg, len, flags, from, bytes_read,
00127 timeout);
00128 }
|
|
||||||||||||||||||||||||||||||||
|
Receives a message from some source. The source's address is writen into the by-reference parameter from. Definition at line 134 of file SocketDatagram_t.h. References vpr::Interval::NoTimeout, and recvfrom.
00138 {
00139 msg.resize(len);
00140 memset(&msg[0], '\0', msg.size());
00141
00142 return recvfrom((void*) &msg[0], msg.size(), flags, from, bytes_read,
00143 timeout);
00144 }
|
|
||||||||||||||||||||||||||||||||
|
Receives a message from some source. The source's address is writen into the by-reference parameter from. Definition at line 150 of file SocketDatagram_t.h. References vpr::Interval::NoTimeout, recvfrom, and vpr::ReturnStatus::success.
00154 {
00155 vpr::ReturnStatus retval;
00156
00157 msg.resize(len);
00158
00159 memset(&msg[0], '\0', msg.size());
00160 retval = recvfrom((void*) &msg[0], msg.size(), flags, from, bytes_read,
00161 timeout);
00162
00163 // Size it down if needed, if (bytes_read==len), then resize does
00164 // nothing.
00165 if ( retval.success() )
00166 {
00167 msg.resize(bytes_read);
00168 }
00169
00170 return retval;
00171 }
|
|
||||||||||||||||||||||||||||||||
|
Sends a message to the designated recipient.
Definition at line 176 of file SocketDatagram_t.h. References mSocketDgramImpl, and vpr::Interval::NoTimeout. Referenced by sendto.
00180 {
00181 return mSocketDgramImpl->sendto(msg, len, flags, to, bytes_sent,
00182 timeout);
00183 }
|
|
||||||||||||||||||||||||||||||||
|
Sends a message to the designated recipient.
Definition at line 188 of file SocketDatagram_t.h. References vpr::Interval::NoTimeout, sendto, and vprASSERT.
|
|
||||||||||||||||||||||||||||||||
|
Sends a message to the designated recipient.
Definition at line 200 of file SocketDatagram_t.h. References vpr::Interval::NoTimeout, sendto, and vprASSERT.
|
|
||||||||||||||||
|
Retrieves the value for the given option as set on the socket.
Reimplemented from vpr::Socket_t< SocketConfig_ >. Definition at line 211 of file SocketDatagram_t.h. References mSocketDgramImpl.
00213 {
00214 return mSocketDgramImpl->getOption(option, data);
00215 }
|
|
||||||||||||||||
|
Sets a value for the given option on the socket using the given data block.
Reimplemented from vpr::Socket_t< SocketConfig_ >. Definition at line 217 of file SocketDatagram_t.h. References mSocketDgramImpl.
00219 {
00220 return mSocketDgramImpl->setOption(option, data);
00221 }
|
|
|||||
|
Platform-specific datagram socket implementation object.
Definition at line 229 of file SocketDatagram_t.h. Referenced by getOption, recvfrom, sendto, setOption, and SocketDatagram_t. |
1.2.14 written by Dimitri van Heesch,
© 1997-2002