Socket Programming Tutorials In C For Beginners | Part 2 | Eduonix

Sockets are the basic building blocks in network communication. In this video, you will get details about HTTP Protocol in Socket programming.

To learn basics of Socket Programming visit:

Thank you for watching! We’d love to know your thoughts in the comments section below. Also, don’t forget to hit the ‘like’ button and ‘subscribe’ to ‘Eduonix Learning Solutions’ for regular updates.

Follow Eduonix on other social networks:
■ Facebook:
■ Linkedin:
■ Instagram: | @eduonix
■ Twitter:


Abhinav Mishra says:

This is an amazing series, thank you so much ! is there also an advanced course on socket programming ?

Sana Eram says:

thanks it was really useful

Fuangel Sikarin says:

Thank you alot your video very useful.

Chidananda Panigrahy says:

I am getting 503 service unavailable and some time 400 error. I used and
please let me know where i did mistake.

Drake Gao says:

my localhost:8080 keeps loading and data won’t show

Chidananda Panigrahy says:



int main(int argc,char *argv[])
if (1 > argc)
printf(“Enter atleast one arg in cmd linen”);
return 0;

char *address=argv[1];
int client_socket = socket(AF_INET,SOCK_STREAM,0);

if (client_socket < 0) { printf("unable to create socket %dn", stderr); return 0; } struct sockaddr_in remote_address; remote_address.sin_family = AF_INET; remote_address.sin_port = htons(80); inet_aton(address,&remote_address.sin_addr.s_addr); int con_ret = connect(client_socket,(struct sockaddr_in *)&remote_address,sizeof(remote_address)); if (0 == con_ret) { char request[]="GET /HTTP/1.1rnrn"; char response[4096]; send(client_socket,request,sizeof(request),0); recv(client_socket,&response,sizeof(response),0); printf("Response from the server: %sn",response); close(client_socket); } return 0; } If I run this code in ubuntu getting 503 error and sometime 400 error.please correct me where I did the mistake.

Ravish Kumar says:

what is bzero() function please explain with example.

Bakhyt Bakiyev says:

ExcelIent videos! I will wait your next videos about smtp server and client !

Greg Gorlen says:

The line inet_aton(address, &remote_address.sin_addr.s_addr); didn’t compile for me, but inet_aton(address, &remote_address.sin_addr);
worked (ref:
Thanks for the tutorials!

Umair Ali says:

what compiler you would recommend for windows user ? this for cuz i have visual stdio 2013 and dev c ++ while having a problem in code blocks , can you put a tutorial and give a link also plz thanks ?

ko5tas 55 says:

Not all heroes wear capes! Thank you keep going!!

Sloba Ivkovic says:

Excellent series, really enjoyed watching it, only 2 videos though, I see that there are not so much views on this video so I suspect that this series is not going to be extended which is really a shame, this is best socket C programming basics video I found so far and it would be nice to see what can be build on top of it. Thanks

Hamza bozbaş says:

great series, i think next thing that u should do is to make a series for web apis in c. that would be greaat. im looking forward for it. im unable to find any resource for that on internet

Fuangel Sikarin says:

1 question, I can get response 200ok when I run code in my home but when I go another place like university I always get 302 found . In same address (but local server it’s work every where)
thank you

Quaylyn Rimer says:

I got the same code you put I had to add #include for the close() to work after the tutorial on this video I was not able to pull it up in my browser any idea? I am running Ubuntu 17.04

Anupama Sodhi says:

Hey! When I try to open the page on the browser, it shows a blank page :3 help!

Ronny Landsverk says:

It seems many have problems with the http server when using a browser as a client.
I can “telnet” to the server, e.g. “telnet localhost 8001” and get response

HTTP/1.1 200 OK
welcome to HTTP server

but when i connect via a browser (localhost:8001) the browser is blank…
However, when replacing close() with pclose(), then the browser will display the html code.
Why ? BTW I use Cygwin64 and the compiler warned about close()…

anupam karn says:

how to print the whole entity body (i.e “last modified, date etc”) in server response?

will9020 says:

Awesome video! I’m working on the HTTP_Client project and when i run the code, i get a “segmentation fault” error… Any ideas? I’m running Ubuntu 18

CookieMonster666 says:

Really great and helpful series of tutorials. Thank you a lot for all the effort you’ve put in there.

 Write a comment


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

Please click below to support us on Facebook!