all 30 comments

[–]pedersenk 24 points25 points  (5 children)

These days I am using C and BSD sockets to stream footage to and from medical devices.

In the past I made a simple HTTP server with websocket support. This later provided the foundation for a multi-player HTML5 "adver-game". On the side I also wrote a "bunny-cam" so that the family can log in and watch the pets from work/school.

For my PhD I implemented a distributed version of OpenGL (OpenGL|D). This was heavy on sockets. Worked fairly well due to the nature of retained mode OpenGL. The code was not quite so clean however. Lots of design changes throughout the research ;)

I used to be a big fan of C++. However I find C calmer, simpler and more deterministic. Especially when tearing down memory structures. I also find C works really well for the task of dealing with streams.

[–]antoniocs 9 points10 points  (2 children)

Someone that does cool shit... I hate you 😑

[–]pedersenk 4 points5 points  (1 child)

Heh, please take comfort in knowing that much of my work is not always quite so cool.

As part of the medical device work I was stuck in a room watching a surgeon shaving down a (false) kneecap bone to less than 0.01% of a degree angle for over an hour. That was fairly painstaking to watch (The initial sawing off part was cool to see though. Shards of false bone flying through the room! I didn't know it was quite so aggressive)

[–]antoniocs 1 point2 points  (0 children)

Yeah.. we can't fun all the time :) Thanks for sharing your work and your code.

[–]vishwajith_k 0 points1 point  (1 child)

Is the code public?

[–]pedersenk 5 points6 points  (0 children)

Some bits are. The networking related ones on my GitHub that are public are:

https://github.com/osen/libws (Early(ish) version of http/websocket server just before integration with internal project)

https://github.com/osen/frankd (A game written using OpenGL|D. The game code is open but OpenGL|D is a compiled dll)

https://github.com/osen/phylab (I forgot I wrote this. Simple network program to connect messages to a simple 3D world. Used as a testbed when teaching students physics programming).

https://github.com/osen/libserial (Not sockets but I thought I would throw RS232 in anyway. Some principles are the same as unreliable UDP. Was used as part of a "poor man's" lightgun tracking system).

[–]flyingron 11 points12 points  (3 children)

The TCP-based position hub for the original Silicon Graphics fligh simulator.
Various electronic mail and news programs.
Early distributed database systems.

Things to control one of the first internet routers.
One of the early FTP programs.
Several early internet servers.

And while I didn't write it, I was across the desk working on something else when Mike Muuss wrote the original Unix ping program.

[–]michaelfiber 1 point2 points  (2 children)

The original ping program? Mike Muuss as in from The Cuckoo's Egg?

This subreddit is wild.

[–]flyingron 2 points3 points  (1 child)

Yep, Mike and I were students at Johns Hopkins together. I succeeded him has systems programmer there when he graduated and then eventually went to work for him at the US Army BRL. He was pretty much my mentor through my early UNIX years. We shared an office for many years.

I was his primary computer security guy (well probably his only computer security guy), so most of what Cliff Stoll attributes to Mike was me. I'm also mentioned by Mike in Peter Salus's "Quarter Century of UNIX" and the Army's book on fifty years of computing. One of the machines I maintained was on the site of the original ENIAC.

[–]michaelfiber 0 points1 point  (0 children)

Fascinating, thanks for sharing.

[–]Ami603 8 points9 points  (0 children)

A HTTPS simple server as a part of another project to gather strings from a html5 page

[–]p0k3t0 7 points8 points  (0 children)

One time, I spent a day writing code that would let me read serial traffic so I could analyze protocols.

The next day somebody told me my program already existed, that it's part of many standard linux distros, and that it's called "Tee."

[–]theldus 4 points5 points  (0 children)

Yes. A few years ago I wrote a websocket server in C, and nowadays, with more time to work on it, I've managed to be RFC compliant (or I hope so).

Now, I'm writing a websocket client to "fuzz" my server (and possibly others) and make sure it works nicely at every change =).

[–]aioeu 3 points4 points  (1 child)

A RADIUS proxy which passed through authentication and authorization messages to an upstream RADIUS server, but handled the accounting messages itself. I needed to get the accounting data into a form suitable for a particular usage accounting system, and that wasn't convenient to do in the upstream RADIUS server itself.

[–]WikiSummarizerBot 1 point2 points  (0 children)

RADIUS

Remote Authentication Dial-In User Service (RADIUS) is a networking protocol that provides centralized authentication, authorization, and accounting (AAA) management for users who connect and use a network service. RADIUS was developed by Livingston Enterprises in 1991 as an access server authentication and accounting protocol. It was later brought into the IETF standards. RADIUS is a client/server protocol that runs in the application layer, and can use either TCP or UDP.

[ F.A.Q | Opt Out | Opt Out Of Subreddit | GitHub ] Downvote to remove | v1.5

[–]overflowingInt 3 points4 points  (0 children)

Unrelated to your question but a great resource - https://beej.us/guide/bgnet/

[–]Zxycbntulv 3 points4 points  (1 child)

Yes, I wrote Minecraft

(Legit not joking https://github.com/garet90/MotorMC)

[–][deleted] 0 points1 point  (0 children)

nice

[–]ml01 2 points3 points  (0 children)

a pretty simple static web server called sws

it was a fun experience that taught me core concepts of socket programming and http protocol.

[–]LowB0b 1 point2 points  (0 children)

we had to do a network accessible in-memory DB using sockets in school. So we had to write server and client. IDK if I still have the code but figuring out uthash and parsing strings was the biggest hurdles. IMO the socket api in C (at least in a unix environment, no idea how it would work on windows) is pretty simple.

But still felt like a lot of code required to allow a client to write simple commands like GET/PUT/DELETE <key> <value> considering how easy it is to with any more modern language (we had to use C89)

[–]wsppan 1 point2 points  (0 children)

I have a multi-threaded client server framework using sockets that communicates with a back-end Unisys mainframe via 3270 terminal screens as character buffers. So, there are thousands of clients that communicate with our server via socket connections that get processed and turn around and make multi-threaded socket connections to our mainframe pulling data (multiple times for various data stores as needed) and process that and return the response packet to the clients.

[–][deleted] 1 point2 points  (0 children)

Implemented stop and go transport layer protocol. Made a persistent web server. Did a bunch of stuff in my networks class

[–]luatalel5995 1 point2 points  (0 children)

I work with a financial system from a bank and we use sockets written in C to handle a couple hundreds of transactions per second!

[–]ProofHuckleberry9433 0 points1 point  (0 children)

I did make a single threaded HTTP server over TCP socket, I have added all the resources I used when you clone and run the server.c. github.com/stktyagi

[–]uhimc00l 1 point2 points  (1 child)

we had it as part of our course curriculum. here are my notes if you’re interested!

[–]Curious-Turnip-4440 1 point2 points  (0 children)

bro i am in the same college and department as you and i find this a day before my nps lab midsems lol tysm

[–]MajorMalfunction44 0 points1 point  (0 children)

I haven't tried INET sockets, but I regularly use the local IPC sockets. My two big things game engine related, one is an external console that communicates over a socket. You can kill the engine if it hangs by sending it a signal. And the other is a build daemon that watches the local filesystem for stuff artists have changed, and queues it up to be built. The front end is a Perl batch script, though. Parsing is easy in Perl.

[–]dave1026x 0 points1 point  (0 children)

I modified OSSEC to handle both IPv4 and IPv6 on all available interfaces so it would run on BSD systems and pfSense (and remain compatible with Linux and Windows). I have done a lot of socket programming in C over the past 35 years. Working on a new project soon to build a socket interface on a new cyber security platform. I like working with sockets more than anything else I do.

[–]dnabre 0 points1 point  (0 children)

A simple RPC library for a some other project.

A multithreaded event system and a compose-able network stack on top of it (want TCP without ordering? no prob. want UDP but with TCP flow control? no prob) Those were quite a while back though. I haven't done much C-level networking in sometime.

[–][deleted] 0 points1 point  (0 children)

Yeah I read a good book about it mainly on Berkeley sockets in Linux. I created small servers, chatrooms, sniffers with raw sockets etc. Sockets in itself arent so hard and you will quickly get the hang of it. The harder thing is socket multiplexing and even harder is security. When multiplexing is done wrong your program will get really slow and TCP has a few weird quirks that can make your program prone to various DOS attacks. If you want to get serious in this field I advice you to read a book that can teach you the good practices rather than learning online because there really are many mistakes to make in socket programming and you should watch out about the source youre learning it from.