wqweto / VbAsyncSocket

Sockets with pure VB6 impl of TLS encryption
MIT License
166 stars 33 forks source link

cTlsSocket does not fire OnConnect #13

Open MindChild opened 3 years ago

MindChild commented 3 years ago

cTlsSocket does not fire OnConnect when connected, however the underlying class cAsyncSocket does fire OnConnect. The encapsulating cTlsSocket isn't completely ready at that moment, so it can't be used as an indicator.

This is using mdTlsThunks. mdTlsNative doesn't appear to work at all. I will make another issue report for it

wqweto commented 3 years ago

Can you open test\Secure\Project1.vbp project and place a breakpoint on m_oSocket_OnConnect in Form2 to confirm it's not being raised?

Btw this works for me with all backends

Option Explicit

Private WithEvents m_oSocket As cTlsSocket

Private Sub Form_Load()
    Set m_oSocket = New cTlsSocket
    m_oSocket.Connect "www.google.com", 443
End Sub

Private Sub m_oSocket_OnConnect()
    Debug.Print "m_oSocket_OnConnect", m_oSocket.RemoteHostName, Timer
End Sub