Matrix1 Utility Plug-ins

NEW ACCEPT SOCKET


Syntax

Handle = NEW ACCEPT SOCKET( PortNumber )
Handle = NEW ACCEPT SOCKET( IpAddress, PortNumber )
Handle = NEW ACCEPT SOCKET( IpAddress, PortNumber, Timeout )

Description

Creates a TCP socket, and then attempts to connects the socket handle to the remote connection. This command is basically a combination of the NEW TCP SOCKET(), LISTEN SOCKET(), BIND SOCKET and ACCEPT SOCKET() functions.

The PortNumber can be any number from 1 to 65535, although some of these ports may already be in use by other sockets and other processes.
The IpAddress is the numeric version of the IP Address of the network interface to listen on - if not provided, the command will listen on all interfaces.
The Timeout is specified in milliseconds - if not provided the function will return after 60 seconds if no connection has been made.

The value returned is the Handle of the new socket for communicating with, or 0 if no connection was accepted.

Go back to ...

Matrix1Util_28 Commands Menu
Matrix1 Utils Main Index
Matrix1 Utils Command List
Commands Menu
Main Menu

Copyright © Ian Mold - Matrix1 Software 2006 - 2011