6 writes to _handle
System.Net.Sockets (6)
System\Net\Sockets\Socket.cs (3)
86SocketError errorCode = SocketPal.CreateSocket(addressFamily, socketType, protocolType, out _handle); 121_handle = handle; 231_handle = null!;
System\Net\Sockets\Socket.Unix.cs (3)
155Volatile.Write(ref _handle, newHandle); 270_handle = null!; 278_handle = source._handle;
95 references to _handle
System.Net.Sockets (95)
System\Net\Sockets\Socket.cs (61)
89Debug.Assert(_handle.IsInvalid); 95Debug.Assert(!_handle.IsInvalid); 279SocketError errorCode = SocketPal.GetAvailable(_handle, out argp); 317SocketError errorCode = SocketPal.GetSockName(_handle, ptr, &size); 361_handle, 397_handle.SetExposed(); 398return _handle; 402internal SafeSocketHandle InternalSafeHandle => _handle; // returns _handle without calling SetExposed. 812_handle, 1018SocketError errorCode = SocketPal.Listen(_handle, backlog); 1064_handle, 1155errorCode = SocketPal.Send(_handle, buffers, socketFlags, out bytesTransferred); 1202errorCode = SocketPal.Send(_handle, buffer, offset, size, socketFlags, out bytesTransferred); 1249errorCode = SocketPal.Send(_handle, buffer, socketFlags, out bytesTransferred); 1358SocketError errorCode = SocketPal.SendTo(_handle, buffer, offset, size, socketFlags, socketAddress.Buffer.Slice(0, socketAddress.Size), out bytesTransferred); 1440SocketError errorCode = SocketPal.SendTo(_handle, buffer, socketFlags, socketAddress.Buffer.Slice(0, socketAddress.Size), out bytesTransferred); 1481SocketError errorCode = SocketPal.SendTo(_handle, buffer, socketFlags, socketAddress.Buffer.Slice(0, socketAddress.Size), out bytesTransferred); 1545errorCode = SocketPal.Receive(_handle, buffer, offset, size, socketFlags, out bytesTransferred); 1587errorCode = SocketPal.Receive(_handle, buffer, socketFlags, out bytesTransferred); 1643errorCode = SocketPal.Receive(_handle, buffers, socketFlags, out bytesTransferred); 1686SocketError errorCode = SocketPal.ReceiveMessageFrom(this, _handle, buffer, offset, size, ref socketFlags, socketAddress, out receiveAddress, out ipPacketInformation, out bytesTransferred); 1773SocketError errorCode = SocketPal.ReceiveMessageFrom(this, _handle, buffer, ref socketFlags, socketAddress, out receiveAddress, out ipPacketInformation, out bytesTransferred); 1828SocketError errorCode = SocketPal.ReceiveFrom(_handle, buffer, offset, size, socketFlags, socketAddress.Buffer, out int socketAddressLength, out bytesTransferred); 1952SocketError errorCode = SocketPal.ReceiveFrom(_handle, buffer, socketFlags, socketAddress.Buffer, out int socketAddressLength, out bytesTransferred); 2030SocketError errorCode = SocketPal.ReceiveFrom(_handle, buffer, socketFlags, receivedAddress.Buffer, out int socketAddressSize, out bytesTransferred); 2061SocketError errorCode = SocketPal.WindowsIoctl(_handle, ioControlCode, optionInValue, optionOutValue, out realOptionLength); 2095SocketError errorCode = SocketPal.SetSockOpt(_handle, optionLevel, optionName, optionValue); 2173SocketError errorCode = SocketPal.SetRawSockOpt(_handle, optionLevel, optionName, optionValue); 2205_handle, 2229_handle, 2253_handle, 2294SocketError errorCode = SocketPal.GetRawSockOpt(_handle, optionLevel, optionName, optionValue, ref realOptionLength); 2350SocketError errorCode = SocketPal.Poll(_handle, microSeconds, mode, out status); 2474errorCode = SocketPal.Disconnect(this, _handle, reuseSocket); 2815SocketError errorCode = SocketPal.Shutdown(_handle, _isConnected, _isDisconnected, how); 2865socketError = e.DoOperationAccept(this, _handle, acceptHandle, cancellationToken); 2965e.DoOperationConnectEx(this, _handle) : 2966e.DoOperationConnect(_handle); // For connectionless protocols, Connect is not an I/O call. 3050socketError = e.DoOperationDisconnect(this, _handle, cancellationToken); 3075socketError = e.DoOperationReceive(_handle, cancellationToken); 3131socketError = e.DoOperationReceiveFrom(_handle, cancellationToken); 3179socketError = e.DoOperationReceiveMessageFrom(this, _handle, cancellationToken); 3204socketError = e.DoOperationSend(_handle, cancellationToken); 3237socketError = e.DoOperationSendPackets(this, _handle, cancellationToken); 3286socketError = e.DoOperationSendTo(_handle, cancellationToken); 3357errorCode = SocketPal.Connect(_handle, socketAddress.Buffer.Slice(0, socketAddress.Size)); 3409SafeSocketHandle? handle = _handle; 3547if (Disposed || _handle.IsInvalid) 3554SocketPal.Shutdown(_handle, _isConnected, _isDisconnected, how); 3604if (silent && (Disposed || _handle.IsInvalid)) 3612errorCode = SocketPal.SetSockOpt(_handle, optionLevel, optionName, optionValue); 3617if (silent && _handle.IsInvalid) 3645SocketError errorCode = SocketPal.SetMulticastOption(_handle, optionName, MR); 3659SocketError errorCode = SocketPal.SetIPv6MulticastOption(_handle, optionName, MR); 3674SocketError errorCode = SocketPal.SetLingerOption(_handle, lref); 3690SocketError errorCode = SocketPal.GetLingerOption(_handle, out lingerOption); 3706SocketError errorCode = SocketPal.GetMulticastOption(_handle, optionName, out multicastOption); 3723SocketError errorCode = SocketPal.GetIPv6MulticastOption(_handle, optionName, out multicastOption); 3751errorCode = SocketPal.SetBlocking(_handle, desired, out willBlock); 3931if (disconnectOnFailure && _isConnected && (_handle.IsInvalid || (errorCode != SocketError.WouldBlock && 4079if (_nonBlockingConnectInProgress && SocketPal.HasNonBlockingConnectCompleted(_handle, out bool success))
System\Net\Sockets\Socket.Unix.cs (34)
36get => _handle.PreferInlineCompletions; 37set => _handle.PreferInlineCompletions = value; 50if (_handle.ExposedHandleOrUntrackedConfiguration && (isMultiEndpoint || _handle.LastConnectFailed)) 58Debug.Assert(!_handle.LastConnectFailed); 117if (!_handle.LastConnectFailed) 128_handle.LastConnectFailed = false; 142if (_handle.IsTrackedOption(TrackedSocketOptions.DontFragment)) dontFragment = DontFragment; 143if (_handle.IsTrackedOption(TrackedSocketOptions.EnableBroadcast)) broadcast = EnableBroadcast; 144if (_handle.IsTrackedOption(TrackedSocketOptions.LingerState)) linger = LingerState; 145if (_handle.IsTrackedOption(TrackedSocketOptions.NoDelay)) noDelay = NoDelay; 146if (_handle.IsTrackedOption(TrackedSocketOptions.ReceiveBufferSize)) receiveSize = ReceiveBufferSize; 147if (_handle.IsTrackedOption(TrackedSocketOptions.ReceiveTimeout)) receiveTimeout = ReceiveTimeout; 148if (_handle.IsTrackedOption(TrackedSocketOptions.SendBufferSize)) sendSize = SendBufferSize; 149if (_handle.IsTrackedOption(TrackedSocketOptions.SendTimeout)) sendTimeout = SendTimeout; 150if (_handle.IsTrackedOption(TrackedSocketOptions.Ttl)) ttl = Ttl; 153SafeSocketHandle oldHandle = _handle; 156oldHandle.TransferTrackedState(_handle); 166_handle.Dispose(); 173if (_handle.IsTrackedOption(TrackedSocketOptions.DualMode)) DualMode = _handle.DualMode; 174if (_handle.IsTrackedOption(TrackedSocketOptions.DontFragment)) DontFragment = dontFragment; 175if (_handle.IsTrackedOption(TrackedSocketOptions.EnableBroadcast)) EnableBroadcast = broadcast; 176if (_handle.IsTrackedOption(TrackedSocketOptions.LingerState)) LingerState = linger!; 177if (_handle.IsTrackedOption(TrackedSocketOptions.NoDelay)) NoDelay = noDelay; 178if (_handle.IsTrackedOption(TrackedSocketOptions.ReceiveBufferSize)) ReceiveBufferSize = receiveSize; 179if (_handle.IsTrackedOption(TrackedSocketOptions.ReceiveTimeout)) ReceiveTimeout = receiveTimeout; 180if (_handle.IsTrackedOption(TrackedSocketOptions.SendBufferSize)) SendBufferSize = sendSize; 181if (_handle.IsTrackedOption(TrackedSocketOptions.SendTimeout)) SendTimeout = sendTimeout; 182if (_handle.IsTrackedOption(TrackedSocketOptions.Ttl)) Ttl = ttl; 197if (acceptSocket._handle.HasShutdownSend) 244errorCode = SocketPal.SendFile(_handle, fileHandle); 265_handle.Dispose(); 278_handle = source._handle;