[SOLVED] Disconnect messages

Hey there,



I’m currently working on a Session system for my server. Now I have a SessionTimeout event which I sent from my session watcher to my spidermonkey connector. I want to be able to send this message to my client, but currently this is not a supported DisconnectMessage Type. No problem, I can just send my own Disconnect message.



The thing is, atm. I can only send this as a seperate message. I would like to be able to send a custom disconnect message in the same way as the current disconnect messages are sent. This would mean the “private void disconnect(Message message) throws IOException” would have to become public. Since I already have outstanding changes in the Client that I need Lars to put in the baseline version, I can do this myself no problem. But I’m not sure this is something that would break anything.

Make your disconnect Message extend his disconnect message and then try sending it that way

The problem isn;t that I can’t create a disconnect message, the problem is that I can’t pass it to the disconnect method…



The disconnect method only excepts a limited number of types, one of which is USER_REQUESTED, which sounds promissiong, but without the ability to supply a reason…

hmm, Yeah I can’t really help further. I used spidermonkey about 2 months ago and just decided to write my own networking piece. Sorry :o

There is a setReason() method in DisconnectMessage, but I will also supply a method to provide your own disconnect messages in the future.

Done.