Follow

In socket programming, what is usually called the entity that receives socket messages? My socket class is called “EventHandler” and I hate that name a lot. 😅

I’m almost going with “antenna” for the individual socket listener entity and “radio” for the entity that controls all the entities of “antenna” lol

@brunoph Call it SocketListener if it's for a single listening socket.

Otherwise, if it's just the place where you call poll() for all your fds, typical names are: EventLoop, MainLoop, Dispatcher, Reactor...

@brunoph By the way, designing a scalable, multi-threaded, portable event loop is tricky. Consider taking one of these solutions (or at least study them):

libuv.org/
libevent.org/
doc.qt.io/qt-5/qeventloop.html
developer.gnome.org/glib/stabl

@codewiz Thank you! And absolutely, I’m using Starscream. I wouldn’t trust myself to write socket code. 😝

I was just wondering what kind of names were usual because I couldn’t come up with anything that I liked, but what I’m implementing is the higher, business-logic level code.

Sign in to participate in the conversation
Mastodon for Tech Folks

This Mastodon instance is for people interested in technology. Discussions aren't limited to technology, because tech folks shouldn't be limited to technology either! We adhere to an adapted version of the TootCat Code of Conduct and have documented a list of blocked instances. Ash is the admin and is supported by Fuzzface, Brian!, and Daniel Glus as moderators. Hosting costs are largely covered by our generous supporters on Patreon – thanks for all the help!