Lines Matching refs:peer
50 ** these have no peer anymore, but still packets to
58 // If |peer_id| is not 0, also check that it is connected to a peer
69 if (peer_id == 0 || (s->peer && s->peer->id == peer_id)) {
118 if (s->transport == t || (s->peer && s->peer->transport == t)) {
215 if (s->peer) {
216 D("LS(%d): closing peer. peer->id=%d peer->fd=%d", s->id, s->peer->id, s->peer->fd);
218 * the peer, this ensures that remote sockets can still get the id
221 if (s->peer->shutdown) {
222 s->peer->shutdown(s->peer);
224 s->peer->peer = nullptr;
225 s->peer->close(s->peer);
226 s->peer = nullptr;
300 ** writable events again and tell our peer
304 s->peer->ready(s->peer);
335 if ((avail == max_payload) || (s->peer == 0)) {
340 // s->peer->enqueue() may call s->close() and free s,
344 r = s->peer->enqueue(s->peer, p);
345 D("LS(%u): fd=%d post peer->enqueue(). r=%d", saved_id, saved_fd, r);
453 D("entered remote_socket_enqueue RS(%d) WRITE fd=%d peer.fd=%d", s->id, s->fd, s->peer->fd);
455 p->msg.arg0 = s->peer->id;
463 D("entered remote_socket_ready RS(%d) OKAY fd=%d peer.fd=%d", s->id, s->fd, s->peer->fd);
466 p->msg.arg0 = s->peer->id;
472 D("entered remote_socket_shutdown RS(%d) CLOSE fd=%d peer->fd=%d", s->id, s->fd,
473 s->peer ? s->peer->fd : -1);
476 if (s->peer) {
477 p->msg.arg0 = s->peer->id;
484 if (s->peer) {
485 s->peer->peer = 0;
486 D("RS(%d) peer->close()ing peer->id=%d peer->fd=%d", s->id, s->peer->id, s->peer->fd);
487 s->peer->close(s->peer);
489 D("entered remote_socket_close RS(%d) CLOSE fd=%d peer->fd=%d", s->id, s->fd,
490 s->peer ? s->peer->fd : -1);
733 if (handle_host_request(service, type, serial, s->peer->fd, s) == 0) {
751 SendFail(s->peer->fd, "unknown host service");
756 ** so we make our peer back into a regular
762 SendOkay(s->peer->fd);
764 s->peer->ready = local_socket_ready;
765 s->peer->shutdown = nullptr;
766 s->peer->close = local_socket_close;
767 s->peer->peer = s2;
768 s2->peer = s->peer;
769 s->peer = 0;
782 SendFail(s->peer->fd, error_msg);
792 SendFail(s->peer->fd, "device offline (x)");
796 /* instrument our peer to pass the success or fail
801 s->peer->ready = local_socket_ready_notify;
802 s->peer->shutdown = nullptr;
803 s->peer->close = local_socket_close_notify;
804 s->peer->peer = 0;
806 s->peer->transport = s->transport;
808 connect_to_remote(s->peer, (char*)(p->data + 4));
809 s->peer = 0;
814 /* we're going to close our peer as a side-effect, so
831 if (s->peer) {
832 s->peer->peer = 0;
833 s->peer->close(s->peer);
834 s->peer = 0;
855 s->peer = ss;
856 ss->peer = s;
865 if (peer && peer->transport) {
866 max_payload = std::min(max_payload, peer->transport->get_max_payload());