#include <IOStream_T.h>
Collaboration diagram for ACE_SOCK_Dgram_SC:

Public Methods | |
| 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 Attributes | |
| ACE_INET_Addr | peer_ |
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.
Definition at line 251 of file IOStream_T.h.
|
||||||||||
|
Definition at line 80 of file IOStream_T.i.
00081 {
00082 }
|
|
||||||||||||||||
|
Definition at line 85 of file IOStream_T.i.
00087 : STREAM (source), 00088 peer_ (dest) 00089 { 00090 } |
|
||||||||||
|
Definition at line 156 of file IOStream_T.i. References peer_.
00157 {
00158 addr = peer_;
00159 return 0;
00160 }
|
|
||||||||||||||||||||||||
|
Definition at line 108 of file IOStream_T.i. References ACE_BIT_ENABLED, ETIME, peer_, ACE_OS::select, ACE_Handle_Set::set_bit, and ssize_t.
00112 {
00113 if (tv != 0)
00114 {
00115 ACE_HANDLE handle = this->get_handle ();
00116 ACE_Handle_Set handle_set;
00117
00118 handle_set.set_bit (handle);
00119
00120 switch (ACE_OS::select (int (handle) + 1,
00121 (fd_set *) handle_set, // read_fds.
00122 (fd_set *) 0, // write_fds.
00123 (fd_set *) 0, // exception_fds.
00124 tv))
00125 {
00126 case 0:
00127 errno = ETIME;
00128 case -1:
00129 return -1;
00130 default:
00131 ; // Do the 'recv' below
00132 }
00133 }
00134
00135 int rval = STREAM::recv (buf, len, peer_, flags);
00136 #if defined (ACE_WIN32)
00137 if (rval == SOCKET_ERROR)
00138 if (::WSAGetLastError () == WSAEMSGSIZE)
00139 if (ACE_BIT_ENABLED (flags, MSG_PEEK))
00140 rval = len;
00141 #endif /* ACE_WIN32 */
00142 return rval < len ? rval : len;
00143 }
|
|
||||||||||||||||||||
|
Definition at line 100 of file IOStream_T.i. References ssize_t. Referenced by recv_n.
00103 {
00104 return recv (buf, len, 0, tv);
00105 }
|
|
||||||||||||||||||||||||
|
Definition at line 146 of file IOStream_T.i.
00150 {
00151 int rval = this->recv (buf, len, flags, tv);
00152 return rval;
00153 }
|
|
||||||||||||||||
|
Definition at line 93 of file IOStream_T.i. References peer_, and ssize_t.
00095 {
00096 return STREAM::send (buf, len, peer_);
00097 }
|
|
|||||
|
Definition at line 272 of file IOStream_T.h. Referenced by get_remote_addr, recv, and send_n. |
1.2.14 written by Dimitri van Heesch,
© 1997-2002