Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

MPNL::MSocket Class Reference

#include <MPNLBase.h>

Inheritance diagram for MPNL::MSocket:

MThread List of all members.

Public Member Functions

 MSocket (int type, MPNLBase *owner)
virtual ~MSocket ()
void operator() ()
bool IsInvalid ()
bool Read (std::string &msg)
bool Read (std::string &ip, std::string &msg)
virtual void Stop ()
int Send (const std::string &msg)
unsigned long SendStream ()
void SetStream (std::iostream *s)
int SendTo (const std::string &ip, int port, const std::string &msg)
MYSOCKET GetS () const
void SetS (MYSOCKET s)
bool Listen (int port)
bool HasMsg ()
std::string GetLocalIP ()

Public Attributes

void * Data
MMode Mode
int PrefixLen
sockaddr_in ServAddr
 for UDP Send and SendTo

std::string PeerIP
std::string LocalIP
 local IP (testing)

int PeerPort
std::iostream * Stream

Protected Types

typedef std::queue< std::string > MMsgQueue

Protected Member Functions

void PushMsg (const std::string &msg)
 void SetActive(bool a) {

void PushMsg (const std::string &ip, const std::string &msg)
int Send (const char *str, int len, int flags)

Protected Attributes

MYSOCKET S
int Type
MPNLBaseOwner
MMsgQueue Messages
MMsgQueue IP
TIME LastMsgTime
boost::mutex MsgMutex

Detailed Description

MSocket is our main threaded class that read and write to a socket
Author:
Mickael Faivre-Macon


Member Typedef Documentation

typedef std::queue<std::string> MPNL::MSocket::MMsgQueue [protected]
 


Constructor & Destructor Documentation

MPNL::MSocket::MSocket int  type,
MPNLBase owner
 

virtual MPNL::MSocket::~MSocket  )  [virtual]
 


Member Function Documentation

std::string MPNL::MSocket::GetLocalIP  ) 
 

MYSOCKET MPNL::MSocket::GetS  )  const [inline]
 

bool MPNL::MSocket::HasMsg  ) 
 

bool MPNL::MSocket::IsInvalid  ) 
 

bool MPNL::MSocket::Listen int  port  ) 
 

void MPNL::MSocket::operator()  )  [virtual]
 

Implements MThread.

void MPNL::MSocket::PushMsg const std::string &  ip,
const std::string &  msg
[protected]
 

void MPNL::MSocket::PushMsg const std::string &  msg  )  [protected]
 

void SetActive(bool a) {

bool MPNL::MSocket::Read std::string &  ip,
std::string &  msg
 

bool MPNL::MSocket::Read std::string &  msg  ) 
 

int MPNL::MSocket::Send const char *  str,
int  len,
int  flags
[protected]
 

int MPNL::MSocket::Send const std::string &  msg  ) 
 

unsigned long MPNL::MSocket::SendStream  ) 
 

int MPNL::MSocket::SendTo const std::string &  ip,
int  port,
const std::string &  msg
 

void MPNL::MSocket::SetS MYSOCKET  s  )  [inline]
 

void MPNL::MSocket::SetStream std::iostream *  s  )  [inline]
 

virtual void MPNL::MSocket::Stop  )  [virtual]
 

Reimplemented from MThread.


Member Data Documentation

void* MPNL::MSocket::Data
 

MMsgQueue MPNL::MSocket::IP [protected]
 

TIME MPNL::MSocket::LastMsgTime [protected]
 

std::string MPNL::MSocket::LocalIP
 

local IP (testing)

MMsgQueue MPNL::MSocket::Messages [protected]
 

MMode MPNL::MSocket::Mode
 

boost::mutex MPNL::MSocket::MsgMutex [protected]
 

MPNLBase* MPNL::MSocket::Owner [protected]
 

std::string MPNL::MSocket::PeerIP
 

int MPNL::MSocket::PeerPort
 

int MPNL::MSocket::PrefixLen
 

MYSOCKET MPNL::MSocket::S [protected]
 

struct sockaddr_in MPNL::MSocket::ServAddr
 

for UDP Send and SendTo

std::iostream* MPNL::MSocket::Stream
 

int MPNL::MSocket::Type [protected]
 


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


MDFS SourceForge project page and download

SourceForge.net Logo

Generated on Sat Jan 3 03:14:20 2004 for MDFS by doxygen1.3.5