diff options
author | William R. Otte <wotte@dre.vanderbilt.edu> | 2006-07-24 15:50:30 +0000 |
---|---|---|
committer | William R. Otte <wotte@dre.vanderbilt.edu> | 2006-07-24 15:50:30 +0000 |
commit | c44379cc7d9c7aa113989237ab0f56db12aa5219 (patch) | |
tree | 66a84b20d47f2269d8bdc6e0323f338763424d3a /ACE/protocols/ace/RMCast/Socket.h | |
parent | 3aff90f4a822fcf5d902bbfbcc9fa931d6191a8c (diff) | |
download | ATCD-c44379cc7d9c7aa113989237ab0f56db12aa5219.tar.gz |
Repo restructuring
Diffstat (limited to 'ACE/protocols/ace/RMCast/Socket.h')
-rw-r--r-- | ACE/protocols/ace/RMCast/Socket.h | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/ACE/protocols/ace/RMCast/Socket.h b/ACE/protocols/ace/RMCast/Socket.h new file mode 100644 index 00000000000..3468df15d4d --- /dev/null +++ b/ACE/protocols/ace/RMCast/Socket.h @@ -0,0 +1,99 @@ +// file : ace/RMCast/Socket.h +// author : Boris Kolpackov <boris@kolpackov.net> +// cvs-id : $Id$ + +#ifndef ACE_RMCAST_SOCKET_H +#define ACE_RMCAST_SOCKET_H + +#include "ace/config-lite.h" // ACE_HANDLE + +#include "ace/Auto_Ptr.h" +#include "ace/INET_Addr.h" +#include "ace/Time_Value.h" + +#include "RMCast_Export.h" +#include "Parameters.h" + + +namespace ACE_RMCast +{ + class Socket_Impl; + + class ACE_RMCast_Export Socket + { + public: + virtual + ~Socket (); + + // If 'simulator' is 'true' then internal message loss and + // reordering simulator (on IPv4 level) is turned on. + // + Socket (ACE_INET_Addr const& a, + bool loop = true, + Parameters const& params = Parameters ()); + + public: + virtual void + send (void const* buf, size_t s); + + + // Block if message is not available. Upon successful completion + // return the next message. Otherwise return -1 and errno set to + // indicate the error. ENOENT indicates that the sender does not + // retain the data for this message anymore. + // + virtual ssize_t + recv (void* buf, size_t s); + + virtual ssize_t + recv (void* buf, size_t s, ACE_INET_Addr& from); + + + // Block for up to <timeout> until message is available. Upon + // successful completion return the next message. Otherwise + // return -1 and errno set to indicate the error. ETIME indicates + // that the operation timed out. ENOENT indicates that the sender + // does not retain the data for this message anymore. + // + virtual ssize_t + recv (void* buf, size_t s, ACE_Time_Value const& timeout); + + virtual ssize_t + recv (void* buf, + size_t s, + ACE_Time_Value const& timeout, + ACE_INET_Addr& from); + + + // Block if message is not available. Upon successful completion + // return the size of the next message. Otherwise return -1 and + // errno set to indicate the error. ENOENT indicates that the + // sender does not retain the data for this message anymore. + // + virtual ssize_t + size (); + + + // Block for up to <timeout> until message is available. Upon + // successful completion return the size of the next message. + // Otherwise return -1 and errno set to indicate the error. + // ETIME indicates that the operation timed out. ENOENT indicates + // that the sender does not retain the data for this message anymore. + // + virtual ssize_t + size (ACE_Time_Value const& timeout); + + public: + // Reactor interface. Note that the handle returned by get_handle() + // is for signalling purposes only. + // + ACE_HANDLE + get_handle (); + + private: + ACE_Auto_Ptr<Socket_Impl> impl_; + }; +} + + +#endif // ACE_RMCAST_SOCKET_H |