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

fix: Adds back socket connected event #1688

Merged
merged 3 commits into from
Apr 6, 2024
Merged

Conversation

kamronbatman
Copy link
Contributor

@kamronbatman kamronbatman commented Feb 19, 2024

Summary

Adds back the SocketConnected event. This event only fires asynchronously! (TcpServer thread).

Example:

public static void Configure()
{
    TcpServer.EventSink.SocketConnected += OnSocketConnected;
}

// WARNING: Executed on the TcpServer thread!
private static void OnSocketConnected(TcpServer.SocketConnectedEventArgs args)
{
    if (... logic here...)
    {
        AdminFirewall.Add(((IPEndPoint)Socket.RemoteEndPoint)!.Address);
    }
}

@kamronbatman kamronbatman merged commit ac562e6 into main Apr 6, 2024
13 checks passed
@kamronbatman kamronbatman deleted the kbatman/tcp_eventsinks branch April 6, 2024 17:26
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

Successfully merging this pull request may close these issues.

None yet

1 participant