Bauglir.Ex.WebSocketServer.GetConnectionInstance C# (CSharp) Method

GetConnectionInstance() public method

Function to create WebSocketServerConnection instance. Function should return null if connection should not be accepted or some non 101 HTTP result code (see below) if application implementation needs to use it's own inplementation of WebSocketServerConnection (based on WebSocketServerConnection class) application should create new WebSocketServer (based on this one) and override this method to return its own instance of connection based on either application logic or passed parameters All parameters, except for aClient and aHttpCode refers to properties in WebSocketConnection, check the documentation of WebSocketConnection Function does not have to set up phis variables to result object properties, it's done automatically by server after object is returned.
public GetConnectionInstance ( TcpClient aClient, Bauglir.Ex.WebSocketHeaders aHeaders, string aHost, string aPort, string aResourceName, string aOrigin, string aCookie, string aVersion, string &aProtocol, string &aExtension, int &aHttpCode ) : WebSocketServerConnection
aClient System.Net.Sockets.TcpClient TcpClient requesting connection, client MUST NOT be closed by this function
aHeaders Bauglir.Ex.WebSocketHeaders
aHost string
aPort string
aResourceName string
aOrigin string If "-" passed, no origin was passed by client
aCookie string If "-" passed, no cookies was passed by client
aVersion string
aProtocol string In value is list of protocol requested by client ("-" if non requested). Out values should be list of protocol supported by server based on client request, if "-" is returned, no protocol will be negotitated
aExtension string In value is list of extensions requested by client ("-" if non requested). Out values should be list of extensions supported by server based on client request, if "-" is returned, no extensions will be negotitated
aHttpCode int HTTP result code to return, if other than 101 is returned, connection will be automatically closed. 101 is default value
return WebSocketServerConnection
        public virtual WebSocketServerConnection GetConnectionInstance(
            TcpClient aClient,
            WebSocketHeaders aHeaders,
            string aHost, string aPort, string aResourceName, string aOrigin, string aCookie, string aVersion,
            ref string aProtocol, ref string aExtension,
            ref int aHttpCode
            )
        {
            return new WebSocketServerConnection(aClient, this);
        }