M
M
McMike2018-06-25 13:15:44
Programming
McMike, 2018-06-25 13:15:44

What is "socket programming"?

Periodically I hear about sockets in this context. For example, a couple of times at the interview they asked if I did or would not like to do "socket programming"?
What? Well, I remember that a socket is a pair of ip-ports, are we talking about them? Still available for processors 1151, etc.
If we are talking about the ip-port, then what is meant by this phrase? Is it really some separate big discipline, to transfer data from one socket to another?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Anton Spirin, 2018-06-25
@rockon404

web sockets . As a web developer, you were most likely asked about them.

M
Mercury13, 2018-06-25
@Mercury13

A socket is an abstraction adopted by Unix and carried over to Windows, representing a network connection.
https://en.wikipedia.org/wiki/Berkeley_Sockets

A
anikavoi, 2018-06-26
@anikavoi

A socket is not a "pair of ip-ports", it's just "connection management", because several connections (servers, yeah!) can be connected to one port of one ip (servers, aha!)
Operations are performed on the socket. I/O, state changes, polling, etc.
When you create a socket, it doesn't have any ip and port yet. They will show up later (or not show up if it's a raw socket).
You can bind a port to the created socket - then connections to this port will change the state of the socket (in the case of tcp - in addition to bind, you also need to listen and accept).
If a socket is made connect, it will create a connection to the server.
In short - a socket is a control handle!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question