Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Contact Us
Online Help
Domain Status
Man Pages

Virtual Servers

Topology Map

Server Agreement
Year 2038

USA Flag



Man Pages

Manual Reference Pages  -  SOCKET::CLASS::CONST (3)

.ds Aq ’


Socket::Class::Const - Constants to Socket::Class



  use Socket::Class qw(...);


Socket::Class::Const contains socket related constants which can be exported. Constants can be also exported as scalar variables. The export tag :all exports all constants.


    Address Family types

<B>AF_INETB> Internet v4 address family
<B>AF_INET6B> Internet v6 address family
<B>AF_BLUETOOTHB> Bluetooth address family

    Protocol Family types

<B>PF_INETB> Internet protocol family. Same as AF_INET.
<B>PF_INET6B> Internet v6 protocol family. Same as AF_INET6.
<B>PF_BLUETOOTHB> Bluetooth protocol family. Same as AF_BLUETOOTH.

    Socket types

<B>SOCK_STREAMB> Connection oriented socket
<B>SOCK_DGRAMB> Packet oriented socket

    IP (v4/v6) Protocols

<B>IPPROTO_TCPB> TCP protocol. Use together with SOCK_STREAM.
<B>IPPROTO_UDPB> UDP protocol. Use together with SOCK_DGRAM.

    Bluetooth Protocols

<B>BTPROTO_RFCOMMB> Stream protocol. Use together with SOCK_STREAM.
<B>BTPROTO_L2CAPB> Datagram protocol. Use together with SOCK_DGRAM.

    Listen queue

Listen queue max size.

    Send, Recv Flags

<B>MSG_OOBB> Sends OOB data (stream-style socket such as SOCK_STREAM only).
<B>MSG_PEEKB> Peeks at the incoming data. The data is copied into the buffer, but is not removed from the input queue.
<B>MSG_DONTROUTEB> Specifies that the data should not be subject to routing.
<B>MSG_CTRUNCB> Data completes record.
<B>MSG_TRUNCB> Return the real length of the packet, even when it was longer then the passed buffer. Only valid for packet sockets.
<B>MSG_DONTWAITB> Return even if it would normally have blocked.
<B>MSG_WAITALLB> The receive request will complete only when one of the following events occurs:
o The buffer supplied by the caller is completely full.
o The connection has been closed.
o The request has been canceled.

    Socket Option Levels

<B>SOL_SOCKETB> Socket option level
<B>SOL_TCPB> TCP option level
<B>SOL_UDPB> UDP option level

    Socket Options

<B>SO_ACCEPTCONB> Socket is listening.
<B>SO_BROADCASTB> The default is FALSE. This option allows transmission of broadcast messages on the socket. Valid only for protocols that support broadcasting (IPX, UDP/IPv4, and others).
<B>SO_DEBUGB> Get or set debugging mode.
<B>SO_DONTROUTEB> The default is FALSE. This option indicates that routing is disabled, and outgoing data should be sent on whatever interface the socket and bound to. Valid for message oriented protocols only.
<B>SO_ERRORB> The default is zero (0). This option returns and resets the per socketXbased error code.
<B>SO_KEEPALIVEB> The default is FALSE. An application or the socket client can request that a TCP/IP service provider enable the use of keep-alive packets on TCP connections by turning on the SO_KEEPALIVE socket option.
<B>SO_LINGERB> The default is 1 (ON). This option controls the action taken when unsent data is queued on a socket and a close() or free() is performed.
<B>SO_OOBINLINEB> The default is FALSE. This option indicates OOB data should be returned in-line with regular data. Valid for connection oriented protocols which support out-of-band data.
<B>SO_RCVBUFB> This option specifies the total per-socket buffer space reserved for receives.
<B>SO_RCVLOWATB> Receives low watermark.
<B>SO_RCVTIMEOB> Receives time-out in milliseconds.
<B>SO_REUSEADDRB> The default is FALSE. Allows the socket to be bound to an address that is already in use.
<B>SO_SNDBUFB> This option specifies the total per-socket buffer space reserved for sends.
<B>SO_SNDLOWATB> Sends low watermark.
<B>SO_SNDTIMEOB> Sends time-out in milliseconds.
<B>SO_TYPEB> Get the type of the socket. (Readonly)

    TCP Options

<B>TCP_NODELAYB> Disables the Nagle algorithm for send coalescing.

    Shutdown values

<B>SD_RECEIVEB> Disable receiving on the socket.
<B>SD_SENDB> Disable sending on the socket.
<B>SD_BOTHB> Disable both sending and receiving on the socket.

    Socket States

<B>SC_STATE_INITB> Socket is created
<B>SC_STATE_BOUNDB> Sock is bound
<B>SC_STATE_LISTENB> Socket is listening
<B>SC_STATE_CONNECTEDB> Socket is connected
<B>SC_STATE_CLOSEDB> Socket is closed
<B>SC_STATE_ERRORB> Socket got an error on last send oder receive

Flags for getaddrinfo()

<B>AI_PASSIVEB> The socket address will be used in a call to the bind function.
<B>AI_CANONNAMEB> The canonical name is returned in the first canonname member.
<B>AI_NUMERICHOSTB> The node parameter passed to the getaddrinfo function must be a numeric string.
<B>AI_ADDRCONFIGB> <B>Windows only!B>

The getaddrinfo will resolve only if a global address is configured. The IPv6 and IPv4 loopback address is not considered a valid global address.

<B>AI_NUMERICSERVB> <B>Posix only!B>

Don’t use name resolution.

Flags for getnameinfo()

<B>NI_NUMERICHOSTB> If set, then the numeric form of the hostname is returned. (When not set, this will still happen in case the node’s name cannot be looked up.)
<B>NI_NUMERICSERVB> If set, then the service address is returned in numeric form, for example by its port number.
<B>NI_NOFQDNB> If set, return only the hostname part of the FQDN for local hosts.
<B>NI_NAMEREQDB> If set, then a error is returned if the hostname cannot be looked up.
<B>NI_DGRAMB> If set, then the service is datagram (UDP) based rather than stream (TCP) based. This is required for the few ports (512-514) that have different services for UDP and TCP.


Christian Mueller, <>


The Socket::Class::Const module is free software. You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file.


Hey! <B>The above document had some coding errors, which are explained below:B>
Around line 199: Non-ASCII character seen before =encoding in ’socketXbased’. Assuming ISO8859-1
Search for    or go to Top of page |  Section 3 |  Main Index

perl v5.20.3 CONST (3) 2012-01-20

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.