103 references to SocketPal
System.Net.Sockets (103)
System\Net\Sockets\SafeSocketHandle.Unix.cs (7)
232return SocketPal.GetSocketErrorForErrorCode(CloseHandle(handle)); 237return SocketPal.GetSocketErrorForErrorCode(CloseHandle(handle)); 251return SocketPal.GetSocketErrorForErrorCode(errorCode); 259return SocketPal.GetSocketErrorForErrorCode(CloseHandle(handle)); 274_closeSocketLinger = SocketPal.GetSocketErrorForErrorCode(errorCode); 290return SocketPal.GetSocketErrorForErrorCode(errorCode); 320_closeSocketResult = SocketPal.GetSocketErrorForErrorCode(errorCode);
System\Net\Sockets\Socket.cs (58)
86SocketError errorCode = SocketPal.CreateSocket(addressFamily, socketType, protocolType, out _handle); 139Debug.Assert(SocketPal.MaximumAddressSize <= 512); 141Span<byte> buffer = stackalloc byte[SocketPal.MaximumAddressSize]; 145if (SocketPal.GetSockName(handle, bufferPtr, &bufferLength) != SocketError.Success) 186switch (SocketPal.GetPeerName(handle, buffer, ref bufferLength)) 279SocketError errorCode = SocketPal.GetAvailable(_handle, out argp); 317SocketError errorCode = SocketPal.GetSockName(_handle, ptr, &size); 360SocketError errorCode = SocketPal.GetPeerName( 811SocketError errorCode = SocketPal.Bind( 1018SocketError errorCode = SocketPal.Listen(_handle, backlog); 1063errorCode = SocketPal.Accept( 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); 1673SocketPal.CheckDualModePacketInfoSupport(this); 1686SocketError errorCode = SocketPal.ReceiveMessageFrom(this, _handle, buffer, offset, size, ref socketFlags, socketAddress, out receiveAddress, out ipPacketInformation, out bytesTransferred); 1760SocketPal.CheckDualModePacketInfoSupport(this); 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); 2204SocketError errorCode = SocketPal.GetSockOpt( 2228SocketError errorCode = SocketPal.GetSockOpt( 2252SocketError errorCode = SocketPal.GetSockOpt( 2294SocketError errorCode = SocketPal.GetRawSockOpt(_handle, optionLevel, optionName, optionValue, ref realOptionLength); 2316SocketPal.SetIPProtectionLevel(this, SocketOptionLevel.IPv6, (int)level); 2320SocketPal.SetIPProtectionLevel(this, SocketOptionLevel.IP, (int)level); 2350SocketError errorCode = SocketPal.Poll(_handle, microSeconds, mode, out status); 2414SocketError errorCode = SocketPal.Select(checkRead, checkWrite, checkError, microSeconds); 2474errorCode = SocketPal.Disconnect(this, _handle, reuseSocket); 2815SocketError errorCode = SocketPal.Shutdown(_handle, _isConnected, _isDisconnected, how); 3160SocketPal.CheckDualModePacketInfoSupport(this); 3357errorCode = SocketPal.Connect(_handle, socketAddress.Buffer.Slice(0, socketAddress.Size)); 3441errorCode = SocketPal.SetBlocking(handle, false, out willBlock); 3454errorCode = SocketPal.Shutdown(handle, _isConnected, _isDisconnected, SocketShutdown.Send); 3458errorCode = SocketPal.SetSockOpt( 3472errorCode = SocketPal.Receive(handle, Array.Empty<byte>(), 0, 0, SocketFlags.None, out unused); 3484errorCode = SocketPal.GetAvailable(handle, out dataAvailable); 3554SocketPal.Shutdown(_handle, _isConnected, _isDisconnected, how); 3579SocketPal.SetReceivingDualModeIPv4PacketInformation(this); 3612errorCode = SocketPal.SetSockOpt(_handle, optionLevel, optionName, optionValue); 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); 4079if (_nonBlockingConnectInProgress && SocketPal.HasNonBlockingConnectCompleted(_handle, out bool success))
System\Net\Sockets\Socket.Unix.cs (2)
154SocketError errorCode = SocketPal.CreateSocket(_addressFamily, _socketType, _protocolType, out SafeSocketHandle newHandle); 244errorCode = SocketPal.SendFile(_handle, fileHandle);
System\Net\Sockets\SocketAsyncContext.Unix.cs (33)
374return SocketPal.TryCompleteSendTo(context._socket, Buffer.Span, null, ref bufferIndex, ref Offset, ref Count, Flags, SocketAddress.Span, ref BytesTransferred, out ErrorCode); 402return SocketPal.TryCompleteSendTo(context._socket, default(ReadOnlySpan<byte>), Buffers, ref BufferIndex, ref Offset, ref Count, Flags, SocketAddress.Span, ref BytesTransferred, out ErrorCode); 431return SocketPal.TryCompleteSendTo(context._socket, new ReadOnlySpan<byte>(BufferPtr, bufferLength), null, ref bufferIndex, ref Offset, ref Count, Flags, SocketAddress.Span, ref BytesTransferred, out ErrorCode); 474return SocketPal.TryCompleteReceive(context._socket, Buffer.Span, Flags, out BytesTransferred, out ErrorCode); 478bool completed = SocketPal.TryCompleteReceiveFrom(context._socket, Buffer.Span, null, Flags, SocketAddress.Span, out int socketAddressLen, out BytesTransferred, out ReceivedFlags, out ErrorCode); 513bool completed = SocketPal.TryCompleteReceiveFrom(context._socket, default(Span<byte>), Buffers, Flags, SocketAddress.Span, out int socketAddressLen, out BytesTransferred, out ReceivedFlags, out ErrorCode); 547bool completed = SocketPal.TryCompleteReceiveFrom(context._socket, new Span<byte>(BufferPtr, Length), null, Flags, SocketAddress.Span, out int socketAddressLen, out BytesTransferred, out ReceivedFlags, out ErrorCode); 574bool completed = SocketPal.TryCompleteReceiveMessageFrom(context._socket, Buffer.Span, Buffers, Flags, SocketAddress, out int socketAddressLen, IsIPv4, IsIPv6, out BytesTransferred, out ReceivedFlags, out IPPacketInformation, out ErrorCode); 604bool completed = SocketPal.TryCompleteReceiveMessageFrom(context._socket, new Span<byte>(BufferPtr, Length), null, Flags, SocketAddress!, out int socketAddressLen, IsIPv4, IsIPv6, out BytesTransferred, out ReceivedFlags, out IPPacketInformation, out ErrorCode); 626bool completed = SocketPal.TryCompleteAccept(context._socket, SocketAddress, out int socketAddressLen, out AcceptedFileDescriptor, out ErrorCode); 657bool result = SocketPal.TryCompleteConnect(context._socket, out ErrorCode); 704SocketPal.TryCompleteSendFile(context._socket, FileHandle, ref Offset, ref Count, ref BytesTransferred, out ErrorCode); 1363throw new SocketException((int)SocketPal.GetSocketErrorForErrorCode(Interop.Sys.GetLastError())); 1456SocketPal.TryCompleteAccept(_socket, socketAddress, out socketAddressLen, out acceptedFd, out errorCode)) 1484SocketPal.TryCompleteAccept(_socket, socketAddress, out socketAddressLen, out acceptedFd, out errorCode)) 1522if (SocketPal.TryStartConnect(_socket, socketAddress, out errorCode) || 1555if (SocketPal.TryStartConnect(_socket, socketAddress, out errorCode, buffer.Span, false, out sentBytes)) // In Linux, we can figure it out as needed inside PAL. 1614(SocketPal.TryCompleteReceiveFrom(_socket, buffer.Span, flags, socketAddress.Span, out socketAddressLen, out bytesReceived, out receivedFlags, out errorCode) || 1645(SocketPal.TryCompleteReceiveFrom(_socket, buffer, flags, socketAddress.Span, out socketAddressLen, out bytesReceived, out receivedFlags, out errorCode) || 1678SocketPal.TryCompleteReceive(_socket, buffer.Span, flags, out bytesReceived, out errorCode)) 1710SocketPal.TryCompleteReceiveFrom(_socket, buffer.Span, flags, socketAddress.Span, out socketAddressLen, out bytesReceived, out receivedFlags, out errorCode)) 1759(SocketPal.TryCompleteReceiveFrom(_socket, buffers, flags, socketAddress.Span, out socketAddressLen, out bytesReceived, out receivedFlags, out errorCode) || 1788SocketPal.TryCompleteReceiveFrom(_socket, buffers, flags, socketAddress.Span, out socketAddressLen, out bytesReceived, out receivedFlags, out errorCode)) 1828(SocketPal.TryCompleteReceiveMessageFrom(_socket, buffer.Span, null, flags, socketAddress, out socketAddressLen, isIPv4, isIPv6, out bytesReceived, out receivedFlags, out ipPacketInformation, out errorCode) || 1865(SocketPal.TryCompleteReceiveMessageFrom(_socket, buffer, null, flags, socketAddress, out socketAddressLen, isIPv4, isIPv6, out bytesReceived, out receivedFlags, out ipPacketInformation, out errorCode) || 1901SocketPal.TryCompleteReceiveMessageFrom(_socket, buffer.Span, buffers, flags, socketAddress, out socketAddressLen, isIPv4, isIPv6, out bytesReceived, out receivedFlags, out ipPacketInformation, out errorCode)) 1957(SocketPal.TryCompleteSendTo(_socket, buffer, ref offset, ref count, flags, socketAddress.Span, ref bytesSent, out errorCode) || 1990(SocketPal.TryCompleteSendTo(_socket, buffer, null, ref bufferIndexIgnored, ref offset, ref count, flags, socketAddress.Span, ref bytesSent, out errorCode) || 2022SocketPal.TryCompleteSendTo(_socket, buffer.Span, ref offset, ref count, flags, socketAddress.Span, ref bytesSent, out errorCode)) 2070(SocketPal.TryCompleteSendTo(_socket, buffers, ref bufferIndex, ref offset, flags, socketAddress.Span, ref bytesSent, out errorCode) || 2102SocketPal.TryCompleteSendTo(_socket, buffers, ref bufferIndex, ref offset, flags, socketAddress.Span, ref bytesSent, out errorCode)) 2138(SocketPal.TryCompleteSendFile(_socket, fileHandle, ref offset, ref count, ref bytesSent, out errorCode) || 2166SocketPal.TryCompleteSendFile(_socket, fileHandle, ref offset, ref count, ref bytesSent, out errorCode))
System\Net\Sockets\SocketAsyncEventArgs.Unix.cs (3)
96SocketError socketError = SocketPal.Disconnect(socket, handle, _disconnectReuseSocket); 288_ = SocketPal.SendPacketsAsync(socket, SendPacketsFlags, elements, fileHandles, cancellationToken, (bytesTransferred, error) => 352SocketPal.CreateSocket(_acceptedFileDescriptor),