[quote]how do you get the channel ID when you create the chanel doing this
ST1.openChannel(“chat”);
or this
SelectableChannel SC2;
or
SocketChannel SC;
if your only suosed to use one which one do you use Huh Grin Tongue
[/quote]
On the server side, you receive a Channel ID as the return value from SimTask.openChannel(channelName). You can use this Channel ID to reference the channel in the future (but not across server reboots). On the client side, you simply reference channels by name – no IDs are known to the client.
You shouldn’t ever have to use the raw NIO classes such as SocketChannel. If you need to open an artibrary connection on a remote server, use the Raw Socket Manager via SimTask (i.e. SimTask.openSocket, sendRawSocketData, closeSocket, etc.)
[quote]PS are
SimTask and NIOConnection ment to work together
[/quote]
You shouldn’t have to worry about NIOConnection. SimTask is your server-side view of the world.
[quote]+ how do you set the port to lisen at
[/quote]
In your deployment descriptor (deploy.xml for most of the examples) one of the parameter names is “port”. Also, if you are using the canned FakeDiscovery.xml, specify the port here as well.
[quote]PPS how do you register a user or get User ID
[/quote]
There should be a server-side class signed up as the SimUserListener for the application. When a user connects, the UserID is passed to the SimUserListener.userJoined call back. In most of the examples there is a “Boot” class that handles user logins/logouts. The Chat Test is an excellent example of most of the common idioms for user connection.
Hope that helps.