I know that this point is really old, but I was looking at the same tutorial as you and getting the same error, I did a bit of googling and by pure luck I found out what the problem was.
It turns in C, errno returns a value of 0 if no error has occurred. To solve this was extremely simple:
It turns in C, errno returns a value of 0 if no error has occurred. To solve this was extremely simple:
def self.check
errno = Winsock.WSAGetLastError
if errno == 0
return
end
constName = Errno.constants.detect {|c| Errno.const_get(c).new.errno == errno }
if constName
raise Errno.const_get(constName)
else
raise "Unknown network error code: #{errno}"
end
end