00001 ////////////////////////////////////////////////////////////////////////////////////////////////// 00002 /*! \file CommObject.cpp 00003 * \brief Implementation of the CommObject class. 00004 * \author $Author: simpliciter $ 00005 * \version $Revision: 1.1.1.1 $ 00006 * \date $Date: 2003/06/06 18:44:15 $ 00007 *////////////////////////////////////////////////////////////////////////////////////////////////// 00008 /*! 00009 */ 00010 ////////////////////////////////////////////////////////////////////////////////////////////////// 00011 00012 00013 #include "CommObject.h" 00014 00015 ////////////////////////////////////////////////////////////////////// 00016 // Construction/Destruction 00017 ////////////////////////////////////////////////////////////////////// 00018 00019 CommObject::CommObject(const Netxx::Stream& client) : m_Client(client.get_socketfd()), m_Clientsbuf(m_Client), m_Stream(&m_Clientsbuf) 00020 { 00021 00022 } 00023 00024 CommObject::~CommObject() 00025 { 00026 00027 } 00028 00029 void CommObject::SendMessage(const Message& _outgoingMessage) 00030 { 00031 string messagePacket = _outgoingMessage.Serialize() + '\n'; 00032 cout << "CommObject Sending: " << messagePacket << endl; 00033 cout << m_Client.write(messagePacket.c_str(), messagePacket.size()); 00034 00035 // if ( (byte_count = client.write(write_buffer.c_str(), write_buffer.size())) <= 0) 00036 // throw std::runtime_error("write: peer closed connection"); 00037 return; 00038 } 00039 00040 // Do not change the comments below - they will be added automatically by CVS 00041 /***************************************************************************** 00042 * $Log: CommObject.cpp,v $ 00043 * Revision 1.1.1.1 2003/06/06 18:44:15 simpliciter 00044 * Initial submission. 00045 * 00046 * 00047 ******************************************************************************/