OpenSS7
SS7 for the
Common Man
© Copyright 1997-2007 OpenSS7 Corporation All Rights Reserved.
Last modified: Sat, 01 Nov 2008 10:42:37 GMT
Home TopIndex FirstPrev Next LastMore Download Info FAQ Mail  Home -> Documentation -> Man Pages -> Manpage of SOCKET
Quick Links

Download

SCTP

SIGTRAN

SS7

Hardware

STREAMS

Asterisk

Related

Package

Manual

FAQ

Man Pages

Applications

SS7 Stack

ISDN Stack

SIGTRAN Stack

VoIP Stack

MG Stack

SS7/ISDN Devices

IP Transport

Embedded Systems

OS

Documentation

FAQ

SIGTRAN

Design

Conformance

Performance

References

Man Pages

Manuals

Papers

Home

Overview

Status

Documentation

Resources

About

News

Manpage of SOCKET

Description: Manual Page

Keywords: ss7 ss7/ip ss7 over ip ss7 mtp ss7 sccp ss7 tcap sigtran mtp sccp tcap openss7 acb56 linux telephony pstn linux telephony linux nebs linux compactpci


SOCKET

Section: OpenSS7 STREAMS Sockets Library Calls (3)
Updated: 2008-10-31
Index Return to Main Contents

NAME

socket - create an endpoint for communication

SYNOPSIS

#include <sys/socket.h>

int socket(int domain, int type, int protocol);

ARGUMENTS


The function takes the following arguments:

domain
Specifies the communications domain in which a socket is to be created.
type
Specifies the type of socket to be created.
protocol
Specifies a particular protocol to be used with the socket. Specifying a protocol of 0 causes socket() to use an unspecified default protocol appropriate for the requested socket type.

DESCRIPTION

The socket() function creates an unbound socket in a communications domain, and returns a file descriptor that can be used in later function calls that operate on sockets.

The domain argument specifies the address family used in the communications domain. The address families supported by the system are implementation-dependent.

Symbolic constants that can be used for the domain argument are defined in the <sys/socket.h> header.

The type argument specifies the socket type, which determines the semantics of communication over the socket. The socket types supported by the system are implementation-dependent. Possible socket types include:

SOCK_STREAM
Provides sequenced, reliable, bidirectional, connection-mode byte streams, and may provide a transmission mechanism for out-of-band data.
SOCK_DGRAM
Provides datagrams, which are connectionless-mode, unreliable messages of fixed maximum length.
SOCK_SEQPACKET
Provides sequenced, reliable, bidirectional, connection-mode transmission path for records. A record can be sent using one or more output operations and received using one or more input operations, but a single operation never transfers part of more than one record. Record boundaries are visible to the receiver via the MSG_EOR flag.

If the protocol argument is non-zero, it must specify a protocol that is supported by the address family. The protocols supported by the system are implementation-dependent.

The process may need to have appropriate privileges to use the socket() function or to create some sockets.

NOTES

The documentation for specific address families specify which protocols each address family supports. The documentation for specific protocols specify which socket types each protocol supports.

The application can determine if an address family is supported by trying to create a socket with domain set to the protocol in question.

CAVEATS

This system call is implemented as a SIOCSOCKSYS IOCTL. See socksys(4) for more information.

RETURN VALUE

Upon successful completion, socket() returns a nonnegative integer, the socket file descriptor. Otherwise a value of -1 is returned and errno(3) is set to indicate the error.

ERRORS

The socket() function will fail if:

[EAFNOSUPPORT]
The implementation does not support the specified address family.
[EMFILE]
No more file descriptors are available for this process.
[ENFILE]
No more file descriptors are available for the system.
[EPROTONOSUPPORT]
The protocol is not supported by the address family, or the protocol is not supported by the implementation.
[EPROTOTYPE]
The socket type is not supported by the protocol.

The socket() function may fail if:

[EACCES]
The process does not have appropriate privileges.
[ENOBUFS]
Insufficient resources were available in the system to perform the operation.
[ENOMEM]
Insufficient memory was available to fulfill the request.
[ENOSR]
There were insufficient STREAMS(4) resources available for the operation to complete.

SEE ALSO

accept(3), bind(3), connect(3), getsockname(3), getsockopt(3), listen(3), recv(3), recvfrom(3), recvmsg(3), send(3), sendmsg(3), setsockopt(3), shutdown(3), socketpair(3), <netinet/in.h>, <sys/socket.h>.

COMPATIBILITY

This function and sockets implementation is compatible to SVR 4.2[1], and implementations based on SVR 4.2, including Solaris®[2], with the following portability considerations:

---
Where 4BSD differs from POSIX, this function follows POSIX[3].

See sockets(3) and socklib(3) for more compatibility information.

CONFORMING TO

The Open Group XNS Issue 5.2[4].

HISTORY

Most sockets functions first appeared in 4BSD.

REFERENCES

[1]
SVR 4.2, UNIX® System V Release 4.2 Programmer's Manual, 1992, (Englewood Cliffs, New Jersey), AT&T UNIX System Laboratories, Inc., Prentice Hall.
[2]
Solaris® 8, Solaris 8 Docmentation, 2001, (Santa Clara, California), Sun Microsystems, Inc., Sun. <http://docs.sun.com/>
[3]
SUS Version 3, Single UNIX Specification, OpenGroup, Open Group Publication. <http://www.opengroup.org/onlinepubs/>
[4]
XNS, Open Group CAE Specification: Technical Standard: Network Services (XNS), Issue 5.2, Draft 2, 1999, (Berkshire, UK), OpenGroup, Open Group Publication. [ISBN 1-85912-241-8] <http://www.opengroup.org/onlinepubs/>

TRADEMARKS

OpenSS7tm
is a trademark of OpenSS7 Corporation.
Linux®
is a registered trademark of Linus Torvalds.
UNIX®
is a registered trademark of The Open Group.
Solaris®
is a registered trademark of Sun Microsystems.

Other trademarks are the property of their respective owners.

IDENTIFICATION


OpenSS7 STREAMS Sockets: Package strsock version 0.9.2.4 released 2008-10-31.

Copyright©1997-2008OpenSS7 Corp. All Rights Reserved.
(See roff source for permission notice.)



Index

NAME
SYNOPSIS
ARGUMENTS
DESCRIPTION
NOTES
CAVEATS
RETURN VALUE
ERRORS
SEE ALSO
COMPATIBILITY
CONFORMING TO
HISTORY
REFERENCES
TRADEMARKS
IDENTIFICATION

This document was created by man2html, using the manual pages.
Time: 07:55:14 GMT, May 20, 2013
OpenSS7
SS7 for the
Common Man
Home TopIndex FirstPrev Next LastMore Download Info FAQ Mail  Home -> Documentation -> Man Pages -> Manpage of SOCKET
Last modified: Sat, 01 Nov 2008 10:42:37 GMT
© Copyright 1997-2007 OpenSS7 Corporation All Rights Reserved.