Implementing IhttpHandler and IConnectionIdFactory(SignalR) in a class

I have a class SignalRConnection. Here I want to generate a connectionId for signalR . I want a new connection Id if the session is null else return the same connection.I tried to implement IhttpHandler for getting the context in the class and IConnectionIdFactory for the connectioId. My Code is Like this:

>  public class SignalRConnection :  
    IHttpHandler,IConnectionIdFactory,IRequireSessionState                                
    {
        string conId;
        public bool IsReusable
        {
            get { return true; }
        }

        public void ProcessRequest(HttpContext context)
        {
            if (context.Session["activeuser_id"] != null)
            {
                conId = context.Session["activeuser_id"].ToString();
            }
            else
            {
                conId = Guid.NewGuid().ToString();
            }
        }
        public string CreateConnectionId(SignalR.Hosting.IRequest request)
        {
            return conId;
        }
        public string CreateConnectionId(SignalR.Hosting.IRequest request ,string test)
        {
            return conId;
        }
    }

the problem here is the CreateConnectionId is only executed.I have the config file configured for the httphandler.I want the the conId to be generated from ProcessRequest and the the CreateConnectionId serve the ConnectionId to the SignalR Connection.Can It be obtained or am i heading the wrong direction.

Answers


IConnectionFactory is no longer supported in the latest version of SignalR. See SignalR 1.0 beta connection factory for recommendations on better ways to get the same behavior.


Need Your Help

richfaces 4 client side validation problem

richfaces client-side-validation

I have a problem with richfaces client side validation. Here is my xhtml page sample ;

MDI and WPF Ribbon

wpf xaml mdi ribbon

i noticed that the WPF Ribbon is bound to a XAML Usercontrol or window.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.