13 posts in this topic
WSA_NBTCP.au3 (Windows Sockets API - Non-Blocking Transmission Control Protocol)
This is an accumulation of WSA code from many sources and modified to suit myself.
These functions have been thoroughly tested using a Local Proxy Server, which
is about the most strenuous test you can use.
Includes my rendition of how a TCPRecv Timeout should work. Also includes a
timewait/timeout using Select for TCP Send, which works great for that function.
You will need a loop to use _WSA_TCPRecv(). An example will be forthcoming in a second post.
- AutoIt Versions: 18.104.22.168 thru 22.214.171.124 (32Bit only).
- TCPStartup() at beginning of script on startup.
- TCPShutDown() and _WSA_Cleanup() on exit.
Download UDF: WSA_NBTCP.au3
I have SQLite setup within my AutoIT program...I'm trying to accomplish what should be a relatively simple task. I want to be able to return an array of 'table' names for an established database...I believe this might be possible using the '_SQLite_SQLiteExe' command...since it seems to be able to access SQLite schemas...? The ".tables" command is one of them...if I am not mistaken that command returns a list of all table names in the active database.
I am attempting the following:
#include <SQLite.au3> #include <SQLite.dll.au3> Global $hDb, $sIn, $sOut ... $sIn = ".tables" & @CRLF _SQLite_SQLiteExe($hDb, $sIn, $sOut) if @error == 0 Then ;Show Table (using SQLite3.dll) Else if @error == 2 Then ConsoleWrite("ERROR: Sqlite3.exe file not found" & @CRLF) Else ConsoleWrite("ERROR: @error=" & @error & " when calling _SQLite_SQLiteExe" & @CRLF) EndIf ;@error is "2"...OR NOT... EndIf ;@error is "0"...OR NOT... ... The error being thrown is "ERROR: Sqlite3.exe file not found" ...
Am I required to have the Sqlite3.exe installed in my directory (i.e. @ScriptsDir)...??? I do not have it in there at present because I did not believe it was necessary with the 'include' calls to "SQLite.au3" and "SQLite.dll.au3"...any advice appreciated. Thanks in advance.
Yep yep, this is pretty much an attempt to port the existing project's concept https://socket.io/ to AutoIt's Codebase. So i will not go in to so much detail.
This is how the communication is done http://i.imgur.com/0mMfsBD.png Each client is isolated to the server http://i.imgur.com/rVO2LFb.png Features
Easy API VarType Translation (Example: If the server sends an int, the client will receive an int and vice versa) Fully featured examples Data encryption (Using Autoit's UDF Crypt.au3) Limitations / Drawbacks
It is not possible to Broadcast/Emit objects Only 1D-arrays are allowed to be Broadcasted/Emitted (2D arrays will probably never be supported) Changelog
Version 1.5.0 (This update DOES NOT break scripts)
Added AutoIt like docs under Docs\. The docs are generated so its a 1 to 1 reflection of the UDF headers. Print of documentation Added a production ready server example. Added a new method: _Io_DevDebug which will display useful information when debugging. Added a new method: _Io_SetMaxRecvPackageSize which defaults to whatever _Io_setRecvPackageSize is set to. Added a new method: _Io_setOnPrefix which defaults to _On_ Added a new default client & server event called flood. Flood occurs when exceeding the $__g_io_nMaxPacketSize. $__g_io_nMaxPacketSize is set by _Io_SetMaxRecvPackageSize Fixed the 16 parameter limit when sending data with _Io_Emit, _Io_Broadcast, _Io_BroadcastToAll and _Io_BroadcastToRoom. This works on the same premise that AutoIt's Call Does Fixed a TRUNCATION problem when receiving packages which could cause crashes! Fixed a programming error which caused $__g_ionPacketSize to reset to default 4096 if _Io_Connect or _Io_listenwere called after _Io_setRecvPackageSize Fixed _Io_setEventPreScript and _Io_setEventPostScript They didnt work. Lol. Changed how events are fired so the client cannot crash the server by sending the wrong number of parameters (This also allows for optional parameters on callbacks) Changed _Io_On. The second parameter $fCallback can now be set to null. Doing this, the function assumes that the callback is: _On_<eventName>.
Please see the docs provided
connection Client events
banned Server and Client events
disconnect flood View source on github
Autoit-Socket-IO-1.5.0.zip (NEWEST 2017-12-20)
In case this is interesting few of you, I share my AMCP 2.1 protocol UDF in AutoIT. This protocol is used by CasparCG server, which is a Windows and Linux software used to play out professional graphics, audio and video to multiple outputs as a layerbased real-time compositor. It has been in 24/7 broadcast production since 2006. It's free and opensource.
The UDF I share allows communication between an AutoIt based client and the CasparCG, based on following documentation : http://casparcg.com/wiki/CasparCG_2.1_AMCP_Protocol
If you want more details on CasparCG : official WebSite or have a look to this video
I'm currently building a full Client based on AutoIt, with many features like drag-and-drop layers, but sadly I can't share it right now, might come later. Don't hesitate to ask questions if you have any or need a basic example.
The only requirement for this UDF is the other Event-driven TCP UDF by Kip
I am trying to send a file over TCP from a TCP client to server. If I run the server and client on the same computer the file is send fine, but if the server is on one computer on the network and the client on another the file is sent in what looks like more than one packet. In other words the server receives 4 msg from the client.
Why is this, how do I make it send in one go, or what is a way around it?
Side Note: TCP server has a max of 999999999