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

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

Go to the documentation of this file.
00001 #ifndef __J2K__BoardClient_CPP__
00002 #define __J2K__BoardClient_CPP__
00003 
00004 #include "BoardDef.hpp"
00005 
00006 /*** Client Side of the code ***/
00007 int client() {
00008     board_data_t msg, rmsg;
00009 
00010     register int fd = name_open( ATTACH_POINT, NAME_FLAG_ATTACH_GLOBAL );
00011     if ( fd == -1 )
00012     {
00013    printf( "Couldn't find the Board Server !\n" );
00014         return EXIT_FAILURE;
00015     }
00016 
00017     /* We would have pre-defined data to stuff here */
00018     msg.hdr.type    = 0x00;
00019     msg.hdr.subtype = 0x00;
00020     msg.serialMsgID = BOARD_SerialMsgID;
00021 
00022     /* Do whatever work you wanted with server connection */
00023     for (msg.data=0; msg.data < 5; msg.data++) 
00024     {
00025         memset(  msg.string, 0, 80 );
00026         memset( rmsg.string, 0, 80 );
00027         sprintf( msg.string, "Hi %d", msg.data );
00028 
00029         if ( MsgSend(fd, &msg, sizeof(msg), &rmsg, sizeof(rmsg) ) == -1) 
00030         {
00031             break;
00032         }
00033 
00034         /* Received a reply from server... */
00035     }
00036 
00037     /* Close the connection */
00038     name_close( fd );
00039     return EXIT_SUCCESS;
00040 }
00041 
00042 int main(int argc, char **argv) {
00043   return client();
00044 }
00045 
00046 #endif

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