Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

What is socket?  RSS feed

 
mahesh ogale
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I want to know what is exactly a socket?
Please don't tell that socket is communication end point.
According to my knowledge socket is abstraction on hardware implementation.
Is socket a file?
How 2 computers communicate through socket?
In short I would like to know what is socket at lowest level.

Thanks in advance,
Mahesh
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24215
37
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
There is no "lowest level" to sockets; they are a pure abstraction at a fairly high level. That is, they are defined by a set of functions and the expected behavior of those functions. The functions don't correspond to anything "real" underneath.
At a lowel level, those functions are implemented by calls to the operating system's TCP/IP implementation. TCP/IP is, in turn, an abstraction, albeit a more primitive one. TCP/IP itself is implemented via calls to a driver for a network card. The network card, in turn, sends electrical or optical signals across a wire or fiber.
Does this answer your question?
 
David Weitzman
Ranch Hand
Posts: 1365
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just to stress how abstract the internet is... TCP/IP is just TCP over IP, but you have a lot of freedom with IP beyond the typical network card setup.
If you prefer wetware to hardware, you can implement IP over carrier pigeons. There's no need for files, or even electricity at all!
 
Randall Twede
Ranch Hand
Posts: 4585
6
Java Python Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
lol david
by the way, very good explanation ernest
perhaps worth mentioning that sockets are not just an Internet thing. in Unix it can be a file system (LAN i guess) thing.
[ February 21, 2004: Message edited by: Randall Twede ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!