@Override public void send( int channel, Message message ) { if( log.isLoggable(Level.FINER) ) { log.log(Level.FINER, "send({0}, {1})", new Object[]{channel, message}); } if( channel >= 0 ) { // Make sure we aren't still connecting. Channels // won't be valid until we are fully connected since // we receive the channel list from the server. // The default channels don't require the connection // to be fully up before sending. waitForConnected(); } if( channel < CHANNEL_DEFAULT_RELIABLE || channel + CH_FIRST >= channels.size() ) { throw new IllegalArgumentException( "Channel is undefined:" + channel ); } send(channel + CH_FIRST, message, true); }
protected void configureChannels( long tempId, int[] ports ) { try { for( int i = 0; i < ports.length; i++ ) { Connector c = connectorFactory.createConnector( i, ports[i] ); ConnectorAdapter ca = new ConnectorAdapter(c, dispatcher, dispatcher, true); int ch = channels.size(); channels.add( ca ); // Need to send the connection its hook-up registration // and start it. ca.start(); ClientRegistrationMessage reg; reg = new ClientRegistrationMessage(); reg.setId(tempId); reg.setReliable(true); send( ch, reg, false ); } } catch( IOException e ) { throw new RuntimeException( "Error configuring channels", e ); } }
public void send( Message message ) { send( message, true ); }
@Override public void send( int channel, Message message ) { if( log.isLoggable(Level.FINER) ) { log.log(Level.FINER, "send({0}, {1})", new Object[]{channel, message}); } if( channel >= 0 ) { // Make sure we aren't still connecting. Channels // won't be valid until we are fully connected since // we receive the channel list from the server. // The default channels don't require the connection // to be fully up before sending. waitForConnected(); } if( channel < CHANNEL_DEFAULT_RELIABLE || channel + CH_FIRST >= channels.size() ) { throw new IllegalArgumentException( "Channel is undefined:" + channel ); } send(channel + CH_FIRST, message, true); }
protected void configureChannels( long tempId, int[] ports ) { try { for( int i = 0; i < ports.length; i++ ) { Connector c = connectorFactory.createConnector( i, ports[i] ); ConnectorAdapter ca = new ConnectorAdapter(c, dispatcher, dispatcher, true); int ch = channels.size(); channels.add( ca ); // Need to send the connection its hook-up registration // and start it. ca.start(); ClientRegistrationMessage reg; reg = new ClientRegistrationMessage(); reg.setId(tempId); reg.setReliable(true); send( ch, reg, false ); } } catch( IOException e ) { throw new RuntimeException( "Error configuring channels", e ); } }