Dialers

From OnixOS
Revision as of 09:56, 11 August 2024 by Tedaryum (talk | contribs) (Created page with "Dialer functions can automatically initiate a socket or provide sockete access and automatically communicate over a socket. dial_serve.ola (dial serve example): <code>sock socket "tcp4" "9050" "0.0.0.0"; def messages = { "ping”: "pong”, "call”: "Calling… NOPE! :)”, "help”: "Not helpfull!” } sock_listen(socket, messages)</code> The 9050 port is ready to connect. dial_client.ol (dial client example): <code>sock socket "tcp4" "9050...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Dialer functions can automatically initiate a socket or provide sockete access and automatically communicate over a socket.

dial_serve.ola (dial serve example):

sock socket "tcp4" "9050" "0.0.0.0"; 

def messages = { 
   "ping”: "pong”, 
   "call”: "Calling… NOPE! :)”, 
   "help”: "Not helpfull!” 
} 

sock_listen(socket, messages)

The 9050 port is ready to connect.

dial_client.ol (dial client example):

sock socket "tcp4" "9050" "0.0.0.0";
def send = fn(message){
  output(sock_send(socket, message))
} 
send("call")
send("help")

Output:

Calling... NOPE! :)
Not helpfull!