Source code for the File Push Client. This application requires spynergy.tcl.


############################
# PushClnt.tcl -- A simple file-push client daemon
#  by Mike Doyle
#
#  Copyright (c) 1997 Eolas Technologies Inc.
#  Freely modifiable/redistributable under the "Standard Tcl License"
#  See http://www.eolas.com/tcl/license.txt for details

# replace this with the url of your pushserv.tcl script
global url
set url "http://www.fios.com"

############################
# This procedure is invoked through RPC by the server
#  to initiate fetching of each file to be pushed
#
proc fetch_file {file_sent} {
global url
set cur_path [pwd]
	if {[catch "geturl $url$file_sent -outfile $cur_path$file_sent"]} {
		puts "$cur_path$file_sent: GETURL ERROR" } else {
		puts "$cur_path$file_sent: File fetched"
	}

}

##################################
# Start the RPC code, and set up a minimalistic GUI
# First load the Spynergy Toolkit
#
source spynergy.tcl

set Parent .pushclnt
frame $Parent
pack $Parent

set Name $Parent.gui
frame $Name
pack $Name

button $Name.button  -text "stop Push Client daemon" -command {dp_CloseRPC $server_port; after 1000 exit}
	
pack $Name.button

set server_port [dp_MakeRPCServer 7658]
dp_Host -
dp_Host +www.fios.com
puts "Push client port: $server_port"

#
# end of program
##################################