123 references to WebSocketHelper
System.ServiceModel (123)
System\ServiceModel\Channels\ClientWebSocketTransportDuplexSessionChannel.cs (10)
226
string serverVersion = webResponse.Headers[
WebSocketHelper
.SecWebSocketVersion];
232
string serverSubProtocol = webResponse.Headers[
WebSocketHelper
.SecWebSocketProtocol];
245
request.Headers[
WebSocketHelper
.SecWebSocketProtocol] = this.WebSocketSettings.SubProtocol;
335
this.webSocketKey = request.Headers[
WebSocketHelper
.SecWebSocketKey];
377
WebSocketHelper
.GetReceiveBufferSize(this.channelFactory.MaxReceivedMessageSize),
442
string expectedAcceptHeader =
WebSocketHelper
.ComputeAcceptHeader(this.webSocketKey);
443
CheckResponseHeader(response,
WebSocketHelper
.SecWebSocketAccept, expectedAcceptHeader, false);
447
CheckResponseHeader(response,
WebSocketHelper
.SecWebSocketProtocol, this.WebSocketSettings.SubProtocol, true);
451
string headerValue = response.Headers[
WebSocketHelper
.SecWebSocketProtocol];
495
request.Headers[
WebSocketHelper
.SecWebSocketVersion] = webSocketVersion;
System\ServiceModel\Channels\DefaultWebSocketConnectionHandler.cs (8)
52
if (!CheckHttpHeader(request,
WebSocketHelper
.SecWebSocketVersion, this.checkVersionFunc))
101
response.Headers.Remove(
WebSocketHelper
.SecWebSocketProtocol);
104
response.Headers.Add(
WebSocketHelper
.SecWebSocketProtocol, negotiatedProtocol);
112
SR.GetString(SR.WebSocketInvalidProtocolNoHeader, this.subProtocol,
WebSocketHelper
.SecWebSocketProtocol)));
126
if (request.Headers.TryGetValues(
WebSocketHelper
.SecWebSocketProtocol, out clientProtocols))
135
if (
WebSocketHelper
.TryParseSubProtocol(headerValue, out protocolList))
162
response.Headers.Add(
WebSocketHelper
.SecWebSocketProtocol, subprotocol);
171
response.Headers.Add(
WebSocketHelper
.SecWebSocketVersion, version);
System\ServiceModel\Channels\HttpChannelFactory.cs (8)
170
this.webSocketSettings =
WebSocketHelper
.GetRuntimeWebSocketSettings(bindingElement.WebSocketSettings);
172
int webSocketBufferSize =
WebSocketHelper
.ComputeClientBufferSize(this.MaxReceivedMessageSize);
440
EndpointAddress httpRemoteAddress = remoteAddress != null &&
WebSocketHelper
.IsWebSocketUri(remoteAddress.Uri) ?
441
new EndpointAddress(
WebSocketHelper
.NormalizeWsSchemeWithHttpScheme(remoteAddress.Uri), remoteAddress) :
444
Uri httpVia =
WebSocketHelper
.IsWebSocketUri(via) ?
WebSocketHelper
.NormalizeWsSchemeWithHttpScheme(via) : via;
487
else if (!
WebSocketHelper
.OSSupportsWebSockets() && this.ClientWebSocketFactory == null)
735
Uri httpWebRequestUri = isWebSocketRequest ?
WebSocketHelper
.GetWebSocketUri(via) : via;
System\ServiceModel\Channels\HttpChannelListener.cs (9)
114
this.webSocketSettings =
WebSocketHelper
.GetRuntimeWebSocketSettings(bindingElement.WebSocketSettings);
848
else if (!
WebSocketHelper
.OSSupportsWebSockets())
853
this.currentWebSocketVersion =
WebSocketHelper
.GetCurrentVersion();
855
int webSocketBufferSize =
WebSocketHelper
.ComputeServerBufferSize(bindingElement.MaxReceivedMessageSize);
927
TD.MaxPendingConnectionsExceeded(SR.GetString(SR.WebSocketMaxPendingConnectionsReached, this.WebSocketSettings.MaxPendingConnections,
WebSocketHelper
.MaxPendingConnectionsString,
WebSocketHelper
.WebSocketTransportSettingsString));
933
TraceCode.MaxPendingConnectionsReached, SR.GetString(SR.WebSocketMaxPendingConnectionsReached, this.WebSocketSettings.MaxPendingConnections,
WebSocketHelper
.MaxPendingConnectionsString,
WebSocketHelper
.WebSocketTransportSettingsString),
934
new StringTraceRecord(
WebSocketHelper
.MaxPendingConnectionsString, this.WebSocketSettings.MaxPendingConnections.ToString(System.Globalization.CultureInfo.InvariantCulture)),
System\ServiceModel\Channels\HttpPipeline.cs (3)
801
if (response.Headers.Contains(
WebSocketHelper
.SecWebSocketProtocol))
803
foreach (string headerValue in response.Headers.GetValues(
WebSocketHelper
.SecWebSocketProtocol))
809
response.Headers.Remove(
WebSocketHelper
.SecWebSocketProtocol);
System\ServiceModel\Channels\HttpRequestContext.cs (2)
504
WebSocketHelper
.ThrowCorrectException(ex);
805
WebSocketHelper
.GetReceiveBufferSize(this.listener.MaxReceivedMessageSize),
System\ServiceModel\Channels\HttpTransportBindingElement.cs (3)
787
bool useWebSocketTransport =
WebSocketHelper
.UseWebSocketTransport(this.WebSocketSettings.TransportUsage, policyContext.Contract.IsDuplex());
882
bool useWebSocketTransport =
WebSocketHelper
.UseWebSocketTransport(this.WebSocketSettings.TransportUsage, endpointContext.ContractConversionContext.Contract.IsDuplex());
887
address = new EndpointAddress(
WebSocketHelper
.GetWebSocketUri(endpointContext.Endpoint.Address.Uri), endpointContext.Endpoint.Address);
System\ServiceModel\Channels\WebSocketHelper.cs (7)
54
string fullString = webSocketKey +
WebSocketHelper
.WebSocketKeyPostString;
105
(
WebSocketHelper
.SchemeWs.Equals(uri.Scheme, StringComparison.OrdinalIgnoreCase) ||
106
WebSocketHelper
.SchemeWss.Equals(uri.Scheme, StringComparison.OrdinalIgnoreCase));
198
string version = request.Headers[
WebSocketHelper
.SecWebSocketVersion];
344
case
WebSocketHelper
.CloseOperation:
347
case
WebSocketHelper
.SendOperation:
350
case
WebSocketHelper
.ReceiveOperation:
System\ServiceModel\Channels\WebSocketTransportDuplexSessionChannel.cs (71)
34
int cleanupStatus =
WebSocketHelper
.OperationNotStarted;
160
closeTask.Wait(timeout,
WebSocketHelper
.ThrowCorrectException,
WebSocketHelper
.CloseOperation);
185
task.Wait(timeout,
WebSocketHelper
.ThrowCorrectException,
WebSocketHelper
.CloseOperation);
233
WebSocketHelper
.ThrowExceptionOnTaskFailure(t, timeout,
WebSocketHelper
.SendOperation);
294
WebSocketHelper
.ThrowExceptionOnTaskFailure(t, timeout,
WebSocketHelper
.CloseOperation);
343
task.Wait(helper.RemainingTime(),
WebSocketHelper
.ThrowCorrectException,
WebSocketHelper
.SendOperation);
378
if (Interlocked.CompareExchange(ref this.cleanupStatus,
WebSocketHelper
.OperationFinished,
WebSocketHelper
.OperationNotStarted) ==
WebSocketHelper
.OperationNotStarted)
386
Fx.Assert(this.cleanupStatus ==
WebSocketHelper
.OperationFinished,
425
throw
WebSocketHelper
.ConvertAndTraceException(e);
443
throw
WebSocketHelper
.ConvertAndTraceException(e);
542
this.receiveBufferSize = Math.Min(
WebSocketHelper
.GetReceiveBufferSize(this.maxReceivedMessageSize), this.maxBufferSize);
594
throw FxTrace.Exception.AsError(
WebSocketHelper
.GetTimeoutException(null, this.asyncReceiveTimeout,
WebSocketHelper
.ReceiveOperation));
700
WebSocketHelper
.ThrowCorrectException(ex, TimeSpan.MaxValue,
WebSocketHelper
.ReceiveOperation);
731
this.pendingException =
WebSocketHelper
.ConvertAndTraceException(ex, TimeSpan.MaxValue,
WebSocketHelper
.ReceiveOperation);
896
WebSocketHelper
.ThrowCorrectException(ex, this.asyncReceiveTimeout,
WebSocketHelper
.ReceiveOperation);
907
this.pendingException =
WebSocketHelper
.ConvertAndTraceException(ex, this.asyncReceiveTimeout,
WebSocketHelper
.ReceiveOperation);
1060
this.messageSourceCleanState =
WebSocketHelper
.OperationNotStarted;
1061
this.endOfMessageWritten =
WebSocketHelper
.OperationNotStarted;
1073
this.messageSourceCleanState =
WebSocketHelper
.OperationFinished;
1163
throw FxTrace.Exception.AsError(
WebSocketHelper
.GetTimeoutException(null, TimeoutHelper.FromMilliseconds(this.ReadTimeout),
WebSocketHelper
.ReceiveOperation));
1194
WebSocketHelper
.ThrowExceptionOnTaskFailure(t, TimeoutHelper.FromMilliseconds(this.ReadTimeout),
WebSocketHelper
.ReceiveOperation);
1222
WebSocketHelper
.ThrowExceptionOnTaskFailure((Task)task, TimeoutHelper.FromMilliseconds(this.ReadTimeout),
WebSocketHelper
.ReceiveOperation);
1234
throw FxTrace.Exception.AsError(
WebSocketHelper
.GetTimeoutException(null, TimeoutHelper.FromMilliseconds(this.ReadTimeout),
WebSocketHelper
.ReceiveOperation));
1262
task.Wait(helper.RemainingTime(),
WebSocketHelper
.ThrowCorrectException,
WebSocketHelper
.ReceiveOperation);
1301
if (this.endOfMessageWritten ==
WebSocketHelper
.OperationFinished)
1308
throw FxTrace.Exception.AsError(
WebSocketHelper
.GetTimeoutException(null, TimeoutHelper.FromMilliseconds(this.WriteTimeout),
WebSocketHelper
.SendOperation));
1320
task.Wait(TimeoutHelper.FromMilliseconds(this.WriteTimeout),
WebSocketHelper
.ThrowCorrectException,
WebSocketHelper
.SendOperation);
1330
if (this.endOfMessageWritten ==
WebSocketHelper
.OperationFinished)
1337
throw FxTrace.Exception.AsError(
WebSocketHelper
.GetTimeoutException(null, TimeoutHelper.FromMilliseconds(this.WriteTimeout),
WebSocketHelper
.SendOperation));
1357
WebSocketHelper
.ThrowExceptionOnTaskFailure(t, TimeoutHelper.FromMilliseconds(this.WriteTimeout),
WebSocketHelper
.SendOperation);
1366
WebSocketHelper
.ThrowExceptionOnTaskFailure(task, TimeoutHelper.FromMilliseconds(this.WriteTimeout),
WebSocketHelper
.SendOperation);
1379
if (Interlocked.CompareExchange(ref this.endOfMessageWritten,
WebSocketHelper
.OperationFinished,
WebSocketHelper
.OperationNotStarted) ==
WebSocketHelper
.OperationNotStarted)
1382
task.Wait(timeout,
WebSocketHelper
.ThrowCorrectException,
WebSocketHelper
.SendOperation);
1418
WebSocketHelper
.ThrowCorrectException(ex, TimeoutHelper.FromMilliseconds(this.WriteTimeout),
WebSocketHelper
.SendOperation);
1427
WebSocketHelper
.ThrowCorrectException(ex);
1457
if (Interlocked.CompareExchange(ref this.messageSourceCleanState,
WebSocketHelper
.OperationFinished,
WebSocketHelper
.OperationNotStarted) ==
WebSocketHelper
.OperationNotStarted)
1469
receiveTask.Wait(helper.RemainingTime(),
WebSocketHelper
.ThrowCorrectException,
WebSocketHelper
.ReceiveOperation);
1485
pendingException =
WebSocketHelper
.ConvertAndTraceException(ex, timeout,
WebSocketHelper
.CloseOperation);
1495
if (Interlocked.CompareExchange(ref this.endOfMessageWritten,
WebSocketHelper
.OperationFinished,
WebSocketHelper
.OperationNotStarted) ==
WebSocketHelper
.OperationNotStarted)
System\ServiceModel\Channels\WebSocketTransportSettings.cs (2)
128
if (value.Split(
WebSocketHelper
.ProtocolSeparators).Length > 1)
134
if (
WebSocketHelper
.IsSubProtocolInvalid(value, out invalidChar))