Skip to content

mahadi117/Socket-programming-in-C

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hello-world

#Practising socket-programming in c language.

I worked a bit to learn to make sockets and how they work. Revising a bit after a long time.

Got help from this website.

http://www.cs.rpi.edu/~moorthy/Courses/os98/Pgms/socket.html

I think I should give some basic understanding of the socket programming about how it works

So a computer can communicate in networks using sockets. We can do socket programming in different programming languages.

Notable ones are Java, C, Python etc.

TCP/IP (Transmission Control Protocol/Internet Protocol) is the basic communication language or protocol of the Internet.Here the Server and Client need to have a connection established.

There are other forms of communicating where connection is not neccessary, notable one is UDP ( User Datagram Protocol).

So how does it work?

We create two entities ( I mean two program for Server and Client)!

Server:

Bind()
socket()
Listen()
Accept()
Read()
Write()
Close()

Client:

Socket() connect() write() read() close()

These are some of the important steps for the communication. We can compare the module with a telephone.

Server starts the phone and give it's number to the clients. Clients know the number ( portno, ip address) and then calls the server with a request, then the server accepts the request and then communication take place. Finally they close the socket. And the this is my friend is Socket Programming.

About

Practising socket-programming in C language again. Codes taken from online for learning purposes.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages