| 713 | using KernelSocketServer::KernelSocketServer; |
| 714 | |
| 715 | int bind(const EndPoint& ep) override { |
| 716 | if (m_listen_fd >= 0) |
| 717 | LOG_ERROR_RETURN(EALREADY, -1, "already bound"); |
| 718 | auto s = sockaddr_storage(ep); |
| 719 | m_listen_fd = fstack_socket(s.get_sockaddr()->sa_family, SOCK_STREAM, 0); // already non-blocking and no-delay |
| 720 | if (m_listen_fd < 0) { |
| 721 | LOG_ERRNO_RETURN(0, -1, "fail to setup DPDK listen fd"); |
| 722 | } |
| 723 | int ret = fstack_bind(m_listen_fd, s.get_sockaddr(), s.get_socklen()); |
| 724 | if (ret < 0) |
| 725 | LOG_ERRNO_RETURN(0, ret, "failed to bind to ", s.to_endpoint()); |
| 726 | return 0; |
| 727 | } |
| 728 | |
| 729 | int bind(const char* path, size_t count) override { |
| 730 | LOG_ERRNO_RETURN(ENOSYS, -1, "Not implemented"); |
nothing calls this directly
no test coverage detected