C Programming in Linux Tutorial #034 – Socket Programming

C Programming in Linux Tutorial using GCC compiler. Tutorial should also be applicable in C/UNIX programming. This video shows how to use the BSD Socket in C/Linux. You should be proficient in C in order to understand how to use the libraries for TCP/IP socket programming under the Linux environment. Also, it is one of the inter-process communication, or IPC.


Felipe Lima says:

Thanks for showing us this tutorial. Really appreciate it!

Devinder Kaur says:

Dat was wonderfull! Its workign on my machine ubuntu 12.04. Now, I want to store the information regarding different machines like amount of hard disk memory available for further use etc. Any directions would be really appreciated.

fahad alhagbani says:

You just saved the codes and say it. NO EXPLAINING AT ALL. This is the worst this to post for people who want to learn coding.

Rami Singh says:


10 1001 1010 says:

you could simply use tmux instead of having 4 windows

ghee4345 says:

how you send an http get request from client to server?

kovinster says:

of course that doesn’t look like it’s a ‘Linux’ tutorial.

Dan Man says:

Why are you using Windows for a Linux tutorial?

gromstoso says:

Thanks man, big time!

Dule Dusko says:

How to setup this program to work on distant pc?

whitecrane18 says:

I am newbie in c programming in linux but the client/server example looks like POSIX message queues. Isn’t it?

Daniel Gadd says:

rvl = 0 ? always ?
Copied word for word

campocalypse says:

I was given a socket programming assignment in my Computer Networks class where the instructor refused to teach us any socket programming background because we should have learned it in a previous course (despite how no one in the class actually had.) Thank you so much for this tutorial. Worked like a charm after you worked out the bugs, and gave a great introduction to basic socket programming.

tiare Eudora says:

Thanks for making this video. It is very helpful !!!

Houcem Eddine Saad says:

any thing about extern functions and appel_extern()???

unh0ly s0da says:

this VIM use hurts my eyes, but regardless of that, Great video thanks for ssharing

zeo_101 says:

Thanks man <3 , you helped alot

Vikash Rajak says:

What is the compiler name???

#PL says:

hello. I want to know how do you install c library. I want to you record the video about c library.because I can’t compile the file c

Aldanis Vigo says:

Thank you for this tutorial it was easy to follow and I got it to work without any problems.

Shreyus Yadaveerappa Kouty says:

Explanation was good, I understood it clearly. Thanks ShellWaveX

Joseph Isaac says:

Awesome. Can’t thank you enough.

sunil reddy says:

rip my ears. bye

Norbert Karman says:

Transport endpoint is not connected. Please help me!!!

Игорь Рясный says:

four cmd’s window like a terminator in Linux =D

Jason Williams says:

give me code!

IronHeart004 says:

hi @shellWaveX : how can i stop client from closing the socket ?

Sindhu Raghavi says:

I got error “connection refused” even after correcting the last htons error  🙁

Abhishek kumar srivastava says:

awesome work and explanation .. hats off plz keep it up ..

Hyunseok Jeong says:

Hi, thanks for good lesson again.
But, this time i followed your code, and I got the error.
“Network is unreachable”

so I checked, I think the problem is below.
we should init “struct sockaddr_in server” just in case.
so I initiated it with “memset(&server, 0, sizeof(server));”

have a good DAY. 🙂

Manh Truongtien says:

I want to build a chesse game using C Network Programing in Linux, can you give me a guess, a guide video you made or a link video. Thankyou so much !

THE FOX says:

man why didn’t you post SC over the Git or such i am so sick of listening your voice

Jorge David Rocha says:

this guy really did this tutorial for nothing. How easy is to recite what youre tiping? He doesnt explain anything, more, he doesnt seems to know much about what he is doing.

 Write a comment


Do you like our videos?
Do you want to see more like that?

Please click below to support us on Facebook!