You had the m_bInEncr flag incorrect thats why a DataArrival event never triggered for me.
Code:
If clsSocket.BytesReceived > 0 Then
'mWinSock.Subclass_ChangeOwner requestId, ObjPtr(Me) 'lol I tried to fix it
'RaiseEvent DataArrival(clsSocket.BytesReceived) 'lol I tried to fix it
clsSocket.RecoverData
End If
mWinSock.Subclass_ChangeOwner requestId, ObjPtr(Me)
If GetbSize(m_bRecvBuffer) > 0 Then
If m_blnEncr Then
RaiseEvent EncrDataArrival(GetbSize(m_bRecvBuffer))
Else
RaiseEvent DataArrival(GetbSize(m_bRecvBuffer))
End If
End If
you had
Code:
If clsSocket.BytesReceived > 0 Then
'mWinSock.Subclass_ChangeOwner requestId, ObjPtr(Me) 'lol I tried to fix it
'RaiseEvent DataArrival(clsSocket.BytesReceived) 'lol I tried to fix it
clsSocket.RecoverData
End If
mWinSock.Subclass_ChangeOwner requestId, ObjPtr(Me)
If GetbSize(m_bRecvBuffer) > 0 Then
If m_blnEncr Then
RaiseEvent DataArrival(GetbSize(m_bRecvBuffer))
Else
RaiseEvent EncrDataArrival(GetbSize(m_bRecvBuffer))
End If
End If
Bug 2, Replace all
Code:
m_bData
with
Code:
m_bRecvBuffer
I think I broke it i'm getting DataArrivals at 0 bytes. haha
Last edited by pkedpker; Mar 17th, 2020 at 07:23 AM.
hello, I found that the newsocket2.5 had a bug in mWinsock.bas.
please take a look,when I send some big data with the size > 65536,I found the send buf was incorect.
Code:
Public Function DeleteByte(bArray1() As Byte, ByVal lLen As Long) As Boolean
Dim lLen1 As Long
Dim bTmp() As Byte
lLen1 = GetbSize(bArray1)
If lLen1 > lLen Then
ReDim bTmp(lLen1 - lLen - 1)
CopyMemory bTmp(0), bArray1(lLen-1), lLen1 - lLen' should be CopyMemory bTmp(0), bArray1(lLen), lLen1 - lLen
End If
bArray1 = bTmp
End Function
hello, I found that the newsocket2.5 had a bug in mWinsock.bas.
please take a look,when I send some big data with the size > 65536,I found the send buf was incorect.
Hallo
Ich habe ein Problem bei NewSocket (bei NewSocket 2.5 ist es genau so)
Die Funktion GetIPFromHost benutzt die API GetAddrInfo.
Solange ich ein gültiger Name übergebe liefert der Server sehr schnell die richtige IP dazu.
Ist nun der Name aber dem Server nicht bekannt antwortet er nicht und die Funktion GetAddrinfo hat hier wirklich einen ewig langen Timeout den man leider nicht verstellen kann.
Es gibt alternativ die Funktion API gethostbyname diese hat das Timeout Problem nicht , bzw. er ist kurz genug die API kann aber leider nur IPV4. Ich brauche aber IPV4 und IPV6.
Wenn ich das richtig recherchiert habe, ist die einzige Abhilfe statt GetAddrinfo die API GetAddrnfoExA zu verwenden. Leider ist diese viel komplexer als die Getaddrinfo so das es mir nicht gelungen ist die Funktion GetIPFromHost entsprechend abzuändern . jemand eine Idee?
Hello
I have a problem with NewSocket (same with NewSocket 2.5)
The GetIPFromHost function uses the GetAddrInfo API.
As long as I pass a valid name, the server supplies the correct IP very quickly.
If the name is not known to the server, it does not respond and the GetAddrinfo function really has an extremely long timeout here, which unfortunately cannot be changed.
Alternatively, there is the function API gethostbyname, this does not have the timeout problem, or it is short enough, but unfortunately the API can only do IPV4. But I need IPV4 and IPV6.
If I researched this correctly, the only workaround is to use the GetAddrnfoExA API instead of GetAddrinfo. Unfortunately, this is much more complex than Getaddrinfo, so I didn't manage to change the GetIPFromHost function accordingly. someone an idea?
Hello
I have a problem with NewSocket (same with NewSocket 2.5)
The GetIPFromHost function uses the GetAddrInfo API.
As long as I pass a valid name, the server supplies the correct IP very quickly.
If the name is not known to the server, it does not respond and the GetAddrinfo function really has an extremely long timeout here, which unfortunately cannot be changed.
Alternatively, there is the function API gethostbyname, this does not have the timeout problem, or it is short enough, but unfortunately the API can only do IPV4. But I need IPV4 and IPV6.
If I researched this correctly, the only workaround is to use the GetAddrnfoExA API instead of GetAddrinfo. Unfortunately, this is much more complex than Getaddrinfo, so I didn't manage to change the GetIPFromHost function accordingly. someone an idea?
Besides the fact that NewSocket has long ago been replaced by SimpleSock/SimpleServer and is no longer supported, anything that requires a DNS response is going to take a long time to respond to an invalid request. The default is 15 seconds for each DNS server you have configured. The way around that is to implement your own timeout timer.