Hi i am writing a socket client/server application in VB6.
i have the following code
Private Sub sockMain_ConnectionRequest(ByVal requestID As Long)
If sockMain.State <> sckClosed Then
sockMain.Close
End If
sockMain.Accept requestID
Debug.Print "Accepted connection from: " & sockMain.RemoteHostIP & vbCrLf
End Sub
its printing the IP but the last digit is missing example, if my connection is from “192.168.1.123” then it shows “192.168.1.12” only
I’ve tried the exact same code and it works on my machine. I tried using telnet from the same machine, and also from a laptop and the correct IP address was printed in both cases.
I have to agree with ckv and say that its the way you are printing
RemoteHostIP.