diff options
author | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1996-10-21 21:41:34 +0000 |
---|---|---|
committer | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1996-10-21 21:41:34 +0000 |
commit | a5fdebc5f6375078ec1763850a4ca23ec7fe6458 (patch) | |
tree | bcf0a25c3d45a209a6e3ac37b233a4812f29c732 /ace/LSOCK_Dgram.cpp | |
download | ATCD-a5fdebc5f6375078ec1763850a4ca23ec7fe6458.tar.gz |
Initial revision
Diffstat (limited to 'ace/LSOCK_Dgram.cpp')
-rw-r--r-- | ace/LSOCK_Dgram.cpp | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/ace/LSOCK_Dgram.cpp b/ace/LSOCK_Dgram.cpp new file mode 100644 index 00000000000..621cebbdaf5 --- /dev/null +++ b/ace/LSOCK_Dgram.cpp @@ -0,0 +1,60 @@ +// LSOCK_Dgram.cpp +// $Id$ + +/* Defines the member functions for the Local ACE_SOCK datagram + abstraction. */ + +#define ACE_BUILD_DLL +#include "ace/LSOCK_Dgram.h" +#include "ace/Log_Msg.h" + +#if !defined (ACE_LACKS_UNIX_DOMAIN_SOCKETS) + +ACE_ALLOC_HOOK_DEFINE(ACE_LSOCK_Dgram) + +void +ACE_LSOCK_Dgram::dump (void) const +{ + ACE_TRACE ("ACE_LSOCK_Dgram::dump"); + + ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); + ACE_SOCK_Dgram::dump (); + ACE_LSOCK::dump (); + ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); +} + +/* The "do nothing" constructor. */ + +ACE_LSOCK_Dgram::ACE_LSOCK_Dgram (void) +{ + ACE_TRACE ("ACE_LSOCK_Dgram::ACE_LSOCK_Dgram"); +} + +/* Here's the general-purpose open routine. */ + +int +ACE_LSOCK_Dgram::open (const ACE_Addr &local, + int protocol_family, + int protocol) +{ + ACE_TRACE ("ACE_LSOCK_Dgram::open"); + if (ACE_SOCK_Dgram::open (local, protocol_family, + protocol) == -1) + return -1; + ACE_LSOCK::set_handle (this->ACE_SOCK_Dgram::get_handle ()); + return 0; +} + +/* Create a local ACE_SOCK datagram. */ + +ACE_LSOCK_Dgram::ACE_LSOCK_Dgram (const ACE_Addr &local, + int protocol_family, + int protocol) +{ + ACE_TRACE ("ACE_LSOCK_Dgram::ACE_LSOCK_Dgram"); + if (this->open (local, protocol_family, + protocol) == -1) + ACE_ERROR ((LM_ERROR, "%p\n", "ACE_LSOCK_Dgram")); +} + +#endif /* ACE_LACKS_UNIX_DOMAIN_SOCKETS */ |