How To Build A Custom TCP Server In Golang!?

preview_player
Показать описание

In this Golang tutorial, I will teach you how to build a custom TCP server that can read from and write to incoming connections by just using the standard library.

#golang
Рекомендации по теме
Комментарии
Автор

I got a lot of inspiration from looking at your code. thank you

야니스-lb
Автор

Thank you for creating the video man! Really enjoy your teaching style, +1 sub

joewilliams
Автор

Holy Shit...Just few days before your Subs. Were 2k now it's 3k .. Congratulations Anthony for This Badass videos🍻

anshkumargarhewal
Автор

Good example, but there is a major bug in the code: The "buf" slice is being reused, but the buf is not copied before it's sent to the channel (msgch). buf[n:] only creates a new slice pointing to the same address but with a different length.

TCP already comes with backpressure so I'm not sure how much use there is for the extra channel. But if you want to use a channel, allocate a new slice (buf) each iteration.

exiit
Автор

"I dont know how to close telnet"

It literally hints you how each you make a connection.

"Escape character is '^]'."

that is "control-]"

Then you will get a telnet> prompt ... type "quit"

justmeandmy
Автор

Hi, I want to thank you by providing this tutorial, It helps me a lot. May I confirm something? Is the reason you put goroutine of readloop() inside acceptloop() is for handling multiple message in the same connection?

So lets say you send a request to the server, but the server still can receive another request while processing the first request isn't it?

variel
Автор

Please make video about your programming environment setup.

eamarc
Автор

hey man, i loved the video, thanks a lot !

gabrielmengassodefranca
Автор

Thanks a lot! I like your style.
It would be interesting to watch about vim shortkeys that you use.

regionkaz
Автор

I didn't know GSP had a youtube channel about programming xD

pouris
Автор

love your content again, when will you bring some Rust stuff? Also when would you pick Rust over Go and vice versa?

lokthar
Автор

i have a question
at 07:15
as i understand, the for loop inside readLoop function will keep reading data from connection by using conn.Read
can we put read message process to goroutine?
what will be the different between using goroutine and not using goroutine at this situation?
thanks,

hienluongvi
Автор

Quick off-topic question. Is it a good to idea to use TCP for my backend app so I can build native desktop GUI and use it? GUI connects to my go backend app via localhost tcp. Anyway, great video, will use it for my pet-project as an example. Thanks!

wMwPlay
Автор

how about creating alternative open source for openssh

Kunal-k-u-m-a-r
Автор

I got my channel back Anthony! Let’s do one where you teach me go and I teach you functional js

agenticmark
Автор

Unable to accept your discord community invite

deepanshusharma
Автор

You didn't show how to use the quitch

dejanduh
Автор

why do you keep moving your pointer when you are writing? it is very distracting haha. Apart from that good video!

Scratchmex
Автор

Aggravating variable names
Ho wld it feel to hve wrds typ lik this

Sammysapphira
Автор

7:44 I'm getting a deadlock error!

goroutine 1 [chan receive]:

D:/projects/tcp/main.go:32 +0xc5
main.main()
D:/projects/tcp/main.go:67 +0x5c
exit status 2

Kisme-ef