Custom session?

Apr 16, 2011 at 10:33 AM
Edited Apr 16, 2011 at 1:37 PM

How can I create a custom session?
I tried:

socket.NewSessionConnected += new SessionEventHandler<CustomSession>(Method);
and... 
CustomSession : WebSocketSession<CustomSession> 



but there are problems with conversion and I can't compile it.

Compiler want: CustomSession : WebSocketSession<CustomSession> and CustomSession: WebSocketSession.

But this is impossible...

Coordinator
Apr 17, 2011 at 2:34 AM

You needn't to custom session in SuperWebSocket.

There are two ways to handler websocket request:

1) CommandHandler: the website SuperWebSocketWeb use SuperWebSocket in this way

2) SubProtocol: the project SuperWebSocketTest works in this way. You can follow the code here:

http://superwebsocket.codeplex.com/SourceControl/changeset/view/65519#1330135

Coordinator
Apr 17, 2011 at 2:37 AM
Hi, sir
You can consider projects SuperWebSocketTest and SuperWebSocketWeb as samples for now.
From: [email removed]
Sent: Saturday, April 16, 2011 6:33 PM
To: [email removed]
Subject: Example or documentation... [SuperWebSocket:254157]

From: guepard

Please create documentation or a simple example.

What references are needed to run an application WebSocket?
What classes should be created?
...

I can not run this library...

Apr 17, 2011 at 7:12 AM
Edited Apr 17, 2011 at 8:22 AM
kerryjiang wrote:

You needn't to custom session in SuperWebSocket.

There are two ways to handler websocket request:

1) CommandHandler: the website SuperWebSocketWeb use SuperWebSocket in this way

2) SubProtocol: the project SuperWebSocketTest works in this way. You can follow the code here:

http://superwebsocket.codeplex.com/SourceControl/changeset/view/65519#1330135


I need it because I need to relate each session with an object, because of that, I prefer to use pointers and functions (Inheritance) instead of using a hashtable or something similar to relate each session with each object. ¿Why I need it? Because every session is an user, and I need to save data from every user (and use this data...).

However, it is possible that I'm not understanding something hehe

Thanks for answering.

Coordinator
Apr 17, 2011 at 12:15 PM
Edited Apr 17, 2011 at 12:18 PM

Yes, custom session is  supported.

I'll send you some code privately, because the code is not public. Could you tell me your mail address?

I'll write some sample code for it when I am free.