Lines Matching refs:s

371 static void jdwp_control_event(int s, unsigned events, void* user);
376 int s; in jdwp_control_init() local
389 s = socket(AF_UNIX, SOCK_SEQPACKET | SOCK_CLOEXEC, 0); in jdwp_control_init()
390 if (s < 0) { in jdwp_control_init()
397 if (bind(s, reinterpret_cast<sockaddr*>(&addr), addrlen) < 0) { in jdwp_control_init()
399 adb_close(s); in jdwp_control_init()
403 if (listen(s, 4) < 0) { in jdwp_control_init()
405 adb_close(s); in jdwp_control_init()
409 control->listen_socket = s; in jdwp_control_init()
411 control->fde = fdevent_create(s, jdwp_control_event, control); in jdwp_control_init()
414 adb_close(s); in jdwp_control_init()
425 static void jdwp_control_event(int s, unsigned events, void* _control) { in jdwp_control_event() argument
429 int s = adb_socket_accept(control->listen_socket, nullptr, nullptr); in jdwp_control_event() local
430 if (s < 0) { in jdwp_control_event()
442 auto proc = std::make_unique<JdwpProcess>(s); in jdwp_control_event()
459 static void jdwp_socket_close(asocket* s) { in jdwp_socket_close() argument
460 D("LS(%d): closing jdwp socket", s->id); in jdwp_socket_close()
462 if (s->peer) { in jdwp_socket_close()
463 D("LS(%d) peer->close()ing peer->id=%d peer->fd=%d", s->id, s->peer->id, s->peer->fd); in jdwp_socket_close()
464 s->peer->peer = nullptr; in jdwp_socket_close()
465 s->peer->close(s->peer); in jdwp_socket_close()
466 s->peer = nullptr; in jdwp_socket_close()
469 remove_socket(s); in jdwp_socket_close()
470 free(s); in jdwp_socket_close()
473 static int jdwp_socket_enqueue(asocket* s, apacket* p) { in jdwp_socket_enqueue() argument
475 D("LS(%d): JDWP socket received data?", s->id); in jdwp_socket_enqueue()
477 s->peer->close(s->peer); in jdwp_socket_enqueue()
481 static void jdwp_socket_ready(asocket* s) { in jdwp_socket_ready() argument
482 JdwpSocket* jdwp = (JdwpSocket*)s; in jdwp_socket_ready()
490 p->len = jdwp_process_list((char*)p->data, s->get_max_payload()); in jdwp_socket_ready()
499 JdwpSocket* s = reinterpret_cast<JdwpSocket*>(calloc(sizeof(*s), 1)); in create_jdwp_service_socket() local
501 if (!s) { in create_jdwp_service_socket()
505 install_local_socket(s); in create_jdwp_service_socket()
507 s->ready = jdwp_socket_ready; in create_jdwp_service_socket()
508 s->enqueue = jdwp_socket_enqueue; in create_jdwp_service_socket()
509 s->close = jdwp_socket_close; in create_jdwp_service_socket()
510 s->pass = false; in create_jdwp_service_socket()
512 return s; in create_jdwp_service_socket()
542 static void jdwp_tracker_close(asocket* s) { in jdwp_tracker_close() argument
543 D("LS(%d): destroying jdwp tracker service", s->id); in jdwp_tracker_close()
545 if (s->peer) { in jdwp_tracker_close()
546 D("LS(%d) peer->close()ing peer->id=%d peer->fd=%d", s->id, s->peer->id, s->peer->fd); in jdwp_tracker_close()
547 s->peer->peer = nullptr; in jdwp_tracker_close()
548 s->peer->close(s->peer); in jdwp_tracker_close()
549 s->peer = nullptr; in jdwp_tracker_close()
552 remove_socket(s); in jdwp_tracker_close()
554 auto pred = [s](const auto& tracker) { return tracker.get() == s; }; in jdwp_tracker_close()
559 static void jdwp_tracker_ready(asocket* s) { in jdwp_tracker_ready() argument
560 JdwpTracker* t = (JdwpTracker*)s; in jdwp_tracker_ready()
565 p->len = jdwp_process_list_msg((char*)p->data, s->get_max_payload()); in jdwp_tracker_ready()
566 s->peer->enqueue(s->peer, p); in jdwp_tracker_ready()
570 static int jdwp_tracker_enqueue(asocket* s, apacket* p) { in jdwp_tracker_enqueue() argument
572 D("LS(%d): JDWP tracker received data?", s->id); in jdwp_tracker_enqueue()
574 s->peer->close(s->peer); in jdwp_tracker_enqueue()