[BACK]Return to sio.c CVS log [TXT][DIR] Up to [local] / OpenXM_contrib2 / asir2000 / io

Diff for /OpenXM_contrib2/asir2000/io/sio.c between version 1.6 and 1.10

version 1.6, 2000/08/22 05:04:18 version 1.10, 2000/11/15 01:20:27
Line 44 
Line 44 
  * OF THE SOFTWARE HAS BEEN DEVELOPED BY A THIRD PARTY, THE THIRD PARTY   * OF THE SOFTWARE HAS BEEN DEVELOPED BY A THIRD PARTY, THE THIRD PARTY
  * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE,   * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE,
  * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE.   * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE.
  * $OpenXM: OpenXM_contrib2/asir2000/io/sio.c,v 1.5 2000/08/21 08:31:39 noro Exp $   * $OpenXM: OpenXM_contrib2/asir2000/io/sio.c,v 1.9 2000/11/07 06:35:39 noro Exp $
 */  */
 #if INET  #if INET
 #include "ca.h"  #include "ca.h"
 #include "setjmp.h"  #include "setjmp.h"
 #include "ox.h"  #include "ox.h"
 #if defined(VISUAL)  #if defined(VISUAL)
 #include <winsock.h>  #include <winsock2.h>
 #else  #else
 #include <sys/time.h>  #include <sys/time.h>
 #include <sys/uio.h>  #include <sys/uio.h>
Line 65 
Line 65 
   
 extern int little_endian;  extern int little_endian;
   
   int I_am_server;
 struct IOFP iofp[MAXIOFP];  struct IOFP iofp[MAXIOFP];
   
 #if !defined(_PA_RISC1_1)  #if !defined(_PA_RISC1_1)
Line 107  char *port_str;
Line 108  char *port_str;
         unsigned int port;          unsigned int port;
         static int count=0;          static int count=0;
   
   #if !defined(VISUAL)
         if ( use_unix ) {          if ( use_unix ) {
                 sprintf(port_str,"/tmp/ox%02x.XXXXXX",count);                  sprintf(port_str,"/tmp/ox%02x.XXXXXX",count);
                 count++;                  count++;
                 mktemp(port_str);                  mktemp(port_str);
         } else {          } else
   #endif
           {
                 port = ((unsigned int)mt_genrand()+(unsigned int)get_current_time())                  port = ((unsigned int)mt_genrand()+(unsigned int)get_current_time())
                         %(65536-1024)+1024;                          %(65536-1024)+1024;
                 sprintf(port_str,"%d",port);                  sprintf(port_str,"%d",port);
Line 282  char *host,*port_str;
Line 286  char *host,*port_str;
                 return s;                  return s;
 }  }
   
   #if 0
 close_allconnections()  close_allconnections()
 {  {
         int s;          int s;
Line 305  int s;
Line 310  int s;
                 free_iofp(s);                  free_iofp(s);
         }          }
 }  }
   #else
   close_allconnections()
   {
           shutdown_all();
   }
   #endif
   
 free_iofp(s)  free_iofp(s)
 int s;  int s;
Line 368  int is_server;
Line 379  int is_server;
         } else {          } else {
                 /* client : read -> write */                  /* client : read -> write */
                 read_char(iofp[i].in,&rc);                  read_char(iofp[i].in,&rc);
                   /* special care for a failure of spawing a server */
                   if ( rc !=0 && rc != 1 && rc != 0xff )
                           return -1;
                 write_char(iofp[i].out,&c); ox_flush_stream_force(i);                  write_char(iofp[i].out,&c); ox_flush_stream_force(i);
         }          }
         iofp[i].conv = c == rc ? 0 : 1;          iofp[i].conv = c == rc ? 0 : 1;
Line 413  int fd;
Line 427  int fd;
                         return i;                          return i;
         return -1;          return -1;
 }  }
   
 #endif /* INET */  #endif /* INET */
   

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.10

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