Question

Can anybody tell me the difference between a INET Socket and any other socket?

Is there a C# library that will allow one to work with INET Sockets?

I've attempted to find what it is, but I haven't found anything very useful. I'm suspecting it's something from the UNIX world.

Was it helpful?

Solution

A socket is just an abstraction of a communication end point. Original communication between the entities may use different methods for communication. INET sockets in linux are Internet Sockets i.e IP protocol based sockets but there are many other types. One that I recently had to deal with are Netlink sockets which are used as IPC mechanism between a user process and linux kernel. As opposed to INET sockets which use IP addresses and ports, Netlink sockets use linux process IDs to identify communicating parties. On any standard Linux machine you can open file /usr/include/linux/socket.h and look for AF_MAX. Its a macro giving the number of protocol families supported by current socket api. On my machine its 37.

I dont know if there is any thing called INET socket in Windows API or not. Havent done much development for Windows.

OTHER TIPS

There are two widely used address domains, the unix domain, in which two processes which share a common file system communicate, and the Internet domain, in which two processes running on any two hosts on the Internet communicate. Each of these has its own address format.

The address of a socket in the Unix domain is a character string which is basically an entry in the file system.

The address of a socket in the Internet domain consists of the Internet address of the host machine (every computer on the Internet has a unique 32 bit address, often referred to as its IP address).

From:Linux Howtos

You specify the type of Socket when instantiating the Socket object:

var socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream,  ProtocolType.Tcp);

I don't know what an INET socket is (closest thing I could find was How can I map a local unix socket to an inet socket?), but the .NET Framework has support for sockets in the System.Net.Sockets namespace, specifically the Socket class.

As far as I understand, INET refers to InterNetwork which stands for "Address for IP version 4" as opposed to InterNetworkV6, which stands for "Address for IP version 6". It is similar to python where AF-INET is IPv4, and AF-INET6, which is IPv6.

I am relying on the MSDN AddressFamily Enumeration page and the Python sockets documentation.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top