Jump to content

SocketToIP() Gives Error


Recommended Posts

Ok so I've been working on my server and SocketToIP() is not found anywhere in the help file, except in the TCPRecv() function's help, and it was used in that to get the IP of the socket, but I've tried it and it doesn't work. AutoIt says that this function does not exist.

; Get IP of client connecting
Dim $szIP_Accepted = SocketToIP($ConnectedSocket)
Link to comment
Share on other sites

It's at the bottom of the example. You need to copy the function into your script if you want to use it.

Func SocketToIP($SHOCKET)
    Local $sockaddr = DLLStructCreate(&][ÝÜÚÜÝÚÜÝZ[ØÚÎI][ÝÊBØØ[  ÌÍØT][
    ][Ýw3%ó3"æFÆÂgV÷C²ÂgV÷C¶çBgV÷C²ÂgV÷C¶vWGVW&æÖRgV÷C²ÂgV÷C¶çBgV÷C²Âb3ÌØíM!=
-P°|(ÅÕ½ÐíÁÑÈÅÕ½Ðì±11MÑÉÕÑÑAÑÈ ÀÌØíͽ­È¤°uot;int_ptr",DLLStructGetSize($sockaddr))
    If Not @error And &ÌÍØT]ÌHH[    ÌÍØT][
    ][ÝÕÜÌÌÌ  ][ÝË  V÷C·7G"gV÷C²ÂgV÷C¶æWEöçFögV÷C²ÂgV÷C¶çBgV÷C²ÄDÄÅ7G'V7DvWDFFb33c·½­È°Ì¤¤(%9½ÐÉɽÈQ¡¸ÀÌØíIÐôÀÌØíIÑlÁt(±Í(       $aRet = 0
    EndIf

    $sockaddr = 0

    Return $a][[
Edited by Helge
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...