HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_Socket Class Reference

#include <UT_IPC.h>

+ Inheritance diagram for UT_Socket:

Public Types

enum  UT_SocketSex { UT_Unknown, UT_Client, UT_Server }
 
enum  UT_AddressFamily { UT_AfUnix = AF_UNIX, UT_AfInet = AF_INET }
 
enum  UT_SocketType {
  UT_Stream = SOCK_STREAM, UT_Datagram = SOCK_DGRAM, UT_Raw = SOCK_RAW, UT_RDM = SOCK_RDM,
  UT_SeqPacket = SOCK_SEQPACKET
}
 
enum  UT_MsgSendFlags { UT_MsgSendNoFlags = 0, UT_MsgSendDontRoute = MSG_DONTROUTE, UT_MsgSendOob = MSG_OOB, UT_MsgSendDontRouteOob = MSG_OOB|MSG_DONTROUTE }
 
enum  UT_MsgReceiveFlags { UT_MsgReceiveNoFlags = 0, UT_MsgReceivePeek = MSG_PEEK, UT_MsgReceiveOob = MSG_OOB, UT_MsgReceivePeekOob = MSG_OOB|MSG_PEEK }
 
enum  UT_FlagOption { UT_Off = 0, UT_On = 1 }
 
enum  UT_SocketLevelOption {
  UT_Broadcast = SO_BROADCAST, UT_Debug = SO_DEBUG, UT_DontRoute = SO_DONTROUTE, UT_KeepAlive = SO_KEEPALIVE,
  UT_OOBInline = SO_OOBINLINE, UT_ReuseAddr = SO_REUSEADDR, UT_UseLoopBack = SO_USELOOPBACK
}
 

Public Member Functions

 UT_Socket (UT_AddressFamily af, UT_SocketType st)
 
virtual ~UT_Socket ()
 
 UT_Socket (UT_AddressFamily af)
 
 UT_Socket (UT_SocketType st)
 
virtual int close ()
 
int listen (int)
 
int recv (char *, int, UT_MsgReceiveFlags=UT_MsgReceiveNoFlags)
 
int recvfrom (char *, int, struct sockaddr *, int &, UT_MsgReceiveFlags=UT_MsgReceiveNoFlags)
 
int send (const char *, int, UT_MsgSendFlags=UT_MsgSendNoFlags)
 
int sendto (const char *, int, const struct sockaddr *, int, UT_MsgSendFlags=UT_MsgSendNoFlags)
 
int recvmsg (struct msghdr *, UT_MsgReceiveFlags=UT_MsgReceiveNoFlags)
 
int sendmsg (struct msghdr *, UT_MsgSendFlags=UT_MsgSendNoFlags)
 
void linger ()
 
int setOption (UT_SocketLevelOption slo, UT_FlagOption fo)
 
int getOption (UT_SocketLevelOption slo, UT_FlagOption &fo)
 
UT_AddressFamily address_family ()
 
UT_SocketType socket_type ()
 
UT_SocketSex socket_sex ()
 
int socket_protocol ()
 
int isclient ()
 
int isserver ()
 
virtual int socket ()
 
- Public Member Functions inherited from UT_Transport
 UT_Transport ()
 
virtual ~UT_Transport ()
 
virtual int read (char *buffer, int len)
 
virtual int write (const char *buffer, int len)
 
virtual UT_IPCPacketgetPacket ()
 
virtual int readv (const IOVEC_PTR, int)
 
virtual int writev (const IOVEC_PTR, int)
 
virtual int ok ()
 
virtual int inuse ()
 
const char * getError () const
 
int getDescriptor () const
 

Protected Member Functions

virtual void shutdown (UT_ShutDownType)
 
int accept (struct sockaddr *sa, int &len)
 
int bind (const struct sockaddr *, int)
 
int connect (const struct sockaddr *, int)
 
int getpeername (struct sockaddr *, int &len)
 
int getsockname (struct sockaddr *, int &len)
 
int getsockopt (int, int, char *, int *)
 
int setsockopt (int, int, const char *, int)
 
int check_syscall (int state, const char *mess)
 
int syscall (int state, const char *mess)
 
- Protected Member Functions inherited from UT_Transport
void setError (const char *module, const char *func, const char *mess)
 
int readPartial (char *buffer, int len)
 
int writePartial (char *buffer, int len)
 

Protected Attributes

UT_SocketType type
 
UT_AddressFamily family
 
int protocol
 
UT_SocketSex sex
 
- Protected Attributes inherited from UT_Transport
int status
 
int td
 
char errorMsg [256]
 

Additional Inherited Members

- Static Public Member Functions inherited from UT_Transport
static void daemon_start (int ignore_sigcld)
 
- Public Attributes inherited from UT_Transport
int return_on_error
 
- Protected Types inherited from UT_Transport
enum  UT_ShutDownType { UT_ShutDownReceive = 0, UT_ShutDownSend = 1, UT_ShutDownBoth = 2 }
 

Detailed Description

Definition at line 171 of file UT_IPC.h.

Member Enumeration Documentation

Enumerator
UT_AfUnix 
UT_AfInet 

Definition at line 181 of file UT_IPC.h.

Enumerator
UT_Off 
UT_On 

Definition at line 206 of file UT_IPC.h.

Enumerator
UT_MsgReceiveNoFlags 
UT_MsgReceivePeek 
UT_MsgReceiveOob 
UT_MsgReceivePeekOob 

Definition at line 199 of file UT_IPC.h.

Enumerator
UT_MsgSendNoFlags 
UT_MsgSendDontRoute 
UT_MsgSendOob 
UT_MsgSendDontRouteOob 

Definition at line 193 of file UT_IPC.h.

Enumerator
UT_Broadcast 
UT_Debug 
UT_DontRoute 
UT_KeepAlive 
UT_OOBInline 
UT_ReuseAddr 
UT_UseLoopBack 

Definition at line 210 of file UT_IPC.h.

Enumerator
UT_Unknown 
UT_Client 
UT_Server 

Definition at line 176 of file UT_IPC.h.

Enumerator
UT_Stream 
UT_Datagram 
UT_Raw 
UT_RDM 
UT_SeqPacket 

Definition at line 185 of file UT_IPC.h.

Constructor & Destructor Documentation

UT_Socket::UT_Socket ( UT_AddressFamily  af,
UT_SocketType  st 
)
virtual UT_Socket::~UT_Socket ( )
virtual
UT_Socket::UT_Socket ( UT_AddressFamily  af)
UT_Socket::UT_Socket ( UT_SocketType  st)

Member Function Documentation

int UT_Socket::accept ( struct sockaddr *  sa,
int len 
)
protected
UT_AddressFamily UT_Socket::address_family ( )
inline

Definition at line 245 of file UT_IPC.h.

int UT_Socket::bind ( const struct sockaddr *  ,
int   
)
protected
int UT_Socket::check_syscall ( int  state,
const char *  mess 
)
protected
virtual int UT_Socket::close ( )
virtual

Reimplemented from UT_Transport.

Reimplemented in UT_UnixStream, and UT_UnixSocket.

int UT_Socket::connect ( const struct sockaddr *  ,
int   
)
protected
int UT_Socket::getOption ( UT_SocketLevelOption  slo,
UT_FlagOption fo 
)
int UT_Socket::getpeername ( struct sockaddr *  ,
int len 
)
protected
int UT_Socket::getsockname ( struct sockaddr *  ,
int len 
)
protected
int UT_Socket::getsockopt ( int  ,
int  ,
char *  ,
int  
)
protected
int UT_Socket::isclient ( )
inline

Definition at line 249 of file UT_IPC.h.

int UT_Socket::isserver ( )
inline

Definition at line 250 of file UT_IPC.h.

void UT_Socket::linger ( )
int UT_Socket::listen ( int  )
int UT_Socket::recv ( char *  ,
int  ,
UT_MsgReceiveFlags  = UT_MsgReceiveNoFlags 
)
int UT_Socket::recvfrom ( char *  ,
int  ,
struct sockaddr *  ,
int ,
UT_MsgReceiveFlags  = UT_MsgReceiveNoFlags 
)
int UT_Socket::recvmsg ( struct msghdr *  ,
UT_MsgReceiveFlags  = UT_MsgReceiveNoFlags 
)
int UT_Socket::send ( const char *  ,
int  ,
UT_MsgSendFlags  = UT_MsgSendNoFlags 
)
int UT_Socket::sendmsg ( struct msghdr *  ,
UT_MsgSendFlags  = UT_MsgSendNoFlags 
)
int UT_Socket::sendto ( const char *  ,
int  ,
const struct sockaddr *  ,
int  ,
UT_MsgSendFlags  = UT_MsgSendNoFlags 
)
int UT_Socket::setOption ( UT_SocketLevelOption  slo,
UT_FlagOption  fo 
)
int UT_Socket::setsockopt ( int  ,
int  ,
const char *  ,
int   
)
protected
virtual void UT_Socket::shutdown ( UT_ShutDownType  )
protectedvirtual

Implements UT_Transport.

virtual int UT_Socket::socket ( )
virtual

Reimplemented in UT_InetDatagram.

int UT_Socket::socket_protocol ( )
inline

Definition at line 248 of file UT_IPC.h.

UT_SocketSex UT_Socket::socket_sex ( )
inline

Definition at line 247 of file UT_IPC.h.

UT_SocketType UT_Socket::socket_type ( )
inline

Definition at line 246 of file UT_IPC.h.

int UT_Socket::syscall ( int  state,
const char *  mess 
)
protected

Member Data Documentation

UT_AddressFamily UT_Socket::family
protected

Definition at line 268 of file UT_IPC.h.

int UT_Socket::protocol
protected

Definition at line 269 of file UT_IPC.h.

UT_SocketSex UT_Socket::sex
protected

Definition at line 270 of file UT_IPC.h.

UT_SocketType UT_Socket::type
protected

Definition at line 267 of file UT_IPC.h.


The documentation for this class was generated from the following file: