Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

Fast multi-client TCP server

tcp server

  • Please log in to reply
38 replies to this topic

#21 Kealper

Kealper

    Wayfarer

  • Active Members
  • Pip
  • 90 posts

Posted 26 July 2012 - 01:43 AM

Yes, it probably could if it was implemented correctly, I have used this for quite a few projects myself.

EDIT: Spelling.

Edited by Kealper, 26 July 2012 - 03:42 AM.

Posted Image







#22 Attckdog

Attckdog

    Wayfarer

  • Active Members
  • Pip
  • 84 posts

Posted 26 July 2012 - 02:02 AM

Yes, it probably could if it was implemented correctly, I have used this for quotes few projects myself.


Cool thanks for the quick reply I'll test it out and report back if I come up with any problems. :bye:
A true renaissance man

#23 Shinies

Shinies

    Adventurer

  • Active Members
  • PipPip
  • 100 posts

Posted 23 August 2012 - 03:08 AM

Great work, i was looking for exactly something like this.

Your comments made it a billion times easier to understand whats needs to be done in a script of this nature!

#24 Kealper

Kealper

    Wayfarer

  • Active Members
  • Pip
  • 90 posts

Posted 23 August 2012 - 04:25 AM

Great work, i was looking for exactly something like this.

Your comments made it a billion times easier to understand whats needs to be done in a script of this nature!

Thanks, glad to hear it's as useful to other as it is to me!

PS: This bit of code shown below can be ignored/removed, it was some debug code that sneaked in to one of the changes I had made, and it seems I forgot to remove it before posting the updated version! >_<

All this did is just show the total number of clients currently connected every second in the console, nothing direly important or code-breaking if removed.
AdlibRegister("asdf", 1000) Func asdf() ConsoleWrite($Clients[0][0] & @CRLF) EndFunc

Edited by Kealper, 23 August 2012 - 04:25 AM.

Posted Image

#25 Shinies

Shinies

    Adventurer

  • Active Members
  • PipPip
  • 100 posts

Posted 07 September 2012 - 10:03 AM

Thanks, glad to hear it's as useful to other as it is to me!

PS: This bit of code shown below can be ignored/removed, it was some debug code that sneaked in to one of the changes I had made, and it seems I forgot to remove it before posting the updated version! >_<

All this did is just show the total number of clients currently connected every second in the console, nothing direly important or code-breaking if removed.

AdlibRegister("asdf", 1000) Func asdf() ConsoleWrite($Clients[0][0] & @CRLF) EndFunc

Figured that was the case.. have been using it to debug also :P

#26 Kealper

Kealper

    Wayfarer

  • Active Members
  • Pip
  • 90 posts

Posted 17 September 2012 - 04:39 AM

I've just made some more changes to it, this time to increase efficiency when large (over 1,000) active clients are connected and one or more clients disconnects. Turns out in this case that it is up to 500x faster, on my computer at least, to build a copy of the original array without the sub-elements you don't want and then overwrite the old array with the new copy than it is to use ReDim to re-size the one array. I would have figured the latter would have been much more efficient, but it seems there are always curve-balls in the game of programming.

I've changed the original Sleep(1) call in the main loop to a custom sleep function (credit goes to monoceres for the basics behind that function) which takes delays in microseconds instead of milliseconds, because it turns out the lower-level function AutoIt's Sleep wraps appears to only be able to go down to ~10ms, so there was a decent gain in response time just by switching that over. I've got it set to 5000us (5ms) sleep delay in the example, but you can safely go down to 1000us (1ms) without much of a resource-usage hike, from my testing that is; Anything lower than 1000us doesn't seem to give much more of a performance increase, so diminishing returns, etc...

I also corrected some more spelling (again... :( ), tweaked the little example echo server code in that base to better demonstrate my choice of why that line dealing with pulling packets from the buffer that many have said was incorrect is actually exactly how I intended it to function. :)
Posted Image

#27 Krsta

Krsta

    Seeker

  • Normal Members
  • 2 posts

Posted 29 October 2012 - 05:20 PM

Kealper: Thank you for the Idea. I'm refactored your code a bit:

AutoIt         
#cs ---------------------------------------------------------------------------- Fast TCP Server Author: Petr Krstev Based on "Fast multi-client TCP server" by Ken Piper #ce ---------------------------------------------------------------------------- TCPStartup() Opt("TCPTimeout", 0) #region ;Safe-to-edit things are below Global $BindIP = "0.0.0.0" ;Listen on all addresses Global $BindPort = 8080 ;Listen on port 8080 Global $Timeout = 15000 ;Max idle time is 15 seconds before calling a connection "dead" Global $PacketSize = 2048 ;Max packet size per-check is 2KB Global $MaxClients = 50 ;Max simultaneous clients is 50 #endregion ;Stuff you shouldn't touch is below Global $Listen Global $Socket[$MaxClients] ; Rows of data Global $RemoteIP[$MaxClients] ; Rows of data Global $TimeStamp[$MaxClients] ; Rows of data Global $Buffer[$MaxClients] ; Rows of data Global $Stack[$MaxClients+2] ; Stack to hold numbers of the free rows of data Global $SP = 0 Global $Ws2_32 = DllOpen("Ws2_32.dll") ;Open Ws2_32.dll, it might get used a lot Global $NTDLL = DllOpen("ntdll.dll") ;Open ntdll.dll, it WILL get used a lot Global $CleanupTimer = TimerInit() ;This is used to time when things should be cleaned up Global $NeedExit = False PreloadStack() OnAutoItExitRegister("Close") ;Register this function to be called if the server needs to exit $Listen = TCPListen($BindIP, $BindPort) ;Start listening on the given IP/port If @error Then Exit 1 ;Exit with return code 1 if something was already bound to that IP and port While 1 if $NeedExit Then ExitLoop ;Exit demanded from client USleep(5000, $NTDLL) ;This is needed because TCPTimeout is disabled. Without this it will run one core at ~100%. ;The USleep function takes MICROseconds, not milliseconds, so 1000 = 1ms delay. ;When working with this granularity, you have to take in to account the time it takes to complete USleep(). ;1000us (1ms) is about as fast as this should be set. If you need more performance, set this from 5000 to 1000, ;but doing so will make it consume a bit more CPU time to get that extra bit of performance. Check() ;Check recv buffers... DoIt() ; ...and do things If TimerDiff($CleanupTimer) > 1000 Then ;If it has been more than 1000ms since Cleanup() was last called, call it now $CleanupTimer = TimerInit() ;Reset $CleanupTimer, so it is ready to be called again Cleanup() ;Clean up the dead connections EndIf Local $iSock = TCPAccept($Listen) ;See if anything wants to connect If $iSock = -1 Then ContinueLoop ;If nothing wants to connect, restart at the top of the loop If $SP = 0 Then ;If $SP = 0 then the max connection limit has been reached TCPCloseSocket($iSock) ;It has been reached, close the new connection and continue back at the top of the loop ContinueLoop EndIf Local $FreeSock = Pop() ;Get the next free row in data $Socket[$FreeSock] = $iSock ;Set the socket ID of the connection $RemoteIP[$FreeSock] = SocketToIP($iSock, $Ws2_32) ;Set the IP Address the connection is from $TimeStamp[$FreeSock] = TimerInit() ;Set the timestamp for the last known activity timer $Buffer[$FreeSock] = "" ;Blank the recv buffer WEnd Func Check() ;for incoming data If $SP >= $MaxClients Then Return ;If there are no clients connected, stop the function right now For $i = 0 To $MaxClients-1 ;Loop through all rows If $Socket[$i] > 0 Then ;valid socket in the row Local $sRecv = TCPRecv($Socket[$i], $PacketSize) ;Read $PacketSize bytes from the current client's TCP buffer If $sRecv <> "" Then ;If there was data sent from the client $Buffer[$i] &= $sRecv ;add it to the buffer $TimeStamp[$i] = TimerInit() ;update the activity timer EndIf EndIf Next EndFunc Func DoIt() ;Processing incoming data For $i = 0 To $MaxClients-1 ;Loop through all rows If $Buffer[$i] <> "" Then ;Data buffer in the row is not empty #region ;Example data processing stuff here. This is handling for a simple "echo" server with line handling Local $sLine = StringSplit($Buffer[$i], @CRLF, 1) ;Split up the data in to an array,... For $j = 1 To $sLine[0]-1 ; ...so it is easy to loop through each line If $sLine[$j] = "terminate" Then $NeedExit = True ;Client want terminate the server itself (not just connection) TCPSend($Socket[$i], "Echoing line: '" & $sLine[$j] & "'" & @CRLF) ;Echo back the line the client sent Next $Buffer[$i] = $sLine[$sLine[0]] ;Put last incomplete line back in the buffer #endregion ;Example EndIf Next EndFunc Func Cleanup() ;Clean up any disconnected clients to regain resources If $SP >= $MaxClients Then Return ;If no clients are connected then return For $i = 0 To $MaxClients-1 ;Loop through all rows If $Socket[$i] > 0 Then ;valid socket in the row $Buffer[$i] &= TCPRecv($Socket[$i], $PacketSize) ;Dump any data not-yet-seen in to their recv buffer If @error Or TimerDiff($TimeStamp[$i]) > $Timeout Then ;Check to see if the connection has been inactive for a while or if there was an error TCPCloseSocket($Socket[$i]) ;If yes, close the connection $Socket[$i] = -1 ;Set the socket ID to an invalid socket Push($i) ;Free this row EndIf EndIf Next EndFunc Func Close() DllClose($Ws2_32) ;Close the open handle to Ws2_32.dll DllClose($NTDLL) ;Close the open handle to ntdll.dll For $i = 0 To $MaxClients-1 ;Loop through all rows If $Socket[$i] > 0 Then TCPCloseSocket($Socket[$i]) ;Force the client's connection closed Next TCPCloseSocket($Listen) ;Force the server's binded connection closed TCPShutdown() ;Shut down networking stuff ; MsgBox(0,"","!",1) EndFunc Func SocketToIP($iSock, $hDLL = "Ws2_32.dll") ;A rewrite of that _SocketToIP function that has been floating around for ages Local $structName = DllStructCreate("short;ushort;uint;char[8]") Local $sRet = DllCall($hDLL, "int", "getpeername", "int", $iSock, "ptr", DllStructGetPtr($structName), "int*", DllStructGetSize($structName)) If Not @error Then $sRet = DllCall($hDLL, "str", "inet_ntoa", "int", DllStructGetData($structName, 3)) If Not @error Then Return $sRet[0] EndIf Return "0.0.0.0" ;Something went wrong, return an invalid IP EndFunc Func USleep($iUsec, $hDLL = "ntdll.dll") ;A rewrite of the _HighPrecisionSleep function made by monoceres (Thanks!) Local $hStruct = DllStructCreate("int64") DllStructSetData($hStruct, 1, -1 * ($iUsec * 10)) DllCall($hDLL, "dword", "ZwDelayExecution", "int", 0, "ptr", DllStructGetPtr($hStruct)) EndFunc Func PreloadStack() Local $i For $i = 0 to $MaxClients-1 Push($i) Next EndFunc Func Push($Value) if $SP < $MaxClients Then $Stack[$SP] = $Value $SP += 1 Return 1 Else Return 0 EndIf EndFunc Func Pop() if $SP > 0 Then $SP -= 1 Return $Stack[$SP] Else Return -1 EndIf EndFunc


My changes:
A/ using 4 1D flat arrays instead of 2D array. Each 1D array represents one column in DB/table holds same type of data. Same Index = same connection.
B/ using a "Stack" data structure for information about unused rows in the DB/table.
C/ dividing the Func "Check" into 2 Funcs: "Check" and "DoIt". One for Checking up for a new data, second for a processing new data.
D/ The Func "DoIt" have another type of line parsing. More simple with the possibily to invoke server termination from client.
E/ The Func "CleanUp" stay for socket disconnection and Timeout detection and lost the massive changes on the 2D array. Just push the free socket index on the Stack.
F/ The Func "Close" - added closing of listen socket too.
G/ There is 3 new Funcs: Push, Pop, PreloadStack. Push and Pop classical Stack working (LiFo data structure). PreloadStack pushes all the free indexes in the stack.

Krst'a

#28 caleb41610

caleb41610

    Adventurer

  • Active Members
  • PipPip
  • 139 posts

Posted 29 October 2012 - 11:06 PM

Test: create 1000 connections, then disconnect all connections.

Script on the first page: 90 seconds
Krsta's script: 94 seconds
my script: 16 seconds (14 sec without creating/deleting list view items.)

This is my implementation: http://www.autoitscript.com/forum/topic/145220-multiple-connection-tcp-server/

This is the code I used to test the time: (i just changed the ports on your scripts to 1337, and max connections to 1000)
AutoIt         
TCPStartup() Global Const $number_of_connections = 1000 ; Total number of connections to perform Global Const $ip = @IPAddress1 ; IP address Global Const $port = 1337 ; Port Global $connection_array[$number_of_connections + 1] $errors = 0 $timer = TimerInit() For $i = 1 To $number_of_connections $connection_array[$i] = TCPConnect($ip, $port) If @error Then $errors += 1 EndIf Next MsgBox(0, "", $errors & " errors" & @CRLF & $number_of_connections & " connections in " & Round(TimerDIff($timer) / 1000) & " seconds.") $timer = TimerInit() For $i = 1 To $number_of_connections TCPCloseSocket($connection_array[$i]) If @error Then $errors += 1 EndIf Next MsgBox(0, "", $errors & " errors" & @CRLF & $number_of_connections & " disconnects in " & Round(TimerDIff($timer) / 1000) & " seconds.") $timer = TimerInit() TCPShutdown()

Edited by caleb41610, 29 October 2012 - 11:55 PM.


#29 Krsta

Krsta

    Seeker

  • Normal Members
  • 2 posts

Posted 01 November 2012 - 08:43 PM

caleb41610: Thank you for pointing out performance-related problem. It is always important.

Tests that I did proved similar results. After 6 hours of unsuccessful experiments, I was very desperate.
Finally I found why the results are so different. All that magic is in command "TCPListen" where we (Me and Kealper too) use default value for the third parameter.
I get similar results to yours (without list items stuf), when I change my script (and Kealper too) like this:

$Listen = TCPListen($BindIP, $BindPort, $MaxClients) ;Start listening on the given IP/port

Finally, I made some additional changes to my script (see attachment) and now the result time is about 5s and there is still room to do further optimizations.

Thank you once more and Good luck
Petr

Test: create 1000 connections, then disconnect all connections.

Script on the first page: 90 seconds
Krsta's script: 94 seconds
my script: 16 seconds (14 sec without creating/deleting list view items.)

This is my implementation: http://www.autoitscript.com/forum/topic/145220-multiple-connection-tcp-server/

This is the code I used to test the time: (i just changed the ports on your scripts to 1337, and max connections to 1000)

Attached Files

  • Attached File  ST.au3   7.21KB   140 downloads


#30 caleb41610

caleb41610

    Adventurer

  • Active Members
  • PipPip
  • 139 posts

Posted 02 November 2012 - 09:15 AM

Glad it helped. i may fix mine some day soon.

#31 Kealper

Kealper

    Wayfarer

  • Active Members
  • Pip
  • 90 posts

Posted 15 December 2012 - 10:41 AM

Hmm.. Seems one of the forum updates or something cleared the followers list, so I wasn't getting notifications of people posting here or I would have responded sooner...

I didn't even catch that I didn't have the third parameter in this on the post or my local copy of that code... I have it in any of the stuff I do, it must have just slipped my mind to add it to the base while I was working on it, sorry about that!

Using caleb41610's test script, on the code in the original post (after correcting that simple mistake!) will do 1000 connections in 10 seconds, where as Krsta's final code will do 1000 connections in 5 seconds... The reason for this is how accepting connections is handled. Mine makes processing client data a priority by always checking if any clients have sent something before checking the new connection queue and getting new clients in, where as Krsta's makes accepting new clients a priority, by only checking current client data when no new connections are queued. If I change mine around a bit and make it so it only calls Check() when $iSock = -1, I see similar performance, down to 1000 clients in 5 seconds (mine has rounded up to 6 seconds a few times, so its average is slightly slower than Krsta's). If I had to guess, mine is still slower because it uses a dynamic array size for the main client array instead of Krsta's fixed array size, but for the things I do with this code the slight performance hit it incurs is worth the benefit of a flexible max client limit. So it seems mine is still being bit in the butt by overhead in ReDim, and since Krsta isn't using ReDim, no butt-biting goes on there. This has shown me what a difference it can make to switch to fixed-size for the clients array if I ever have a need for a client that can accept connections more consistently though.

Also I chose to do the dynamically re-sized 2d array for simplicity's sake, and for more flexibility, as max clients can be adjusted on-the-fly without requiring a restart (by just changing $MaxClients), and it would be much less work while developing off of this (as it was intended) to change a 2d array than it would be to create another 1d array, in my personal opinion.

(Updated first post with the quick-fix I overlooked before)

EDIT: I should also point out another down-side I hadn't thought of while initially writing this... With a fixed-size array, it tears through CPU cycles walking through the entire array each time, even if there isn't many clients connected. So if you've got it set to 10,000 total connections, it will have to walk through those 10,000 elements each time.
With a dynamically-sized array, the number of elements will always only be the number of active clients, so if the limit is 10,000 but there are only 10 clients connected, the array will only be around 10 elements large(11 if you use one as an index). Just thought I'd throw that out there too for a bit more understanding of why I made things the way I did.

Edited by Kealper, 15 December 2012 - 11:16 AM.

Posted Image

#32 vuxat

vuxat

    Seeker

  • New Members
  • 1 posts

Posted 03 May 2013 - 12:48 PM

ahoy

i have taken the liberty to transcribe a part of your code into a usable function
acts partly like adlibregister but does only check and run on call (so it does not interrupt current processes)

original code:

If TimerDiff($CleanupTimer) > 1000 Then ;If it has been more than 1000ms since Cleanup() was last called, call it now         $CleanupTimer = TimerInit() ;Reset $CleanupTimer, so it is ready to be called again         Cleanup() ;Clean up the dead connections     EndIf


my function:

Func _starttimer($sttimr = 'Cleanup', $sttimrdiff = 1000)     $sttimrn = $sttimr & 'Timer'     If IsDeclared($sttimrn) = 0 Then Assign($sttimrn, _Timer_Init(), 2)     If TimerDiff(Eval($sttimrn)) > $sttimrdiff Then         Assign($sttimrn, TimerInit())         Return Execute($sttimr & '()')     EndIf EndFunc


you can call it like this in your loop and it will start the given function after X msec
_starttimer('Cleanup', 1000)

best regards,
stefan

#33 Jimtags

Jimtags

    Seeker

  • Active Members
  • 9 posts

Posted 21 April 2014 - 09:05 AM

Since I'm using this tcp server script..
Here's some good additional, A packet dynamic encryption :D

Func PacketEnc($EncData, $EncKey)     $EncOut = ''     $EncOut_Tmp1 = Random(111111,999999,1)     $EncOut_Tmp2 = _Crypt_EncryptData($EncData ,$EncKey, $CALG_AES_256)     $EncOut_Tmp3 = BinaryToString($EncOut_Tmp2)     $EncOut_Tmp4 = _StringEncrypt(1, $EncOut_Tmp3, $EncOut_Tmp1)     $EncOut = _HexToString($EncOut_Tmp1&$EncOut_Tmp4)     Return $EncOut EndFunc Func PacketDec($DecData, $DecKey)     $DecOut = ''     $DecOut_Tmp1 = _StringToHex($DecData)     $DecOut_Tmp2 = StringMid($DecOut_Tmp1, 1, 6)     $DecOut_Tmp3 = StringTrimLeft($DecOut_Tmp1, 6)     $DecOut_Tmp4 = StringToBinary(_StringEncrypt(0, $DecOut_Tmp3, $DecOut_Tmp2))     $DecOut_Tmp5 = _Crypt_DecryptData($DecOut_Tmp4 ,$DecKey, $CALG_AES_256)     $DecOut = _HexToString($DecOut_Tmp5)     Return $DecOut EndFunc


#34 guinness

guinness

    I've a handle on the fiction

  • Developers
  • 15,709 posts

Posted 21 April 2014 - 09:30 AM

_StringEncrypt() is deprecated in the latest version of AutoIt.


Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUISetIcon()_Icon_Clear()/_Icon_Set()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingFileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIGetBkColor()LockFile()PasswordValidPasteBinPosts Per DayPreExpandQueue()SciTE JumpSHELLHOOKShunting-YardSignature CreatorStack()StringAddLF()/StringStripLF()StringEOLToCRLF()WM_COPYDATAMore Examples...
Updated: 12/04/2014


#35 Jimtags

Jimtags

    Seeker

  • Active Members
  • 9 posts

Posted 21 April 2014 - 05:21 PM

_StringEncrypt() is deprecated in the latest version of AutoIt.

 

But still usable.. anyway that's just a example for how to make the packet not static.. It can help someone maybe :D



#36 guinness

guinness

    I've a handle on the fiction

  • Developers
  • 15,709 posts

Posted 21 April 2014 - 05:29 PM

But still usable.. anyway that's just a example for how to make the packet not static.. It can help someone maybe :D

I should have removed it when it was deprecated, but I was being too nice for those who needed time to upgrade their scripts (don't I regret that decision now). You're welcome to use outdated code in your own scripts, just don't let you bad habits leak onto the Forums in the future please.

To all,

I provided an alternative StringEncrypt() in _Crypt_EncryptData(), though it's not backwards compatible with _StringEncrypt().
  • Jimtags likes this

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUISetIcon()_Icon_Clear()/_Icon_Set()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingFileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIGetBkColor()LockFile()PasswordValidPasteBinPosts Per DayPreExpandQueue()SciTE JumpSHELLHOOKShunting-YardSignature CreatorStack()StringAddLF()/StringStripLF()StringEOLToCRLF()WM_COPYDATAMore Examples...
Updated: 12/04/2014


#37 jchd

jchd

    Whatever your capacity, resistance is futile.

  • MVPs
  • 4,570 posts

Posted 21 April 2014 - 10:58 PM

To add horror to what guinness said, old _StringEncrypt() is less reliable and robust than ROT13.

 

Edit: made clear I was talking about the legacy version.


Edited by jchd, 22 April 2014 - 07:24 AM.

SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!

SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)

An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work

 

PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

RegExp tutorial: enough to get started

Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here


#38 guinness

guinness

    I've a handle on the fiction

  • Developers
  • 15,709 posts

Posted 22 April 2014 - 06:52 AM

To add horror to what guinness said, StringEncrypt() is less reliable and robust than ROT13.

I guess you meant the old version? Yeah I second that, even ROT5 is more secure than that old function.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUISetIcon()_Icon_Clear()/_Icon_Set()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingFileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIGetBkColor()LockFile()PasswordValidPasteBinPosts Per DayPreExpandQueue()SciTE JumpSHELLHOOKShunting-YardSignature CreatorStack()StringAddLF()/StringStripLF()StringEOLToCRLF()WM_COPYDATAMore Examples...
Updated: 12/04/2014


#39 jchd

jchd

    Whatever your capacity, resistance is futile.

  • MVPs
  • 4,570 posts

Posted 22 April 2014 - 07:24 AM

Exactly. Post edited for clarity.


SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!

SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)

An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work

 

PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

RegExp tutorial: enough to get started

Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here






Also tagged with one or more of these keywords: tcp, server

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users