module ServerEngine::WinSock

Constants

INVALID_SOCKET
SockaddrIn
WSAPROTOCOL_INFO

Public Class Methods

last_error() click to toggle source
# File lib/serverengine/winsock.rb, line 82
def self.last_error
  # On Ruby 3.0 calling WSAGetLastError here can't retrieve correct error
  # code because Ruby's internal code resets it.
  # See also:
  # * https://github.com/ruby/fiddle/issues/72
  # * https://bugs.ruby-lang.org/issues/17813
  if Fiddle.respond_to?(:win32_last_socket_error)
    Fiddle.win32_last_socket_error || 0
  else
    self.WSAGetLastError
  end
end