dnsi Posted October 22, 2006 Share Posted October 22, 2006 Does anyone know how to detect the clients ip. Lets say that you were the server and a client connected to your server. The client is unknow. Is there any function in autoit that alow you to see there port and port??? VB has a function where it is: Winsockcontrol.remoteHostIP Winsockcontrol.remotePort ANyone??? My Programs:Flip-Flop File Encryption SysyemMULTIPLAYER-SOCKETSERVERHide An Archive In A Picture Link to comment Share on other sites More sharing options...
Helge Posted October 23, 2006 Share Posted October 23, 2006 Included in the example-code for TCPRecv : 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 Link to comment Share on other sites More sharing options...
dnsi Posted October 24, 2006 Author Share Posted October 24, 2006 Thanks Man My Programs:Flip-Flop File Encryption SysyemMULTIPLAYER-SOCKETSERVERHide An Archive In A Picture 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