Skip to content

Drop "pseudo" serial devices when fd is closed - #2102

Merged
stsp merged 1 commit into
dosemu2:develfrom
jordemort:drop-closed-pseudo-serial
Sep 22, 2023
Merged

Drop "pseudo" serial devices when fd is closed#2102
stsp merged 1 commit into
dosemu2:develfrom
jordemort:drop-closed-pseudo-serial

Conversation

@jordemort

Copy link
Copy Markdown
Contributor

This sets the modem status lines for a "pseudo" serial port to zero when the associated file descriptor is closed. This is useful when using DOSEMU2 to launch BBS doors and other programs designed to communicate over a modem; it allows such programs to detect when the other side of the connection has been closed.

Some caveats:

  • There is no way to "reconnect" once the file descriptor has been closed, but I don't think there'd be any way to reopen the file descriptor from the other end anyway, so I don't think this is a problem
  • I'm not sure if setting MSRs to 0 here is the right thing or if I should only drop DCD. I think the difference is between simulating "lost carrier" vs simulating "someone yanked the modem cord out of the serial port" - 0 seems to get applications to behave the way I want it to, though.

Re: #2101

This sets the modem status lines for a "pseudo" serial port to zero
when the associated file descriptor is closed. This is useful when
using DOSEMU2 to launch BBS doors and other programs designed to
communicate over a modem; it allows such programs to detect when the
other side of the connection has been closed.
@stsp
stsp merged commit 5a001d2 into dosemu2:devel Sep 22, 2023
@stsp

stsp commented Sep 22, 2023

Copy link
Copy Markdown
Member

Thanks.

@jordemort
jordemort deleted the drop-closed-pseudo-serial branch September 22, 2023 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants