Dion Posted July 22, 2018 Report Share Posted July 22, 2018 I've just converted a smallish VB6 winsock server program to VB 2017. It's successfully converted to AxMSWinsockLib, and after the usual minor changes to code (non associated with winsock), it compiles and runs, but winsock events don't seem to trigger. Netstat shows that the port is listening and I can see attempted connections from the client (which is still VB6). The sub definition lines (as created by mobilze) are: Private Sub Socket_ConnectionRequest(ByVal eventSender As Object, ByVal eventArgs As AxMSWinsockLib.DMSWinsockControlEvents_ConnectionRequestEvent) Handles _Socket_0.ConnectionRequest Private Sub Socket_DataArrival(ByVal eventSender As Object, ByVal eventArgs As AxMSWinsockLib.DMSWinsockControlEvents_DataArrivalEvent) Handles _Socket_0.DataArrival Private Sub Socket_CloseEvent(ByVal eventSender As Object, ByVal eventArgs As EventArgs) Handles _Socket_0.CloseEvent Anyone had similar issues? Is there something obvious I'm missing? Any other ideas? Do I just rewrite to System.Net.Sockets? Link to comment Share on other sites More sharing options...
Dion Posted July 22, 2018 Author Report Share Posted July 22, 2018 FYI - it has exactly the same issue if I convert to C# (there goes that idea). Link to comment Share on other sites More sharing options...
Mobilize.Net Staff OlmanQuesada Posted July 23, 2018 Mobilize.Net Staff Report Share Posted July 23, 2018 Hello Dion, Do you have a firewall that may be blocking connections attempts? You can try by implementing the winsock error event to trap error messages. My suggestion given you're now in .Net, replace the winsock by System.Net.Sockets. The communication between .Net and Interop/Activex components my be not as smoothly as expected, so using a pure .Net component could be the best option. Some guides about .Net sockets: https://docs.microsoft.com/en-us/dotnet/framework/network-programming/synchronous-client-socket-example https://docs.microsoft.com/en-us/dotnet/framework/network-programming/synchronous-server-socket-example Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now