私も詳しくはないので間違っていたら申し訳ないのですが、
以下のモジュールをincludeしてみてください。
>mod_showWsLastError.as
#ifndef showWsLastError
#include "kernel32.as"
#module
#ifndef WSAGetLastError
#uselib "ws2_32.dll"
#func WSAGetLastError "WSAGetLastError"
#endif
#ifndef FORMAT_MESSAGE_ALLOCATE_BUFFER
#const FORMAT_MESSAGE_ALLOCATE_BUFFER $100
#endif
#ifndef FORMAT_MESSAGE_FROM_SYSTEM
#const FORMAT_MESSAGE_FROM_SYSTEM $1000
#endif
#ifndef FORMAT_MESSAGE_IGNORE_INSERTS
#const FORMAT_MESSAGE_IGNORE_INSERTS $200
#endif
#ifndef MAKELANGID
#define ctype MAKELANGID(%1,%2) (%2<<10|%1)
#endif
#ifndef LANG_NEUTRAL
#const LANG_NEUTRAL $0
#endif
#ifndef SUBLANG_DEFAULT
#const SUBLANG_DEFAULT $1
#endif
#deffunc showWsLastError local _errCode,local _lpBuffer,local _errMsg
_errCode=WSAGetLastError()
FormatMessage FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS,0,_errCode,MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT),varptr(_lpBuffer),0,0
dupptr _errMsg,_lpBuffer,stat+1,2
dialog strf("%sCode: %d",_errMsg,_errCode),1,"Error"
LocalFree _lpBuffer
return
#global
#endif
その上で、エラーが発生した箇所でshowWsLastError命令を呼び出せば、
エラーの具体的な原因が表示されるかと思います。
#include "hspsock.as"
#include "mod_showWsLastError.as"
sockopen 0,"サーバーURL",110
if stat {
showWsLastError
end
}
より詳細な説明はこちらで確認できるので、解決の参考にしてください。
https://learn.microsoft.com/en-us/windows/win32/winsock/windows-sockets-error-codes-2