Leaving an opened channel

Hi guys,

currently, I’m trying to make a simple mini game on cell phone using SGSJME. The game requires clients to open channels and leave channels frequently. Basically, i understand that by opening a channel, we use clientMgr.openChannel(“channel1”);

My problem is, how do we leave or close that particular opened channel? :o

Before you join the channel, set a ClientConnectionManagerListener for the client manager, when the join is succesful you get a joinedChannel(ClientChannel channel) call. Store the ClientChannel and then when you want to leave, just call close() on it.

HTH

Endolf

is ClientConnectionManagerListener = JMEClientChannelListener ?

I’ve never used the JME stack, but looking at the J2ME guide in the SGS documentation I would say that yes, thats the interface you need to implement. In J2SE it’s the one I mentioned, but the J2ME stack is different.

HTH

Endolf

alright i’ll work it out :slight_smile: thanks!