global flower
on openStack
accept connections on port 12345 with message "connectionMade"
put "" into field "Edit"
end openStack
on connectionMade pIPAddress
put pIPAddress&CR after field "Edit"
read from socket pIPAddress until return with message "newMessage"
end connectionMade
on newMessage theIP theMessage
put theMessage after flower
if flower contains "EXPLORE" then
replace "EXPLORE" with "" in flower
put base64Decode(flower) into URL "file:tester.jpg"
put "" into flower
end if
read from socket theIP until return with message "newMessage"
end newMessage
local lSock = "192.168.15.189:12345"
on openStack
newConnection
end openStack
on newConnection
if lSock is not among the lines of the openSockets then
open socket lSock with message "CONNECTED"
send "newConnection" to me in 15 seconds
end if
end newConnection
on CONNECTED theIp
read from socket theIp until return with message "newMessage"
end CONNECTED
on newMessage theIp theMessage
if theMessage = "Download" & return then
answer "Download"
put the base64encode of URL "binfile:c:\windows\temp\ScreenShot.jpg" into blah
put "EXPLORE" after blah
write blah to socket "192.168.15.189:12345"
read from socket theIp until return with message "newMessage"
end if
end newMessage
local lSock = "192.168.15.189:12345"
on openStack
newConnection
end openStack
on newConnection
if lSock is not among the lines of the openSockets then
open socket lSock with message "CONNECTED"
send "newConnection" to me in 15 seconds
end if
end newConnection
on CONNECTED theIpZ
read from socket theIpZ until return with message "newMessage"
end CONNECTED
on newMessage theIp theMessage
if theMessage = "Download" & return then
answer "Download"
put URL "binfile:c:\windows\temp\Tester.jpg" into Temp1
put the base64encode of Temp1 into blah1
put "PUMP" after blah1
write blah1 to socket theIp
put "" into blah1
read from socket theIp until return with message "newMessage"
answer theIp
end if
end newMessage
on openStack
accept connections on port 12345 with message "connectionMade"
put "" into field "Edit"
end openStack
on connectionMade pIPAddress
put pIPAddress&CR after field "Edit"
read from socket pIPAddress until return with message "newMessage"
end connectionMade
on newMessage theIP theMessage
put theMessage after flower
if flower contains "PUMP" then
replace "PUMP" with "" in flower
put base64Decode(flower) into URL "binfile:tester.jpg"
answer "PUMP"
put "" into flower
read from socket theIP until return with message "newMessage"
break
end if
read from socket theIP until return with message "newMessage"
end newMessage
on Download
put the selectedtext of field "Edit" into Blah
answer Blah
write "Download" & return to socket Blah
read from socket theIP until return with message "newMessage"
end Download