My idea here is actually two projects, but one will easily become the other. The idea is to do some trivial TCP socket client programming. My first goal will be to talk to the infamous port 13 daytime server. The second is to send a message and ring my workshop bell.
The very first thing is to get the daytime server running on port 13. It seems like I have done this countless times, and perhaps I can do it without referring to my notes. This is entirely some linux housekeeping. For whatever reason, linux distros don't start this server by default in this modern age.
I do need my notes. The xinetd server is not installed by default and the package is no longer part of the Fedora package set. They tell me that the package was "retired" as of Fedora 34.
A quick search turned up some simple C source. I made a few trivial changes, compiled it, and am running it. It must be run as root in order to bind to port 13.
Why am I so hell-bent to get a daytime server? Well it was once a classic exercise in network programming and was running on every unix system on the planet -- but that was some time ago.I use Ctrl-Shift-P to get the command palette, then select again a console template, but I change the name to "Socket". Of course it times out while I am typing this, so I have to type do it all again, but I suppose the practice is good for me. It gives me a Program.cs -- I add code to it and then try to run and build it. VS Code is still stuck on running and building my old "hello world" project and it is not clear how to get it to deal with my current project, or how to make my current project (that it is letting me create and edit files in) the project it wants to Run and debug. Dare I call this a stupid bug? I can certainly call it stupid.
This is baffling, not to mention annoying. When I look at my vscode directory, I see the ConsoleApp1 directory alongside the Socket directory. One difference is that there is a ConsoleApp1.sln file, but no such file for "Socket". My guess is that "sln" is short for "solution" and somehow my way of using the command palette to set up my project did not get VS-code to consider it as a "solution".
cd vscode rm -rf *This deletes everything except the .vscode directory. Then I restart code. I use Ctrl-Shift-P again, select new .NET project (but I notice an entry for "open .NET solution ...) I call the project Socket this time rather than ConsoleApp1. I make no changes and just try the Run and debug arrow on the left side.
I tells me that ConsoleApp1 is missing in launch.js -- well this is definitely a Microsoft bug. I don't see launch.js anywhere in my vscode directory. It is hard to believe people actually like this piece of software.
We get even more nasty:
cd /home/tom rm -rf vscode mkdir vscodeThis does it. I can create a project "Socket" and without making changes I can run and debug the template boilerplate they give me. And I add some code and it compiles and runs that, so I am off to doing what I wanted to do.
Tom's Computer Info / [email protected]