Main Page   Packages   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

C:/temp/src/j2k/nto/bak2/Message.cpp

Go to the documentation of this file.
00001 #ifndef __J2K__Message_CPP__
00002 #define __J2K__Message_CPP__
00003 
00004 #include <j2k/Fred/Standard.hpp>
00005 #include <j2k/nto/Message.hpp>   
00006 
00007 Message::Message( int number0 = 0 )
00008 {
00009   memset( &msg, 0, sizeof( fred_msg_data_t ) );
00010   msg.number = number0;
00011 
00012 
00013 }
00014 
00015 Message::Message( const Message& src )
00016 {
00017   memcpy( &msg, &src.msg, sizeof( fred_msg_data_t ) );
00018 }
00019 
00020 const Message& Message::operator= ( const Message& src )
00021 {
00022   memcpy( &msg, &src.msg, sizeof( fred_msg_data_t ) );
00023 }
00024 
00025 Message::~Message()
00026 {
00027 }
00028 
00029 /*
00030 struct _pulse {
00031         _uint16                                         type;
00032         _uint16                                         subtype;
00033         _int8                                           code;
00034         _uint8                                          zero[3];
00035         union sigval                            value;
00036         _int32                                          scoid;
00037 };
00038 */
00039 
00040 int Message::handleHeader( int rcvid )
00041 {
00042   /* Pulse received */
00043   if ( rcvid == 0 )
00044   {
00045     switch ( (int)msg.hdr.code )
00046     {
00047       case _PULSE_CODE_DISCONNECT:
00048       /*
00049        * A client disconnected all its connections (called
00050        * name_close() for each name_open() of our name) or
00051        * terminated
00052        */
00053        ConnectDetach( msg.hdr.scoid );
00054        return 1;
00055        break;
00056 
00057       case _PULSE_CODE_UNBLOCK:
00058       /*
00059        * REPLY blocked client wants to unblock (was hit by
00060        * a signal or timed out).  It's up to you if you
00061        * reply now or later.
00062        */
00063        return 2;
00064        break;
00065 
00066       default:
00067       /*
00068        * A pulse sent by one of your processes or a
00069        * _PULSE_CODE_COIDDEATH or _PULSE_CODE_THREADDEATH 
00070        * from the kernel?
00071        */
00072        break;
00073     }
00074   }
00075   
00076   /* A QNX IO message received, reject */
00077   if ( type >= _IO_BASE  &&  type <= _IO_MAX ) 
00078   {
00079     MsgError( rcvid, ENOSYS );
00080     return -1;
00081   }
00082 
00083   return 0;
00084 }
00085 
00086 #endif // End of Meesage.cpp

Generated on Sun Oct 14 18:46:35 2001 for Standard J2K Library by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001