View this PageEdit this PageAttachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide
Hotspots: Admin Pages | Turn-in Site |
Current Links: Case Final Project Summer 2007

Tips and Tricks


Interesting Property about OpenTalk

One interesting property of OpenTalk that I discovered while using it was that it would maintain a link back from a remote Object to the original Object. I'm not sure if it was possible to disable it through some option in OpenTalk, but any changes made to the remote Object would propergate back to the original Object also.


Sending Files using OpenTalk

Sending a file using OpenTalk is like sending any object using OpenTalk. There are 3 steps involded.

Step 1: Reading the file to an object
method: sendFile: fileName
\ aStream aFile \
aStream := (fileName) readStream.
aStream binary.
[aFile := aStream contents.] ensure: [aStream close].

Step 2: Sending the file
broker sendMessage: (Message selector: #reciveFile:name: arguments: aFile, fileName) to: reciver.

Step 3: Writing out to the harddrive
method: reciveFile: aFile name: fileName
/ saveTo /

saveTo := fileName writeStream.
saveTo binary.
[saveTo nextPutAll: aFile] ensure: [saveTo close].

As you can see the sending of a file using OpenTalk is basically one line of code. It's the reading and writing of the file that takes the most coding.
Of course the draw back of using OpenTalk is that it handles everything so it's not possible to determine things like amount downloaded or speed.

Link to this Page