MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-toolkit / connect

Method connect

samples/JGroups/src/RouterStub.java:137–149  ·  view source on GitHub ↗

Register this process with the router under group . @param group The name of the group under which to register

(String group, Address addr, String logical_name, List<PhysicalAddress> phys_addrs)

Source from the content-addressed store, hash-verified

135 * @param group The name of the group under which to register
136 */
137 public synchronized void connect(String group, Address addr, String logical_name, List<PhysicalAddress> phys_addrs) throws Exception {
138 doConnect();
139 GossipData request=new GossipData(GossipRouter.CONNECT, group, addr, logical_name, phys_addrs);
140 request.writeTo(output);
141 output.flush();
142 byte result = input.readByte();
143 if(result == GossipRouter.CONNECT_OK) {
144 connectionStateChanged(ConnectionStatus.CONNECTED);
145 } else {
146 connectionStateChanged(ConnectionStatus.DISCONNECTED);
147 throw new Exception("Connect failed received from GR " + getGossipRouterAddress());
148 }
149 }
150
151 public synchronized void doConnect() throws Exception {
152 if(!isConnected()) {

Callers 2

doConnectMethod · 0.45
runMethod · 0.45

Calls 5

doConnectMethod · 0.95
writeToMethod · 0.45
flushMethod · 0.45

Tested by

no test coverage detected