CPN
Computational Process Networks
Public Member Functions | Public Attributes | List of all members
SocketHandle::SendOpts Struct Reference

#include <SocketHandle.h>

+ Collaboration diagram for SocketHandle::SendOpts:

Public Member Functions

 SendOpts ()
 
 SendOpts (int f)
 
SendOptsBlock (bool block)
 
SendOptsNoSignal (bool sig)
 
SendOptsMore (bool more)
 

Public Attributes

int flags
 

Detailed Description

Convenience structure for Send so you can do things like Send(ptr, len, SendOpts().Block(false).NoSignal(true)); Send(ptr, len, SendOpts()) is exactly the same as Write(ptr, len)

Definition at line 91 of file SocketHandle.h.

Constructor & Destructor Documentation

SocketHandle::SendOpts::SendOpts ( )
inline

Definition at line 92 of file SocketHandle.h.

92 : flags(0) {}
SocketHandle::SendOpts::SendOpts ( int  f)
inline

Definition at line 93 of file SocketHandle.h.

93 : flags(f) {}

Member Function Documentation

SocketHandle::SendOpts & SocketHandle::SendOpts::Block ( bool  block)

Definition at line 158 of file SocketHandle.cc.

References flags.

158  {
159  if (block) { flags &= ~MSG_DONTWAIT; }
160  else { flags |= MSG_DONTWAIT; }
161  return *this;
162 }
SocketHandle::SendOpts & SocketHandle::SendOpts::More ( bool  more)

Definition at line 170 of file SocketHandle.cc.

170  {
171  if (more) { flags |= MSG_MORE; }
172  else { flags &= ~MSG_MORE; }
173  return *this;
174 }
SocketHandle::SendOpts & SocketHandle::SendOpts::NoSignal ( bool  sig)

Definition at line 164 of file SocketHandle.cc.

164  {
165  if (sig) { flags &= ~MSG_NOSIGNAL; }
166  else { flags |= MSG_NOSIGNAL; }
167  return *this;
168 }

Member Data Documentation

int SocketHandle::SendOpts::flags

Definition at line 99 of file SocketHandle.h.

Referenced by Block(), and SocketHandle::Send().


The documentation for this struct was generated from the following files: