Source code: cxtable/core_comm/xConnectWorker.java
1 package cxtable.core_comm;
2
3 import cxtable.*;
4
5 /*
6 this class is threaded, and adds new xConnects to the xConnectPool..
7 which then notifies the xClientContinual of the new connect...launching
8 the actual connection attempt*/
9
10 public class xConnectWorker extends Thread{
11
12 private xConnectHook xchook;
13 private String[] u; private String n,r;
14 private xConnectPool xpool;
15 private String my_ip,my_port;
16
17 public xConnectWorker(String[] users, String nm, String ri, xConnectPool xcp,xConnectHook xc, String mi, String mp)
18 {
19 xchook=xc; u=users;n=nm;r=ri;xpool=xcp;my_ip=mi;my_port=mp;
20 }
21
22 public void run()
23 {
24 String report="";
25 for (int i=0; i<u.length;i++)
26 {
27 boolean b =xpool.add(u[i],n,r,xchook,my_ip,my_port);
28 report=report+"Added "+u[i]+":"+b+"\n";
29 }
30 System.out.println("xConnectWorker report:\n"+report);
31 }
32
33 /*done*/
34 }