Perl socketpair Function

Advertisements


Description

This function creates an unnamed pair of connected sockets in the specified DOMAIN, of the specified TYPE, using PROTOCOL. If the system socketpair( ) function is not implemented, then it causes a fatal error.

Syntax

Following is the simple syntax for this function:

socketpair SOCKET1, SOCKET2, DOMAIN, TYPE, PROTOCOL

Return Value

This function returns 0 on failure ans 1 on success.

Example

Following is the example code showing its basic usage:


When above code is executed, it produced following result




Advertisements
Advertisements