Version 1 of netcall

Updated 2007-11-14 17:59:52 by GPS

George Peter Staplin 2007 Nov, 14 - Netcall is a remote eval package. It's optimized for speed, and has more capabilities than comm. It's used in the Whim window manager.

It's BSD/Tcl licensed (the same license as Whim).

The sources are here: http://www.xmission.com/~georgeps/implementation/software/netcall/

Eventually netcall may be part of http://code.google.com/p/megapkg/

A simple example for a server:

 set dir [file dirname [info script]]
 source [file join $dir netcall.tcl]
 netcall.init
 netcall.serve 8888
 vwait forever

The clients can do:

 set dir [file dirname [info script]]
 source [file join $dir netcall.tcl]
 netcall.init
 netcall.connect localhost 8888
 puts "SERVER PID is:[netcall pid]"
 puts "SERVER COMMANDS are:[netcall info commands]"

Now there's also some more power available. You can wait for variables to change on the server side.

 set changedby [netcall.vwait ::someservervar ::anotherservervar]

By default netcall takes args as a parameter. If you already have a command that is a list you can use:

 set result [netcall.1 $somecommand]

If you are concerned about security you can change/override/replace this on the server:

 proc netcall.permit.access? { addr port } {
  if {"127.0.0.1" eq $addr} {
   return 1
  }

  if {![catch {package present Tk}]} {
   set answer [tk_messageBox -icon question -type yesno \
     -message "Do you want to allow $addr to connect to your netcall server?"]
   return [expr {"yes" eq $answer}]
  }
  return 0
 }

Category RPC