Inet Socket and Socket?
Asked Answered
B

5

5

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.

Bomke answered 21/2, 2010 at 9:35 Comment(0)
P
16

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.

Phrensy answered 2/8, 2010 at 12:44 Comment(0)
O
2

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

Orcutt answered 13/1, 2016 at 6:16 Comment(0)
S
1

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

var socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream,  ProtocolType.Tcp);
Shahjahanpur answered 4/3, 2013 at 7:6 Comment(0)
R
0

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.

Respirator answered 21/2, 2010 at 10:4 Comment(0)
T
0

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.

Transparency answered 30/5, 2014 at 20:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.