Lines Matching refs:peer
71 if (peer_id == 0 || (s->peer && s->peer->id == peer_id)) { in find_local_socket()
108 if (s->transport == t || (s->peer && s->peer->transport == t)) { in close_all_sockets()
182 if (avail != max_payload && s->peer) { in local_socket_flush_outgoing()
189 r = s->peer->enqueue(s->peer, std::move(data)); in local_socket_flush_outgoing()
316 if (s->peer) { in local_socket_close()
317 D("LS(%d): closing peer. peer->id=%d peer->fd=%d", s->id, s->peer->id, s->peer->fd); in local_socket_close()
322 if (s->peer->shutdown) { in local_socket_close()
323 s->peer->shutdown(s->peer); in local_socket_close()
325 s->peer->peer = nullptr; in local_socket_close()
326 s->peer->close(s->peer); in local_socket_close()
327 s->peer = nullptr; in local_socket_close()
367 s->peer->ready(s->peer); in local_socket_event_func()
431 D("entered remote_socket_enqueue RS(%d) WRITE fd=%d peer.fd=%d", s->id, s->fd, s->peer->fd); in remote_socket_enqueue()
435 p->msg.arg0 = s->peer->id; in remote_socket_enqueue()
451 D("entered remote_socket_ready RS(%d) OKAY fd=%d peer.fd=%d", s->id, s->fd, s->peer->fd); in remote_socket_ready()
454 p->msg.arg0 = s->peer->id; in remote_socket_ready()
461 s->peer ? s->peer->fd : -1); in remote_socket_shutdown()
464 if (s->peer) { in remote_socket_shutdown()
465 p->msg.arg0 = s->peer->id; in remote_socket_shutdown()
472 if (s->peer) { in remote_socket_close()
473 s->peer->peer = nullptr; in remote_socket_close()
474 D("RS(%d) peer->close()ing peer->id=%d peer->fd=%d", s->id, s->peer->id, s->peer->fd); in remote_socket_close()
475 s->peer->close(s->peer); in remote_socket_close()
478 s->peer ? s->peer->fd : -1); in remote_socket_close()
788 s->peer->fd, s); in smart_socket_enqueue()
812 SendFail(s->peer->fd, "unknown host service"); in smart_socket_enqueue()
823 SendOkay(s->peer->fd); in smart_socket_enqueue()
825 s->peer->ready = local_socket_ready; in smart_socket_enqueue()
826 s->peer->shutdown = nullptr; in smart_socket_enqueue()
827 s->peer->close = local_socket_close; in smart_socket_enqueue()
828 s->peer->peer = s2; in smart_socket_enqueue()
829 s2->peer = s->peer; in smart_socket_enqueue()
830 s->peer = nullptr; in smart_socket_enqueue()
840 SendFail(s->peer->fd, "device offline (no transport)"); in smart_socket_enqueue()
846 SendFail(s->peer->fd, "device offline (transport offline)"); in smart_socket_enqueue()
855 s->peer->ready = local_socket_ready_notify; in smart_socket_enqueue()
856 s->peer->shutdown = nullptr; in smart_socket_enqueue()
857 s->peer->close = local_socket_close_notify; in smart_socket_enqueue()
858 s->peer->peer = nullptr; in smart_socket_enqueue()
860 s->peer->transport = s->transport; in smart_socket_enqueue()
862 connect_to_remote(s->peer, std::string_view(s->smart_socket_data).substr(4)); in smart_socket_enqueue()
863 s->peer = nullptr; in smart_socket_enqueue()
882 if (s->peer) { in smart_socket_close()
883 s->peer->peer = nullptr; in smart_socket_close()
884 s->peer->close(s->peer); in smart_socket_close()
885 s->peer = nullptr; in smart_socket_close()
905 s->peer = ss; in connect_to_smartsocket()
906 ss->peer = s; in connect_to_smartsocket()
916 if (peer && peer->transport) { in get_max_payload()
917 max_payload = std::min(max_payload, peer->transport->get_max_payload()); in get_max_payload()