Regarding to the post you edited
sockaddr.sin_addr = 66
sockaddr.sin_addr = 66 ' this just overides the previous 66, therefore you end up with 66 in the end, not "66.66.66.66"...
I did not test it, but I think this is the API that converts from string address to a Long
EDIT, Here's the MSDN help for it MSDN - inet_addrVB Code:
Public Declare Function inet_addr Lib "ws2_32.dll" (ByVal cp As String) As Long
You have to use it like:
VB Code:
Dim server As sockaddr server.sin_addr = inet_addr("66.66.66.66") If (Connect(MySocket, server, Len(server))) = SOCKET_ERROR Then '... the rest of the code





Reply With Quote