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

Diff for /OpenXM_contrib2/asir2000/io/tcpf.c between version 1.55 and 1.57

version 1.55, 2004/06/15 09:04:41 version 1.57, 2010/04/23 04:44:52
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/tcpf.c,v 1.54 2004/03/11 07:40:42 noro Exp $   * $OpenXM: OpenXM_contrib2/asir2000/io/tcpf.c,v 1.56 2004/08/18 01:10:59 noro Exp $
 */  */
 #include "ca.h"  #include "ca.h"
 #include "parse.h"  #include "parse.h"
Line 566  void Pox_launch_generic(NODE arg,Q *rp)
Line 566  void Pox_launch_generic(NODE arg,Q *rp)
         *rp = ret;          *rp = ret;
 }  }
   
   #if 0
   void ox_launcher_101_generic(char *host,char *launcher,
                   int use_unix,int use_ssh,int use_x,int conn_to_serv,Q *rp)
   {
           int cs,cn,ind,id;
           char control_port_str[BUFSIZ];
           Obj obj;
   
   #if !defined(VISUAL)
           if ( use_unix && !find_executable("xterm") ) use_x = 0;
   #endif
           control_port_str[0] = 0;
           do {
                   generate_port(use_unix,control_port_str);
                   if ( conn_to_serv ) {
                           spawn_server_101(host,launcher,
                                   use_unix,use_ssh,use_x,conn_to_serv,
                                           control_port_str);
                           cs = try_connect(use_unix,host,control_port_str);
                   } else {
                           cs = try_bind_listen(use_unix,control_port_str);
                           if ( cs < 0 ) continue;
                           spawn_laucher_101(host,launcher,
                                   use_unix,use_ssh,use_x,conn_to_serv,
                                           control_port_str);
                           cs = try_accept(use_unix,cs);
                   }
           } while ( cs < 0 );
   
           /* client mode */
           cn = get_iofp(cs,control_port_str,0);
   
           /* register server to the server list */
           ind = register_server_101(use_unix,cn);
   
           STOQ(ind,*rp);
   }
   #endif
   
 void ox_launch_generic(char *host,char *launcher,char *server,  void ox_launch_generic(char *host,char *launcher,char *server,
                 int use_unix,int use_ssh,int use_x,int conn_to_serv,Q *rp)                  int use_unix,int use_ssh,int use_x,int conn_to_serv,Q *rp)
 {  {
Line 978  int get_mcindex(int i)
Line 1017  int get_mcindex(int i)
   
 void Pox_select(NODE arg,LIST *rp)  void Pox_select(NODE arg,LIST *rp)
 {  {
         int fd,n,i,index,mcind;          int fd,n,i,index,mcind,s;
         fd_set r,w,e;          fd_set r,w,e;
         NODE list,t,t1;          NODE list,t,t1,t0;
         Q q;          Q q;
         double max;          double max;
         struct timeval interval;          struct timeval interval;
Line 996  void Pox_select(NODE arg,LIST *rp)
Line 1035  void Pox_select(NODE arg,LIST *rp)
                 tvp = 0;                  tvp = 0;
   
         FD_ZERO(&r); FD_ZERO(&w); FD_ZERO(&e);          FD_ZERO(&r); FD_ZERO(&w); FD_ZERO(&e);
         for ( t = list; t; t = NEXT(t) ) {          for ( t = list, t0 = 0; t; t = NEXT(t) ) {
                 index = QTOS((Q)BDY(t));                  index = QTOS((Q)BDY(t));
                 valid_mctab_index(index);                  valid_mctab_index(index);
                 fd = get_fd(m_c_tab[index].c); FD_SET((unsigned int)fd,&r);                  s = m_c_tab[index].c;
                   if ( ox_data_is_available(s) ) {
                           MKNODE(t1,(Q)BDY(t),t0); t0 = t1;
                   } else {
                           fd = get_fd(s); FD_SET((unsigned int)fd,&r);
                   }
         }          }
           if ( t0 ) {
                   MKLIST(*rp,t0); return;
           }
   
         n = select(FD_SETSIZE,&r,&w,&e,tvp);          n = select(FD_SETSIZE,&r,&w,&e,tvp);
         for ( i = 0, t = 0; n && i < FD_SETSIZE; i++ )          for ( i = 0, t = 0; n && i < FD_SETSIZE; i++ )
                 if ( FD_ISSET(i,&r) ) {                  if ( FD_ISSET(i,&r) ) {
Line 1325  void Pox_cmo_rpc(NODE arg,Obj *rp)
Line 1373  void Pox_cmo_rpc(NODE arg,Obj *rp)
         STRING f;          STRING f;
         USINT ui;          USINT ui;
         NODE t;          NODE t;
           Obj dmy;
         pointer *w;          pointer *w;
         int index = QTOS((Q)ARG0(arg));          int index = QTOS((Q)ARG0(arg));
           int sync,find;
   
           find = get_opt("sync",&sync);
         valid_mctab_index(index);          valid_mctab_index(index);
         s = m_c_tab[index].c; arg = NEXT(arg);          s = m_c_tab[index].c; arg = NEXT(arg);
         f = (STRING)BDY(arg); arg = NEXT(arg);          f = (STRING)BDY(arg); arg = NEXT(arg);
Line 1340  void Pox_cmo_rpc(NODE arg,Obj *rp)
Line 1391  void Pox_cmo_rpc(NODE arg,Obj *rp)
         MKUSINT(ui,n);          MKUSINT(ui,n);
         ox_send_data(s,ui);          ox_send_data(s,ui);
         ox_send_data(s,f);          ox_send_data(s,f);
         ox_send_cmd(s,SM_executeFunction);          if ( find && sync ) {
                   ox_send_cmd(s,SM_executeFunctionSync);
                   ox_get_result(s,&dmy);
           } else
                   ox_send_cmd(s,SM_executeFunction);
         *rp = 0;          *rp = 0;
 }  }
   

Legend:
Removed from v.1.55  
changed lines
  Added in v.1.57

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