Socket.Connect

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

This function connects the socket to the given server as a client.

Syntax

  1. bool Socket.Connect( string IP, int port )

Arguments

  • IP - This is the IP address of the remote host
  • port - This is the port of the remote host

Example

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

On script load this will connect a socket bot to local host via the 6667 port, the socket will run off the "Function" function.

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