Jump to content

Close


Mattraks
 Share

Recommended Posts

Func SocketToIP($SHOCKET) ;gets ip of connected machine
    Local $sockaddr, $aRet

    $sockaddr = DllStructCreate("short;ushort;uint;char[8]")

    $aRet = DllCall("Ws2_32.dll", "int", "getpeername", "int", $SHOCKET, _
            "ptr", DllStructGetPtr($sockaddr), "int*", DllStructGetSize($sockaddr))
    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]
    Else
        $aRet = 0
    EndIf

    $sockaddr = 0

    Return $aRet
EndFunc   ;==>SocketToIP

Link to comment
Share on other sites

Solved, close

Mattraks,

Please do the rest of the forum a favour:

when you have an answer to your problem, stop editng your first post & topic title to something like "Close" or the several others you have that say "Delete".

Others searching the forum can't benefit from the solutions provided it they don't know what the original problem was.

Certainly you can edit the topic title and put [solved] or [Resolved] in front of the of the old title, but leave the original question or problem in your first post as is.

Thank you.

PS: I will also PM you a copy of this post in case you don't monitor your closed topics.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...