Sign in to follow this  
Followers 0
Ranmaru

SocketToIP() Gives Error

3 posts in this topic

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)

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

Ah I so missed that! Thanks. I assumed it was a built-in function. ^^


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  
Followers 0