Hey, Rob.
I haven't done much with termios in the past, so there's the possibility I'm missing something relatively simple or newby here and just hoping for a bit of guidance.
What does the socket number synchronet reports correspond to on Linux?
I had
figured it was the filedes, but that does not appear to be the case. Just trying to figure out what to get termios to read and write to :)
Not sure which "report" you're referring to, but socket represented as integer descriptors on Linux.
Can you give more context to your question?
Re: synchronet sockets
By: Digital Man to Underminer on Fri Aug 07 2020 11:04 pm
Not sure which "report" you're referring to, but socket represented as integer descriptors on Linux.
When running a door with %h you get a socket descriptor, and likewise if you look at the door32.sys dropfile.
Can you give more context to your question?
Sure. I've been playing around with writing a modern version of an old door game to run natively on Linux. While certainly not a big deal as both Synchronet and Mystic intercept stdio for linux doors, and I'm sure other software does too, I was just wanting to try my hand at socketio output as well. I had thought/hoped maybe the integer passed from the above command line/dropfile would corrospond to the filedes used by termios, but I seem to be barking up the wrong tree with that one.
It is a file/socket descriptor. You should (on *nix-based OSes anyway) be able to just write() to it and the output gets sent to the user. Or read() from it to get input from the user. I'm not sure what termios has to do it.
Re: synchronet sockets
By: Digital Man to Underminer on Wed Aug 12 2020 09:27 pm
It is a file/socket descriptor. You should (on *nix-based OSes anyway) be able to just write() to it and the output gets sent to the user. Or read() from it to get input from the user. I'm not sure what termios has to do it.
Ok, sounds likely that that should do what I want then. I haven't had much need or opportunity to deal with sockets in c++ unless I've been interfacing with an existing API, so I thought I had to actually load the socket. I knew it was possible/likely I was barking up the wrong tree and easiest just to ask.
Yeah, you don't use socket() to create a new one, just read (or recv) and write (or send) with the descriptor provided. Other socket functions should work too (e.g. select, poll, etc.).
digital man
Sysop: | Lmorchard |
---|---|
Location: | Portland, OR |
Users: | 58 |
Nodes: | 16 (0 / 16) |
Uptime: | 155:40:51 |
Calls: | 368 |
Files: | 1 |
Messages: | 22,357 |