/** * Returns an array of client connection ends suitable for use as guards in an <code>Alternative</code> * construct. * * @param c the connection array to get the client ends from. * @return the array of client ends. */ public static AltingConnectionClient[] getClientArray(One2OneConnection[] c) { AltingConnectionClient[] r = new AltingConnectionClient[c.Length]; for (int i = 0; i < c.Length; i++) { r[i] = c[i].client(); } return(r); }
/** * Initializes all the attributes to necessary values. * Channels are created using the static factory in the * <code>ChannelServer</code> interface. * * Constructor for One2OneConnectionImpl. */ public One2AnyConnectionImpl() : base() { chanToServer = StandardChannelFactory.getDefaultInstance().createOne2One(new CSPBuffer(1)); chanFromServer = StandardChannelFactory.getDefaultInstance().createOne2One(new CSPBuffer(1)); chanSynch = StandardChannelFactory.getDefaultInstance().createAny2One(new CSPBuffer(1)); //create the client and server objects altingClient = new AltingConnectionClientImpl(chanFromServer.In(), chanToServer.Out(), chanToServer.Out(), chanFromServer.Out()); }