NAME

ACE_SOCK_Dgram_SC - "Dgram_SC" is short for "Datagram Self-Contained."

SYNOPSIS

#include <ace/IOStream_T.h>

template<class STREAM> class ACE_SOCK_Dgram_SC : public STREAM { public: ACE_SOCK_Dgram_SC (void); ACE_SOCK_Dgram_SC (STREAM &source, ACE_INET_Addr &dest); ssize_t send_n (char *buf, ssize_t len); ssize_t recv (char *buf, ssize_t len, ACE_Time_Value *tv = NULL); ssize_t recv ( char *buf, ssize_t len, int flags, ACE_Time_Value *tv = NULL ); ssize_t recv_n ( char *buf, ssize_t len, int flags = 0, ACE_Time_Value *tv = NULL ); int get_remote_addr (ACE_INET_Addr &addr) const; protected: ACE_INET_Addr peer_; };

DESCRIPTION

Datagrams don't have the notion of a "peer". Each send and receive on a datagram can go to a different peer if you want. If you're using datagrams for stream activity, you probably want 'em all to go to (and come from) the same place. That's what this class is for. Here, we keep an address object so that we can remember who last sent us data. When we write back, we're then able to write back to that same address.

PUBLIC MEMBERS

ACE_SOCK_Dgram_SC (void);

ACE_SOCK_Dgram_SC (STREAM &source, ACE_INET_Addr &dest);

ssize_t send_n (char *buf, ssize_t len);

ssize_t recv (char *buf, ssize_t len, ACE_Time_Value *tv = NULL);

ssize_t recv (
    char *buf,
    ssize_t len,
    int flags,
    ACE_Time_Value *tv = NULL
    );

ssize_t recv_n (
    char *buf,
    ssize_t len,
    int flags = 0,
    ACE_Time_Value *tv = NULL
    );

int get_remote_addr (ACE_INET_Addr &addr) const;

PROTECTED MEMBERS

ACE_INET_Addr peer_;

AUTHOR

James CE Johnson jcej@lads.com and Jim Crossley jim@lads.com

NOTE

This file should not be #included directly by application code. Instead, it should #include "ace/IOStream.h". That's because we only put some conditional compilations in that file.

LIBRARY

ace