Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

socket_to_name(3ncs) [ultrix man page]

socket_to_name(3ncs)													      socket_to_name(3ncs)

Name
       socket_to_name - convert a socket address to a name and port number

Syntax
       #include <idl/c/socket.h>

       void socket_$to_name(sockaddr, slength, name, nlength, port, status)
       socket_$addr_t *sockaddr;
       unsigned long slength;
       socket_$string_t name;
       unsigned long *nlength;
       unsigned long *port;
       status_$t *status;

Arguments
       sockaddr 	   A socket address.  The socket address is the structure returned by either or

       slength		   The length, in bytes, of sockaddr.

       name		   A  string in the format family:host[port], where family is the address family and host is the host name; host may be in
			   the standard numeric form (for example, #192.1.2.3) if a textual host name cannot be obtained.  Currently, only  ip	is
			   supported for family.

       nlength		   On input, the maximum length, in bytes, of the name to be returned.	On output, the actual length of the name returned.

       port		   The port number.

       status		   The	completion status. If the completion status returned in is equal to status_$ok , then the routine that supplied it
			   was successful.

Description
       The routine converts a socket address to a textual address family, host name, and port number.

Files
See Also
       intro(3ncs), socket_family_to_name(3ncs), socket_from_name(3ncs), socket_to_numeric_name(3ncs)

															      socket_to_name(3ncs)

Check Out this Related Man Page

socket_to_numeric_name(3ncs)											      socket_to_numeric_name(3ncs)

Name
       socket_to_numeric_name - convert a socket address to a numeric name and port number

Syntax
       #include <idl/c/socket.h>

       void socket_$to_numeric_name(sockaddr, slength, name, nlength, port,				   status

       socket_$addr_t *sockaddr;
       unsigned long slength;
       socket_$string_t name;
       unsigned long *nlength;
       unsigned long *port;
       status_$t *status;

Arguments
       sockaddr 	   A socket address.  The socket address is the structure returned by either or

       slength		   The length, in bytes, of sockaddr.

       name		   A  string in the format family:host[port], where family is the address family and host is the host name in the standard
			   numeric form (for example, #192.7.8.9 for an IP address).  Currently only ip is supported for family.

       nlength		   On input, the maximum length, in bytes, of the name to be returned.	(error if less than  size  of  "nnnnn.nnnn").	On
			   output, the actual length of the name returned.

       port		   The port number.

       status		   The	completion status. If the completion status returned in is equal to status_$ok , then the routine that supplied it
			   was successful.

Description
       The routine converts a socket address to a textual address family, a numeric host name, and a port number.

Files
See Also
       intro(3ncs), socket_family_to_name(3ncs), socket_from_name(3ncs), socket_to_name(3ncs)

														      socket_to_numeric_name(3ncs)
Man Page

5 More Discussions You Might Find Interesting

1. IP Networking

newbie terminology question...

is there a difference between a "port" and a "socket"? (2 Replies)
Discussion started by: trostycp
2 Replies

2. UNIX for Advanced & Expert Users

Unix port status

disregard solved (0 Replies)
Discussion started by: calamine
0 Replies

3. Programming

host name to IP address

There's a piece in a C program I'm writing (Linux) that simply needs to take a host name and return an IP address (e.g., take 'mail.gnu.org' and return 199.232.76.166). I've gotten a successful status from getaddrinfo, but don't see any of the fields in the result structure that has what I'm... (7 Replies)
Discussion started by: cleopard
7 Replies

4. Programming

open a socket

hi all, i meet a problem when opening a socket, is that when the remote host not available or its port hanged ,my program still suspending untill i cancel the operation... but when the host is ok ,my program work ok. i handled in my code all these exceptions ,but my problem is when the host is... (6 Replies)
Discussion started by: Ahmed waheed
6 Replies

5. UNIX for Dummies Questions & Answers

Can't figure out why this repeats

#!/bin/sh while IFS=: read address port; do : ${port:=443} address=$address port=$port cd $f_location number=`grep "$address" thing.txt -A 1 | grep "addresses=" | cut -d'"' -f2` echo "$address,$port,$number,$answer" >>... (9 Replies)
Discussion started by: shade917
9 Replies