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

cleanup: clean up TCP calls and use netip #179

Merged
merged 4 commits into from
May 13, 2024
Merged

cleanup: clean up TCP calls and use netip #179

merged 4 commits into from
May 13, 2024

Conversation

fortuna
Copy link

@fortuna fortuna commented May 13, 2024

These are cursory cleanups while I'm figuring out the code for Websockets.

@fortuna fortuna requested a review from sbruens May 13, 2024 22:41
@fortuna fortuna requested a review from a team as a code owner May 13, 2024 22:41
@@ -33,4 +33,4 @@ jobs:
run: go build -v ./...

- name: Test
run: go test -v -race -benchmem -bench=. ./... -benchtime=100ms
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By removing -v, we only see the output for failures, which is more helpful

@@ -149,6 +149,7 @@ func BenchmarkCloseTCP(b *testing.B) {
duration := time.Minute
b.ResetTimer()
for i := 0; i < b.N; i++ {
ssMetrics.AddAuthenticatedTCPConnection(addr, accessKey)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this we get a ton of warnings.

@@ -107,7 +108,7 @@ func startUDPEchoServer(t testing.TB) (*net.UDPConn, *sync.WaitGroup) {
t.Logf("Failed to read from UDP conn: %v", err)
return
}
conn.WriteTo(buf[:n], clientAddr)
_, err = conn.WriteTo(buf[:n], clientAddr)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug fix

Copy link

@sbruens sbruens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice.

@fortuna fortuna merged commit c4d9214 into master May 13, 2024
4 checks passed
@fortuna fortuna deleted the fortuna-netip branch May 13, 2024 23:47
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.

2 participants