HTTP Server on random available port in Go | Kazuki Higashiguchi | Conf42 Golang 2022
Imagine you want to start an HTTP server without specifying the port. For example, a temporary server for testing. How do you do that?
The answer is straightforward. Specify the port number to 0 like:
l, err := (““tcp““, ““:0““)
It’s an easy rule provided by the net package, but do you understand how Go binds a random port allocation.
I’ll give you a clear understanding of what Go does inside the net package.
The presentation contains the following topics.
- net, net/http packages
- File descriptor
- TCP, UDP
- System calls
I think this presentation will give audiences not only a knowledge of Go, but also one of system calls.
Other talks at this conference 🚀🪐
—
0:00 Intro
1:12 Talk
1 view
3199
1221
3 hours ago 00:00:00 6
Месяц платил скуфу за выдуманную работу [Моя ГРАНДИОЗНАЯ документалка]
2 days ago 00:22:07 1
КАК ПОТЕРЯТЬ ДРУГА ЗА 100 РУБЛЕЙ В GTA SAMP | STRAYF | Реакция
1 month ago 00:02:40 3
Street Fighter 6 - Elena Gameplay Trailer
1 month ago 00:10:24 0
Rust | Early Access | Gameplay, Part 7 - WHY SO SERIOUS?!
2 months ago 00:21:19 4
СКАЧАЛ 100 ВИРУСОВ И ПОТЕРЯЛ РУБЛЕЙ | STRAYF | Реакция
2 months ago 00:09:44 0
Rust | Early Access | Gameplay, Part 3 - HOME SWEET HOME!
2 months ago 00:25:31 0
Master Reboot, Gameplay Playthrough w/ Facecam Part 13 (Final: Both endings!) - LIVE OR DIE?!