Devlog 6:
HOWDYY EVERYONE!! i know its been an eternity since ive logged in to stardance, and trust me i have a very good reason for this. Firstly, yeah i was busy with my college admissions stuff, quite a long time honestly (and its just the beginning). But also during this time, i was hard at work pushing this project forward for the actual file transfer protocol thing. It was NOT at all easy as i was thinking. To send a file, both the users should have a prompt that shows what type of file they’re receiving and then ask them if they would wanna accept it or not. it seems VERY easy but trust me its the opposite. It took me like a week to come up with a very good and redundant method to ask the users. What is hard you might ask? Well the thing is, you need to have a seperate message parser (ie serializer) so you can make out the file details such as the file name, file size, etc. You need to send that seperately, and then ask the recv thread (the one that is always running to see if there are messages on the socket–multi-threading baby!) that the next incoming packet should be a file negotiation packet (as the name suggests, it negotiates with the user if they wanna accept the file) and then assigns the send thread to pay attention for the user command to accept (using “/accept” or “/reject”) for the files. As for selecting the files, im using an API called “tinyFD”. It’s goated honestly. Made my work a lot easier. Basically what it does is it opens the file saving / file opening dialog native to you OS or display server! Pretty darn good for cross-platform project like this (tho my project only works for unix atm).
This was about the file transfer stuff. But there are also many architectural improvements that I made throughout to improve the readibility of the code. For example, instead of endless nested if-else statements, i used switch statements. For the commands, i made a seperate command parser (tho its buggy, not my main focus for now, but yeah working towards it).
A few days ago, a reviewer (huge thank you!) asked me for a feature for custom ports. I’ve added it. Now, you should select a port on which you want your host/server to listen on. Took me long enough, but yep, working like a charm. Another issue i found on the reviewer’s screen rec video was that the server STILL proceeded to operate if the binding failed (for context they had port 8000 – the default port for this project previously already busy. When they attempted to run the server, the socket binding failed due to the port being used by another entity). The server would still go to its operating mode. Thats not good and meaningless. So fixed that bug as well. Thank you, reviewer for taking time having a look on my project!
Anyways, thank you for reading, have a great day!