Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Os.Async: add enums for events from UDP and TCP sockets and change type of queues (RU) #22

Open
kachsheev opened this issue Nov 22, 2024 · 0 comments
Assignees

Comments

@kachsheev
Copy link
Member

kachsheev commented Nov 22, 2024

Добавить нумерованные списки для UDP и TCP сокетов, которые будут обозначать причину прихода событий.

Для UDP:

enum class UdpEvent
{ 
    READ // Posix: siginfo_t{}.si_code = POLL_IN, Windows: FD_READ event
    , WRITE // Posix: siginfo_t{}.si_code = POLL_OUT, Windows: FD_WRITE event
    , ERROR // Posix: siginfo_t{}.si_code = POLL_ERR
};

Для TCP:

enum class TcpEvent
{
    READ // Posix: siginfo_t{}.si_code = POLL_IN, Windows: FD_READ event
    , WRITE // Posix: siginfo_t{}.si_code = POLL_OUT, Windows: FD_WRITE event
    , ACCEPT // Posix: siginfo_t{}.si_code = POLL_IN + isListener, Windows: FD_ACCEPT event
    , CONNECT // Posix: siginfo_t{}.si_code = ?, Windows: FD_CONNECT(?) event
    , DISCONNECT // Posix: siginfo_t{}.si_code = POLL_HUP (?), Windows: FD_CLOSE event
    , ERROR // Posix: siginfo_t{}.si_code = POLL_ERR
}

И в очередях для сокетов поправить тип: сокет заменить на пару сокет+событие

Ссылки: Posix (si_code for a SIGIO/SIGPOLL signal), WinAPI (lEvent parameter description)

@kachsheev kachsheev self-assigned this Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant