Squirrel/Server/Functions/Sockets/Start

From Liberty Unleashed Wiki
Revision as of 03:45, 8 March 2010 by Force (Talk | contribs)

Jump to: navigation, search

This function starts listening incoming connections on the given port as a server socket.

Syntax

  1. bool Socket.Start( int port, int maxConnections )

Arguments

  • port - This is the port the socket will listen to
  • maxConnections - The maximum number of simultaneous connections to the socket

Example

  1.  
  2. function onScriptLoad( )
  3. {
  4. p_Socket <- NewSocket( "Function" );
  5. p_Socket.Start( 5192, 1 );
  6. }
  7.  

On script load this will tell a socket to listen for data on port 5192, with a max connection limit of 1.

Notes

The call onScriptLoad was used in in this example. The function NewSocket was also used. More info about these in the corresponding pages.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox