Socket.Start

From Liberty Unleashed Wiki
Jump to: navigation, search
Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

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