[BACK]Return to serv1.c CVS log [TXT][DIR] Up to [local] / OpenXM / src / ox_math

Diff for /OpenXM/src/ox_math/serv1.c between version 1.21 and 1.23

version 1.21, 2003/02/12 08:28:41 version 1.23, 2005/07/26 12:52:04
Line 1 
Line 1 
 /* -*- mode: C; coding: euc-japan -*- */  /* -*- mode: C; coding: euc-japan -*- */
 /* $OpenXM: OpenXM/src/ox_math/serv1.c,v 1.20 2003/01/13 12:04:53 ohara Exp $ */  /* $OpenXM: OpenXM/src/ox_math/serv1.c,v 1.22 2003/02/13 01:29:38 ohara Exp $ */
   
 /*  /*
    Copyright (C) Katsuyoshi OHARA, 2000.     Copyright (C) Katsuyoshi OHARA, 2000.
Line 23  extern OXFILE *stack_oxfp;
Line 23  extern OXFILE *stack_oxfp;
 static int exchange_ox_sync_ball(OXFILE *oxfp)  static int exchange_ox_sync_ball(OXFILE *oxfp)
 {  {
     int tag;      int tag;
           ox_printf("exchanging OX_SYNC_BALL\n");
     send_ox_tag(oxfp, OX_SYNC_BALL);      send_ox_tag(oxfp, OX_SYNC_BALL);
     while((tag = receive_ox_tag(oxfp)) != OX_SYNC_BALL) {      while((tag = receive_ox_tag(oxfp)) != OX_SYNC_BALL) {
         if (tag == OX_DATA) {          if (tag == OX_DATA) {
Line 41  int shutdown()
Line 42  int shutdown()
 }  }
   
 /* (Heisei)15/02/01 */  /* (Heisei)15/02/01 */
 #define VERSION     0x15020100  #define VERSION  "2003/02/01"
 #define ID_STRING  "2003/02/01"  
   
 int main()  int main()
 {  {
Line 50  int main()
Line 50  int main()
   
     ox_stderr_init(stderr);      ox_stderr_init(stderr);
     ml_init();      ml_init();
     mathcap_init(VERSION, ID_STRING, "ox_math", NULL, NULL);      mathcap_init(VERSION, "ox_math");
   
     sv = oxf_open(3);      sv = oxf_open(3);
     oxf_determine_byteorder_server(sv);      oxf_determine_byteorder_server(sv);
Line 94  int sm(OXFILE *oxfp)
Line 94  int sm(OXFILE *oxfp)
     FD_ZERO(&fdmask);      FD_ZERO(&fdmask);
     FD_SET(oxf_fileno(oxfp), &fdmask);      FD_SET(oxf_fileno(oxfp), &fdmask);
   
     while(1) {      for (i=0; ; i++) {
           sm_sigunmask();
         ox_printf("phase%d: select\n",i);          ox_printf("phase%d: select\n",i);
         if (select(5, &fdmask, NULL, NULL, NULL) > 0) {          if (select(5, &fdmask, NULL, NULL, NULL) > 0) {
             sm_sigmask();              sm_sigmask();
             ox_printf("phase%d: receiving\n",i);              ox_printf("phase%d: receiving\n",i);
             sm_receive_ox();              sm_receive_ox();
             sm_sigunmask();  /* unmasked. */  
         }          }
           sm_sigmask();
         ox_printf("phase%d: clearing(%d)\n",i,sm_state_interrupting());          ox_printf("phase%d: clearing(%d)\n",i,sm_state_interrupting());
         if (sm_state_interrupting()) {          if (sm_state_interrupting()) {
             exchange_ox_sync_ball(stack_oxfp);              exchange_ox_sync_ball(stack_oxfp);
             sm_state_clear_interrupting();              sm_state_clear_interrupting();
         }          }
         i++;  
     }      }
     ox_printf("ox_math::socket(%d) is closed.\n", stack_oxfp->fd);      ox_printf("ox_math::socket(%d) is closed.\n", stack_oxfp->fd);
 }  }

Legend:
Removed from v.1.21  
changed lines
  Added in v.1.23

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>