May 2022 update
Added 2022-05-27 07:48:13 +0000 UTCHey folks,
The trip I was on to California went rather poorly, and a friend I was planning to meet and spend time with turned on me like swine from a certain biblical verse. The emotional impact of what basically amounted to a betrayal, where every attempt I took to smooth things over was treated with apathy, from someone I trusted immensely... that took a hefty toll on my motivation and productivity, and heavily limited what work I could push myself to do in Cali.
So, I ended up giving DarkSocket an overhaul, instead of working on Lacewing HTML5; I literally couldn't process any of the projects I was on that had too much difficulty, and DarkSocket revamp was fresh and simple ground to cover. The bugs were obvious, and the possible improvements were obvious.
DarkSocket was an interesting project that I started in my teens, to fix issues with MooSock and expand the capabilities.
However, like most beginner coders, I was coding with trial and error, and with a "keep changing things until it works", "this looks familiar", "this makes error go bye bye so I'll move on" sort of mindset. DarkSocket as it exists now (build 3 and earlier) is so rife with coding design issues I wouldn't recommend anyone use it.
For example, one obvious flaw is it expects the Fusion user to only read Unicode text from messages in the Unicode Fusion runtimes - it doesn't attempt to convert incoming messages from other encodings. So it's basically almost useless.
So, the changes in the new DarkSocket (build 4):
- Int64 is now accessible by text expressions, replacing the "long" actions.
"long" was actually pointless in DarkSocket build 3; it was basically just another int32, same as integer, as "long" in 32-bit apps is 32-bit wide, and int is 32-bit wide in both 64 and 32-bit apps. - Linking to file output was removed. Keeping that feature spiralled the extension into manipulating binary before it sent it to the file - which, while very useful, isn't in the scope of a socket extension, more of a binary file extension.
Ideally, the Binary object will be ported to other platforms - if I get the source, and put it into DarkEdif, it's definitely possible! - Going independent and turning off logging was removed.
- Anything referencing memory addresses now uses text expressions. This is so 64-bit platforms can still communicate their addresses.
- Text setting/getting now uses explicit text encoding parameter.
It supports UTF-8, UTF-16, ANSI and other explicit codepages like ISO-8859-1.
On non-Windows, though, there is no OS conversion feature readily accessible, so it's UTF-8 only. Still, most protocols use UTF-8 nowadays. - Adding to the formed packet can now be done with both insertion and appending, depending on the index you pass.
- Sending to the server socket's clients no longer uses a text parameter for client IDs.
The idea was that the Fusion dev would pass a list of socket IDs "0, 5, 8" etc, but this was never implemented.
As a future feature, I could set up an internal listing inside DarkSocket so you can group clients together. But I'll save that for if I see demand. - Removed the popup messages and test actions.
As a further indication of how dodgy the code was, I had test actions just to make sure the content was being set properly. I kept them public for later debugging. - Added a pending data cache.
Received data is now appended to an internal cache, so the Fusion events can find the end of message, as messages can be broken over several packets. This means you don't have to read or copy out everything for each packet.
I also updated/fixed the DarkSocket example included with the extension.
Once the DarkSocket update is released, I'll have a smaller project someone is paying me for. That should take maybe a couple weeks. Then it's onto Lacewing HTML5.
Thanks for your patronage!
~ Phi