Socket.h

Go to the documentation of this file.
00001 // file      : ace/RMCast/Socket.h
00002 // author    : Boris Kolpackov <boris@kolpackov.net>
00003 // cvs-id    : Socket.h,v 1.14 2005/09/04 20:40:20 boris Exp
00004 
00005 #ifndef ACE_RMCAST_SOCKET_H
00006 #define ACE_RMCAST_SOCKET_H
00007 
00008 #include "ace/config-lite.h" // ACE_HANDLE
00009 
00010 #include "ace/Auto_Ptr.h"
00011 #include "ace/INET_Addr.h"
00012 #include "ace/Time_Value.h"
00013 
00014 #include "RMCast_Export.h"
00015 #include "Parameters.h"
00016 
00017 
00018 namespace ACE_RMCast
00019 {
00020   class Socket_Impl;
00021 
00022   class ACE_RMCast_Export Socket
00023   {
00024   public:
00025     virtual
00026     ~Socket ();
00027 
00028     // If 'simulator' is 'true' then internal message loss and
00029     // reordering simulator (on IPv4 level) is turned on.
00030     //
00031     Socket (ACE_INET_Addr const& a,
00032             bool loop = true,
00033             Parameters const& params = Parameters ());
00034 
00035   public:
00036     virtual void
00037     send (void const* buf, size_t s);
00038 
00039 
00040     // Block if message is not available. Upon successful completion
00041     // return the next message. Otherwise return -1 and errno set to
00042     // indicate the error. ENOENT indicates that the sender does not
00043     // retain the data for this message anymore.
00044     //
00045     virtual ssize_t
00046     recv (void* buf, size_t s);
00047 
00048     virtual ssize_t
00049     recv (void* buf, size_t s, ACE_INET_Addr& from);
00050 
00051 
00052     // Block for up to <timeout> until message is available. Upon
00053     // successful completion return the next message. Otherwise
00054     // return -1 and errno set to indicate the error. ETIME indicates
00055     // that the operation timed out. ENOENT indicates that the sender
00056     // does not retain the data for this message anymore.
00057     //
00058     virtual ssize_t
00059     recv (void* buf, size_t s, ACE_Time_Value const& timeout);
00060 
00061     virtual ssize_t
00062     recv (void* buf,
00063           size_t s,
00064           ACE_Time_Value const& timeout,
00065           ACE_INET_Addr& from);
00066 
00067 
00068     // Block if message is not available. Upon successful completion
00069     // return the size of the next message. Otherwise return -1 and
00070     // errno set to indicate the error. ENOENT indicates that the
00071     // sender does not retain the data for this message anymore.
00072     //
00073     virtual ssize_t
00074     size ();
00075 
00076 
00077     // Block for up to <timeout> until message is available. Upon
00078     // successful completion return the size of the next message.
00079     // Otherwise return -1 and errno set to indicate the error.
00080     // ETIME indicates that the operation timed out. ENOENT indicates
00081     // that the sender does not retain the data for this message anymore.
00082     //
00083     virtual ssize_t
00084     size (ACE_Time_Value const& timeout);
00085 
00086   public:
00087     // Reactor interface. Note that the handle returned by get_handle()
00088     // is for signalling purposes only.
00089     //
00090     ACE_HANDLE
00091     get_handle ();
00092 
00093   private:
00094     ACE_Auto_Ptr<Socket_Impl> impl_;
00095   };
00096 }
00097 
00098 
00099 #endif  // ACE_RMCAST_SOCKET_H

Generated on Thu Nov 9 11:40:41 2006 for ACE_RMCast by doxygen 1.3.6