def _handle_bmp_session(self, socket):

        self._socket = socket
        # send init message
        init_info = {'type': bmp.BMP_INIT_TYPE_STRING,
                     'value': u'This is Ryu BGP BMP message'}
        init_msg = bmp.BMPInitiation([init_info])
        self._send(init_msg)

        # send peer-up message for each peers
        peer_manager = self._core_service.peer_manager

        for peer in (p for p in peer_manager.iterpeers if p.in_established()):
            msg = self._construct_peer_up_notification(peer)
            self._send(msg)

            for path in peer._adj_rib_in.values():
                msg = self._construct_route_monitoring(peer, path)
                self._send(msg)

        # TODO periodically send stats to bmpstation

        while True:
            # bmpstation shouldn't send any packet to bmpclient.
            # this recv() is only meant to detect socket closed
            ret = self._socket.recv(1)
            if len(ret) >= 0:
                LOG.debug('BMP socket is closed. retry connecting..')
                self._socket = None
                self._connect_retry_event.set()
                break

            # silently ignore packets from the bmpstation
dataset/ETHPy150Open osrg/ryu/ryu/services/protocols/bgp/bmp.py/BMPClient._handle_bmp_session/operator `==` -> `>=`