You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
William on the discord server has issues with creating sockets following the documentation:
Before we create a socket, we define a TAddrInfo object to provide hints for the kind of socket we want to create. This is the modern way to handle sockets, and it simplifies a lot of the coding we'll need to do when dealing with them.
Local hints:TAddrInfo = New TAddrInfo(AF_INET_, SOCK_STREAM_)
The first argument AF_INET_ requests that the socket use the IPv4 protocol. For IPv6 you can use AF_INET6_, and if you don't care which protocol to use, you can use AF_UNSPEC_, which will allow you to use either.
Local hints:TAddrInfo=NewTAddrInfo(AF_UNSPEC_, SOCK_STREAM_) ' socket objectLocal socket:TSocket= TSocket.Create(hints) ' actual socketIfNot socket Then
Print "Unable to create socket."
End
End If
I extended it to get the params in use - and then pass these values directly into socket_().
When passing 0 for the family-param, the socketID is -1.
Now I checked what the socket() docs say:
Linux: https://man7.org/linux/man-pages/man2/socket.2.html
There is no mention of some "use whatever is possible". (sys/socket.h defines it but yeah, no "autonegotiation" or so)
William on the discord server has issues with creating sockets following the documentation:
Source: https://blitzmax.org/docs/en/tutorials/network_programming/#creating-a-socket
His testcode is this one:
I extended it to get the params in use - and then pass these values directly into
socket_()
.When passing 0 for the family-param, the socketID is -1.
Now I checked what the
socket()
docs say:Linux: https://man7.org/linux/man-pages/man2/socket.2.html
There is no mention of some "use whatever is possible". (sys/socket.h defines it but yeah, no "autonegotiation" or so)
On Windows they strongly disencourage the usage of unspec:
https://learn.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-socket#remarks
They also tell to use the IPv6 one:
on Solaris they say the IPv6 one would use IPv4 or IPv6 (so also not the unspec one):
https://docs.oracle.com/cd/E19120-01/open.solaris/817-4415/6mjum5som/index.html
Tried to print the "errno"-value but pub.stdc defines a
errno_()
which seems to be incorrect - raising an extra issue for it.The text was updated successfully, but these errors were encountered: