UNIX Socket FAQ

A forum for questions and answers about network programming on Linux and all other Unix-like systems

You are not logged in.

  • Index
  • » C
  • » inet_addr() system call in Unix sockets.

#1 2007-10-13 12:16 AM

abhishek_2301
Member
Registered: 2007-10-11
Posts: 3

Re: inet_addr() system call in Unix sockets.

Hi,

We know that inet_addr()takes a dotted string format as input and returns a 32-bit network byte ordered binary values.
Now suppose I receive a 32-bit network byte ordered IP address from a host and I want to retrieve back the dotted quad string format of the IP address.
Which function will I have to use???

Thank You,

Offline

#2 2007-10-13 10:09 AM

i3839
Oddministrator
From: Amsterdam
Registered: 2003-06-07
Posts: 2,239

Re: inet_addr() system call in Unix sockets.

Use inet_aton() and inet_ntoa() instead.

"Unix sockets" are local sockets (AF_UNIX), so having that in your topic is confusing.

Offline

#3 2007-10-13 06:55 PM

RobSeace
Administrator
From: Boston, MA
Registered: 2002-06-12
Posts: 3,839
Website

Re: inet_addr() system call in Unix sockets.

Offline

#4 2007-10-13 11:04 PM

i3839
Oddministrator
From: Amsterdam
Registered: 2003-06-07
Posts: 2,239

Re: inet_addr() system call in Unix sockets.

Crap, worst post ever I suppose. :-(

Yeah, I meant to point to the inet_ntop version, but was in a hurry and messed it up.

Strange, I associate "unix socket" with unix domain sockets, but "unix sockets" with something else. As you pointed out, this forum is about unix sockets, so when someone says "unix socket" here on this forum, it's obviously unix sockets related, ergo, unix domain socket is probably meant. If not, confusion. ;-)

Offline

#5 2007-10-14 06:36 PM

RobSeace
Administrator
From: Boston, MA
Registered: 2002-06-12
Posts: 3,839
Website

Re: inet_addr() system call in Unix sockets.

Offline

  • Index
  • » C
  • » inet_addr() system call in Unix sockets.

Board footer

Powered by FluxBB