c# - Get Behavior instance from Sessions? -


if understand correctly, everytime there connection request, behavior instance initialized. save information extended behavior class. however, want send message some connected client (for example, behavior instance have property productbehavior.type == producttype.main).

how can achieve this?

        foreach (var session in this.sessions.sessions)         {             // how behavior instance here, can property value?         } 

the session iwebsocketsession, , behavior implement interface. session variable in foreach behavior. need cast our behavior:

    foreach (var session in this.sessions.sessions)     {         mybehavior b = session mybehavior;         //     } 

Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -