Mattraks Posted November 18, 2008 Share Posted November 18, 2008 (edited) Solved, close Edited November 19, 2008 by Mattraks Link to comment Share on other sites More sharing options...
SoulA Posted November 18, 2008 Share Posted November 18, 2008 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 More sharing options...
SoulA Posted November 18, 2008 Share Posted November 18, 2008 works fine for me Link to comment Share on other sites More sharing options...
SoulA Posted November 18, 2008 Share Posted November 18, 2008 I'm running on vista x64 and its working. Worked also on XP. Post the code... you are using perhaps. Are you passing the socket number to the function? Link to comment Share on other sites More sharing options...
ResNullius Posted November 19, 2008 Share Posted November 19, 2008 Solved, closeMattraks, 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now