68k CSEND - p2p Chat Application

Relating to a 68k application

mndeaves

New Tinkerer
Apr 3, 2025
3
5
3
Hi there,

Bit late with this for Marchintosh but I've started a hobby project to build a p2p chat app in C that runs on modern OS's and Classic Mac System 7 with MacTCP. The POSIX version is more advanced in terms of features but I have managed to get the classic Mac version to do UDP broadcasts so that it is registered by the POSIX version.

The code is on GitHub and I'm documenting it as I go, especially with tags when I reach a particular milestone I'm proud of. I'm not a C guru, I studied it at university a couple of decades ago and am doing this for fun. I've a Performa 6200 and a Mac SE, so far I'm testing the classic build on System 7.5.3 on the Performa.

I did a video demo of where I am up to on YouTube

I'm using retro68 (which is amazing) to write and compile C code with VSCode on Ubuntu. The idea is that I try to share as much plain vanilla C code as possible between the POSIX and Classic Mac version, which so far is going well.

Just seeing what sort of interest there is out there for feedback from proper C developers or those just following along for the love of old Macs really.

Cheers!
 

mndeaves

New Tinkerer
Apr 3, 2025
3
5
3
I continued to work on building out the MacTCP/System 7 build of the application. It has taken me a while even with the help of AI to trawl through the MacTCP documentation but I've finally got UDP and TCP two-way communication working between my Mac (System 7.5.3) and Ubuntu machines!!!! I'll do a video of the Mac and Ubuntu builds talking to each other this weekend.

I think with a bit more work I could package up the UDP and TCP code as a library that I could use in other applications. My plan is to implement the text box and sending of broadcast/single peer messages in the Mac build in the next week or so and then take more time to refactor the code before making a version that works with OpenTransport.

I will look at that GUSI library, I'm just kind of hooked at the moment on getting it to work with MacTCP.....

 

mndeaves

New Tinkerer
Apr 3, 2025
3
5
3
Some screenshots might be nice.
I spent some time tonight tidying up the classic mac build and getting it to pretty much feature parity with the POSIX build... they can now discover each other over the network via UDP and send messages to each other over TCP (direct by choosing a peer or as a broadcast to all discovered peers).

The screenshots here are a bit rough but show the communication working! I had to export a PICT via photoshop 3 on the mac to then open in GIMP on ubuntu but it didnt seem to read it quite right! On the ubuntu side the top half of the picture is a previous run of the app and then the bottom half is me firing it up again (testing the discovery side of things)

Next steps:

  1. Refactor/refine the whole code base some more, especially the networking UDP/TCP code for MacTCP so that
    1. I can use it in other projects (I want to make a networked game where players instantly join if on same network)
    2. i can look into possibility of sending files between peers
    3. I can start on an OpenTransport build
  2. Implement the ability to set the username for the mac version - preference file maybe or just a text box (at the moment it is hard coded to 'mac')
  3. Implement a menu system with at least Quit option (so you don't have to use the close window button as only way to quit)
I know enough C to be dangerous. The Mac C programming has been only possible this quick for me with the use of AI for the books and generating code as I go... and a lot of getting it to comment code and then I sit and read it/tweak it...

Can't believe it works! I'll do a much better video of it all together this weekend... if you toggle debug mode on either end you can see the UDP chatter going on etc....
 

Attachments

  • mac.jpg
    mac.jpg
    62.5 KB · Views: 22
  • Pasted image (2).png
    Pasted image (2).png
    28 KB · Views: 24
  • Like
Reactions: djc6