






Hotspots: Admin Pages | Turn-in Site |
Current Links: Case Final Project Summer 2007
Step 2
Now for this basic introduction to OpenTalk we will be using "RequestBroker"s to preform all the sending and receiving of Objects we need.
Code
/ broker /
broker := RequestBroker newStstTcpAtPort: port .
This creates a new Request Broker using the TCP protocal and connects it to the port picked by you. The port can be any valid TCP port address (i.e. 0-65535)
Now before you can used the broker however you have to start it with this line of code
code: broker start.
Now to stop the broker and close the connection we do
code: broker stop.
Nice and easy right?
Now on to the next part need to setup opentalk.
code: broker objectAdaptor export: result oid: id.
This little line of code tells the broker what to return to the other computer base on the oid.
result Can be anything from a string to a class. You'll see later when sending messages that you can call specific methods in the class.
id This is the id of the object being recived by us. oid can be SmallInteger or Symbols.
It's possible to use multiple objectAdaptor with different oid on a single broker, allowing you to send obj to the appropreite class for
processing.
With this you can now send and recive messages using OpenTalk
Link to this Page