本文整理汇总了C#中ISocket.Authenticate方法的典型用法代码示例。如果您正苦于以下问题:C# ISocket.Authenticate方法的具体用法?C# ISocket.Authenticate怎么用?C# ISocket.Authenticate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISocket
的用法示例。
在下文中一共展示了ISocket.Authenticate方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnClientConnect
private void OnClientConnect(ISocket clientSocket)
{
if (clientSocket == null) return; // socket closed
FleckLog.Debug(String.Format("Client connected from {0}:{1}", clientSocket.RemoteIpAddress, clientSocket.RemotePort.ToString()));
ListenForClients();
WebSocketConnection connection = null;
connection = new WebSocketConnection(
clientSocket,
_config,
bytes => RequestParser.Parse(bytes, _scheme),
r => HandlerFactory.BuildHandler(r,
s => connection.OnMessage(s),
connection.Close,
b => connection.OnBinary(b),
b => connection.OnPing(b),
b => connection.OnPong(b)),
s => SubProtocolNegotiator.Negotiate(SupportedSubProtocols, s));
if (IsSecure)
{
FleckLog.Debug("Authenticating Secure Connection");
clientSocket
.Authenticate(Certificate,
EnabledSslProtocols,
connection.StartReceiving,
e => FleckLog.Warn("Failed to Authenticate", e));
}
else
{
connection.StartReceiving();
}
}
示例2: OnClientConnect
private void OnClientConnect(ISocket clientSocket)
{
FleckLog.Debug(String.Format("Client connected from {0}:{1}", clientSocket.RemoteIpAddress, clientSocket.RemotePort.ToString()));
ListenForClients();
WebSocketConnection connection = null;
connection = new WebSocketConnection(
clientSocket,
_config,
bytes => RequestParser.Parse(bytes, _scheme, AccessPolicyServer, clientSocket),
r => HandlerFactory.BuildHandler(r,
s => connection.OnMessage(s),
connection.Close,
b => connection.OnBinary(b)));
if (IsSecure)
{
FleckLog.Debug("Authenticating Secure Connection");
clientSocket
.Authenticate(Certificate,
connection.StartReceiving,
e => FleckLog.Warn("Failed to Authenticate", e));
}
else
{
connection.StartReceiving();
}
}
示例3: OnClientConnect
private void OnClientConnect(ISocket clientSocket)
{
this.ListenForClients();
WebSocketConnection connection = null;
connection = new WebSocketConnection(clientSocket, this.scheme);
connection.MessageReceived += new EventHandler<TextMessageHandledEventArgs>(this.ConnectionMessageReceivedEventHandler);
connection.BinaryMessageReceived += new EventHandler<BinaryMessageHandledEventArgs>(this.ConnectionBinaryMessageReceivedEventHandler);
connection.Opened += new EventHandler<ConnectionEventArgs>(this.ConnectionOpenedEventHandler);
connection.Closed += new EventHandler<ConnectionEventArgs>(this.ConnectionClosedEventHandler);
connection.ErrorReceived += new EventHandler<ErrorEventArgs>(this.ConnectionErrorEventHandler);
connection.StandardHttpRequestReceived += new EventHandler<StandardHttpRequestReceivedEventArgs>(this.ConnectionStandardHttpRequestReceivedEventHandler);
if (this.IsSecure)
{
clientSocket.Authenticated += new EventHandler(this.SocketAuthenticatedEventHandler);
clientSocket.Authenticate(this.authenticationX509Certificate);
}
else
{
connection.StartReceiving();
}
}
示例4: OnClientConnect
private void OnClientConnect(ISocket clientSocket)
{
FleckLog.Debug("Client Connected");
ListenForClients();
WebSocketConnection connection = null;
connection = new WebSocketConnection(
clientSocket,
bytes => RequestParser.Parse(bytes, _scheme),
r => HandlerFactory.BuildHandler(r, s => connection.OnMessage(s),
connection.Close));
_config(connection);
if (IsSecure)
{
FleckLog.Debug("Authenticating Secure Connection");
clientSocket
.Authenticate(_x509Certificate,
connection.StartReceiving,
e => FleckLog.Warn("Failed to Authenticate", e));
}
else
{
connection.StartReceiving();
}
}
示例5: OnClientConnect
private void OnClientConnect(ISocket clientSocket)
{
FleckLog.Debug("Client Connected");
ListenForClients();
var connection = new WebSocketConnection(clientSocket, new DefaultHandlerFactory(_scheme));
_config(connection);
if (IsSecure)
{
FleckLog.Debug("Authenticating Secure Connection");
clientSocket
.Authenticate(_x509Certificate,
connection.StartReceiving,
e => FleckLog.Warn("Failed to Authenticate", e));
}
else
{
connection.StartReceiving();
}
}