Jump to content
Sign in to follow this  


Recommended Posts

Does anyone know how to detect the clients ip.

Lets say that you were the server and a client connected to your server. The client is unknow. Is there any function in autoit that alow you to see there port and port???

VB has a function where it is:



ANyone??? :whistle:;):P;):D

Share this post

Link to post
Share on other sites

Included in the example-code for TCPRecv :

Func SocketToIP($SHOCKET)
    Local $sockaddr = DLLStructCreate("short;ushort;uint;char[8]")

    Local $aRet = DLLCall("Ws2_32.dll","int","getpeername","int",$SHOCKET, _
    If Not @error And $aRet[0] = 0 Then
        $aRet = DLLCall("Ws2_32.dll","str","inet_ntoa","int",DLLStructGetData($sockaddr,3))
        If Not @error Then $aRet = $aRet[0]
        $aRet = 0

    $sockaddr = 0

    Return $aRet

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Create New...