Quantcast
Channel: BinaryTides » C
Viewing all articles
Browse latest Browse all 10

Socket programming in C on Linux – tutorial

$
0
0
TCP/IP socket programming in C
This is a quick tutorial on socket programming in c language on a Linux system. "Linux" because the code snippets shown over here will work only on a Linux system and not on Windows. The is called winsock and we shall go through it in another tutorial.
Sockets are the "virtual" endpoints of any kind of network communications done between 2 hosts over in a network. For example when you type www.google.com in your web browser, it opens a socket and connects to google.com to fetch the page and show it to you. Same with any chat client like gtalk or skype. Any network communication goes through a socket.
The socket api on linux is similar to bsd/unix sockets from which it has evolved. Although over time the api has become slightly different at few places. And now the newer official standard is posix sockets api which is same as bsd sockets.
This tutorial assumes that you have basic knowledge of C and pointers. You will need to have gcc compiler installed on your Linux system. An IDE along with gcc would be great. I would recommend geany as you can quickly edit and run single file...

Read full post here
Socket programming in C on Linux – tutorial


Viewing all articles
Browse latest Browse all 10

Latest Images

Trending Articles



Latest Images