10 private bool isReadOnly;
18 private int receiveBufferSize;
20 private int sendBufferSize;
24 private bool useDefaultCredentials;
43 return useDefaultCredentials;
48 useDefaultCredentials = value;
88 if (clientCertificates ==
null)
92 return clientCertificates;
101 clientCertificates = value;
122 internal int ReceiveBufferSize => receiveBufferSize;
124 internal int SendBufferSize => sendBufferSize;
126 internal IList<string> RequestedSubProtocols => requestedSubProtocols;
134 return keepAliveInterval;
143 keepAliveInterval = value;
152 receiveBufferSize = 16384;
153 sendBufferSize = 16384;
163 requestHeaders.Set(headerName, headerValue);
169 public void SetBuffer(
int receiveBufferSize,
int sendBufferSize)
172 WebSocketHelpers.ValidateBufferSizes(receiveBufferSize, sendBufferSize);
174 this.receiveBufferSize = receiveBufferSize;
175 this.sendBufferSize = sendBufferSize;
185 WebSocketHelpers.ValidateBufferSizes(receiveBufferSize, sendBufferSize);
186 WebSocketHelpers.ValidateArraySegment(buffer,
"buffer");
187 WebSocketBuffer.Validate(buffer.
Count, receiveBufferSize, sendBufferSize, isServerBuffer:
false);
188 this.receiveBufferSize = receiveBufferSize;
189 this.sendBufferSize = sendBufferSize;
192 this.buffer = buffer;
202 if (!buffer.HasValue)
214 WebSocketHelpers.ValidateSubprotocol(subProtocol);
215 foreach (
string requestedSubProtocol
in requestedSubProtocols)
217 if (
string.Equals(requestedSubProtocol, subProtocol,
StringComparison.OrdinalIgnoreCase))
219 throw new ArgumentException(SR.GetString(
"net_WebSockets_NoDuplicateProtocol", subProtocol),
"subProtocol");
222 requestedSubProtocols.Add(subProtocol);
225 internal void SetToReadOnly()
230 private void ThrowIfReadOnly()
void SetRequestHeader(string headerName, string headerValue)
Creates a HTTP request header and its value.
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
Options to use with a T:System.Net.WebSockets.ClientWebSocket object.
static TimeSpan DefaultKeepAliveInterval
Gets the default WebSocket protocol keep-alive interval in milliseconds.
StringComparison
Specifies the culture, case, and sort rules to be used by certain overloads of the M:System....
Defines a collection that stores T:System.Security.Cryptography.X509Certificates.X509Certificate obje...
bool UseDefaultCredentials
Gets or sets a T:System.Boolean value that indicates if default credentials should be used during Web...
Makes a request to a Uniform Resource Identifier (URI). This is an abstract class.
ICredentials Credentials
Gets or sets the credential information for the client.
The exception that is thrown when the value of an argument is outside the allowable range of values a...
void SetBuffer(int receiveBufferSize, int sendBufferSize)
Sets the client buffer parameters.
Provides a container for a collection of T:System.Net.CookieCollection objects.
static ArraySegment< byte > CreateClientBuffer(int receiveBufferSize, int sendBufferSize)
Create client buffers to use with this T:System.Net.WebSockets.WebSocket instance.
static AppDomain CurrentDomain
Gets the current application domain for the current T:System.Threading.Thread.
void AddSubProtocol(string subProtocol)
Adds a sub-protocol to be negotiated during the WebSocket connection handshake.
Represents an application domain, which is an isolated environment where applications execute....
static readonly TimeSpan InfiniteTimeSpan
A constant used to specify an infinite waiting period, for methods that accept a T:System....
TimeSpan KeepAliveInterval
Gets or sets the WebSocket protocol keep-alive interval in milliseconds.
The WebSocket class allows applications to send and receive data after the WebSocket upgrade has comp...
Provides the base authentication interface for retrieving credentials for Web client authentication.
bool??? IsFullyTrusted
Gets a value that indicates whether assemblies that are loaded into the current application domain ex...
IWebProxy Proxy
Gets or sets the proxy for WebSocket requests.
Contains constants that specify infinite time-out intervals. This class cannot be inherited.
The exception that is thrown when one of the arguments provided to a method is not valid.
CookieContainer Cookies
Gets or sets the cookies associated with the request.
int Count
Gets the number of elements in the range delimited by the array segment.
override string ToString()
Converts the value of the current T:System.TimeSpan object to its equivalent string representation.
Represents a time interval.To browse the .NET Framework source code for this type,...
void SetBuffer(int receiveBufferSize, int sendBufferSize, ArraySegment< byte > buffer)
Sets client buffer parameters.
X509CertificateCollection ClientCertificates
Gets or sets a collection of client side certificates.
The exception that is thrown when a method call is invalid for the object's current state.
Provides the base interface for implementation of proxy access for the T:System.Net....
static IWebProxy DefaultWebProxy
Gets or sets the global HTTP proxy.