AMX NETLINX PROGRAMMING LANGUAGE Manual page 211

Programming language
Table of Contents

Advertisement

DEFINE_START
(* Get My IP Address *)
GET_IP_ADDRESS(0:0:0,MyIPAddress)
(* Open The Server *)
IP_SERVER_OPEN(dvIPServer.Port,nIPPort,IP_TCP)
(* Open The Client *)
IP_CLIENT_OPEN(dvIPClient.Port,MyIPAddress.IPAddress,nIPPort,IP_TCP)
(***********************************************************)
(*
(***********************************************************)
DEFINE_EVENT
(* Server Data Handler *)
DATA_EVENT[dvIPServer]
{
}
(* Client Data Handler *)
DATA_EVENT[dvIPClient]
{
NetLinx Programming Language Reference Guide
THE EVENTS GO BELOW
ONERROR:
{
SEND_STRING 0,"'error: server=',ITOA(Data.Number)"
}
ONLINE:
{
SEND_STRING 0,"'online: server'"
}
OFFLINE:
{
SEND_STRING 0,"'offline: server'"
}
STRING:
{
SEND_STRING 0,"'string: client=',Data.Text"
IF (FIND_STRING(Data.Text,'ping',1))
SEND_STRING 0:2:0,"'pong',13"
}
ONERROR:
{
SEND_STRING 0,"'error: client=',ITOA(Data.Number)"
}
ONLINE:
{
SEND_STRING 0,"'online: client'"
}
OFFLINE:
IP Communication
*)
195

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Netlinx studio 2

Table of Contents