acidfear Posted October 4, 2007 Share Posted October 4, 2007 I'm using tcp listen on a port to detect any incoming connections on that port. Is it possible to get the IP of that connection instead of a socket? Link to comment Share on other sites More sharing options...
piccaso Posted October 4, 2007 Share Posted October 4, 2007 You can get the ip adress from the socket. this is from the helpfile: Func SocketToIP($SHOCKET) Local $sockaddr = DLLStructCreate("short;ushort;uint;char[8]") Local $aRet = DLLCall("Ws2_32.dll","int","getpeername","int",$SHOCKET, _ "ptr",DLLStructGetPtr($sockaddr),"int_ptr",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 CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map Link to comment Share on other sites More sharing options...
acidfear Posted October 4, 2007 Author Share Posted October 4, 2007 I must have skipped over it when I looked through the help file. Thanks a lot. It's been a while since I've messed with autoit but It's hooked me back Link to comment Share on other sites More sharing options...
jaenster Posted October 4, 2007 Share Posted October 4, 2007 I must have skipped over it when I looked through the help file. Thanks a lot. It's been a while since I've messed with autoit but It's hooked me back It search it also always again.. But a year ago i mailed it to myself ^^ -jaenster 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