To construct a dictionary, include a member instance variable such as:
GroupLab.PeerDictionary.P2PDictionary mDictionary;
Then, in the primary method of your class:
mDictionary = new GroupLab.PeerDictionary.P2PDictionary("Your description",
GroupLab.PeerDictionary.P2PDictionary.GetFreePort(1111),
"Namespace");
- "Your description"
- User-friendly description for your dictionary. Currently used for web access.
- GroupLab.PeerDictionary.P2PDictionary.GetFreePort(1111)
- GetFreePort() is a helper function that finds the next free port to listen on. In this example, it searches at 1111.
- "Namespace"
- All peers that use this dictionary data need to have the same namespace. The namespace must follow HTTP path conventions.