Now that working transport is determined, associates it with the socket.
11931
function init(trans) {
            // Assign `trans` to `transport` which is associated with the
            // socket.
            transport = trans;
            // When the transport has received a message from the server.
            transport.on("text", function(text) {
                // Converts JSON text to an event object.
                // 
                // It should have the following properties:
                // * `id: string`: an event identifier.
                // * `type: string`: an event type.
                // * `data: any`: an event data.
                // * `reply: boolean`: true if this event requires the reply.
                var event = JSON.parse(text);
                // If the server sends a plain event, dispatch it.
                if (!event.reply) {
                    self.emit(event.type, event.data);
                } else {
                    var latch;
                    // A function to create a function.
                    function reply(success) {
                        // A controller function.
                        return function(value) {
                            // The latch prevents double reply.
                            if (!latch) {
                                latch = true;
                                self.send("reply", {id: event.id, data: value, exception: !success});
                            }
                        };
                    }
                    // Here, the controller is passed to the handler as 2nd
                    // argument and calls the server's `resolved` or `rejected`
                    // callback by sending `reply` event.
                    self.emit(event.type, event.data, {resolve: reply(true), reject: reply(false)});
                }
            });
            // When any error has occurred.
            transport.on("error", function(error) {
                self.emit("error", error);
            });
            // When the transport has been closed for any reason.
            transport.on("close", function() {
                self.emit("close");
            });
        }
487294
def connection_made(self, transport):
        
        self.transport = transport
        self.transport.write(self.method.message.encode())
        self.time_out_handle = self.loop.call_later(
            TIME_OUT_LIMIT, self.time_out)
992479
function consume(socket, data) {
  if (_.isUndefined(data.routingKey) || !_.isString(data.routingKey)) {
    // invalid consume message
    return;
  }

  // sanitize the routing key
  data.routingKey = sanitizeRoutingKey(data.routingKey);

  this.consumer.consume(socket, data);
}
1070596
def _transport_ready_handler(self, fd, cb_condition):
        
        if(self.user_cb):
            self.user_cb(self.user_arg)
        return True
624609
def make_connection(self, transport, address):
        """"""
        self.connected = True
        self.transport = transport
        self.connection_made(address)
897778
def connection_made(self, transport):
        """"""
        self._transport = transport
        self._raw_transport = transport
        if isinstance(transport, asyncio.SubprocessTransport):
            self._transport = transport.get_pipe_transport(0)
143106
def start_transport(self):
        """"""
        if self.transport:
            if self.transport.connect():
                self.log.debug("Service successfully connected to transport layer")
            else:
                raise RuntimeError("Service could not connect to transport layer")
            # direct all transport callbacks into the main queue
            self._transport_interceptor_counter = itertools.count()
            self.transport.subscription_callback_set_intercept(
                self._transport_interceptor
            )
        else:
            self.log.debug("No transport layer defined for service. Skipping.")
1095776
def connection_made(self, transport):
        

        # Save the underlying transport
        self._transport = transport

        # Call connection_made() on the client protocol, passing
        # ourself as the transport
        self._client.connection_made(self)
224085
def on_connect(self, connection):
        ""
        self._stream = connection._reader
        self._buffer = SocketBuffer(self._stream, self._read_size)
        if connection.decode_responses:
            self.encoding = connection.encoding
146151
def connect(self, interface, event, handler):
        """"""
        object_path = self.object_path
        return self.bus.connect(interface, event, object_path, handler)
419850
public synchronized void onTransportIdle() {
    if (keepAliveDuringTransportIdle) {
      return;
    }
    if (state == State.PING_SCHEDULED || state == State.PING_DELAYED) {
      state = State.IDLE;
    }
    if (state == State.PING_SENT) {
      state = State.IDLE_AND_PING_SENT;
    }
  }
883648
protected void addAlive(ProviderInfo providerInfo, ClientTransport transport) {
        if (checkState(providerInfo, transport)) {
            aliveConnections.put(providerInfo, transport);
        }
    }
988862
def connection_made(self, transport):
        """"""
        self.logger.info('Connection made at object %s', id(self))
        self.transport = transport
        self.keepalive = True

        if self._timeout:
            self.logger.debug('Registering timeout event')
            self._timout_handle = self._loop.call_later(
                self._timeout, self._handle_timeout)
1003191
function enableRerouting() {
  if (enabled)
    return;
  enabled = true;

  const connect = Net.Socket.prototype.connect;
  Net.Socket.prototype.connect = function(options, callback) {
    const hasNormalizedArgs = Object.getOwnPropertySymbols && Object.getOwnPropertySymbols(options).length > 0;
    const isNode8           = Array.isArray(options) && hasNormalizedArgs;
    if (isNode8) {
      const reroutedOptions = rerouteOptions(options[0]);
      callback              = options[1];
      return connect.call(this, reroutedOptions, callback);
    } else if (typeof options === 'object') {
      const reroutedOptions = rerouteOptions(options);
      return connect.call(this, reroutedOptions, callback);
    } else
      return connect.apply(this, arguments);
  };
}
211198
def connection_made(self, address):
        """"""
        logger.info("connection made to {}".format(address))
        self.count = 0
        self.connected = True
        self.transport.write(b'Echo Me')
118859
protected void aliveToSubHealth(ProviderInfo providerInfo, ClientTransport transport) {
        providerLock.lock();
        try {
            if (aliveConnections.remove(providerInfo) != null) {
                subHealthConnections.put(providerInfo, transport);
            }
        } finally {
            providerLock.unlock();
        }
    }
966900
def accept(self):
        """"""
        socket = Socket(self._llc, None)
        socket._tco = self.llc.accept(self._tco)
        return socket