Help-Site Computer Manuals
  Algorithms & Data Structures   Programming Languages   Revision Control
  Cameras   Computers   Displays   Keyboards & Mice   Motherboards   Networking   Printers & Scanners   Storage
  Windows   Linux & Unix   Mac

Constants to L<Socket::Class|Socket::Class>

Socket::Class::Const - Constants to L<Socket::Class|Socket::Class>


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


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


Socket::Class::Const contains socket related constants which can be exported. For better performance constants are declared as scalar variables.


Address Family types

Internet v4 address family

Internet v6 address family

Bluetooth address family

Protocol Family types

Internet protocol family. Same as $AF_INET.

Internet v6 protocol family. Same as $AF_INET6.

Bluetooth protocol family. Same as $AF_BLUETOOTH.

Socket types

Connection oriented socket

Packet oriented socket

IP (v4/v6) Protocols

The ICMP protocol

TCP protocol. Use together with $SOCK_STREAM.

UDP protocol. Use together with $SOCK_DGRAM.

Bluetooth Protocols

Stream protocol. Use together with $SOCK_STREAM.

Datagram protocol. Use together with $SOCK_DGRAM.

Listen queue


Listen queue max size.

Send, Recv Flags

Sends OOB data (stream-style socket such as SOCK_STREAM only).

Peeks at the incoming data. The data is copied into the buffer, but is not removed from the input queue.

Specifies that the data should not be subject to routing.

Data completes record.

Return the real length of the packet, even when it was longer then the passed buffer. Only valid for packet sockets.

Return even if it would normally have blocked.

The receive request will complete only when one of the following events occurs:

  - The buffer supplied by the caller is completely full. 

  - The connection has been closed. 

  - The request has been canceled.

Socket Option Levels

Socket option level

TCP option level

UDP option level

Socket Options

Socket is listening.

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).

Get or set debugging mode.

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.

The default is zero (0). This option returns and resets the per socket–based error code.

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.

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.

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.

This option specifies the total per-socket buffer space reserved for receives.

Receives low watermark.

Receives time-out in milliseconds.

The default is FALSE. Allows the socket to be bound to an address that is already in use.

This option specifies the total per-socket buffer space reserved for sends.

Sends low watermark.

Sends time-out in milliseconds.

Get the type of the socket. (Readonly)

TCP Options

Disables the Nagle algorithm for send coalescing.

Shutdown values

Disable receiving on the socket.

Disable sending on the socket.

Disable both sending and receiving on the socket.

Socket States

Socket is created

Sock is bound

Socket is listening

Socket is connected

Socket is closed

Socket got an error on last send oder receive


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.