Skip to content

Commit

Permalink
Mark connection as closed on send error.
Browse files Browse the repository at this point in the history
I would have expected that no matter what causes the TCP connection to be closed would be reported as a TCP call back with lenghth = -1. However there are scenarios where this isn't true. I.e. when the user aborts during a blocking TCP retransmit opration. I'm unsure if this behaviour is to be considered a bug or if this is by some design I don't understand.

So I opted to not change that behaviour but rather add an explicit check for tcp_send returning with an error indicating that the connection is closed. This way the users gets noticed on the closed connection at least on his next key press.
  • Loading branch information
oliverschmidt committed Jun 5, 2017
1 parent 2da0e84 commit ae4c369
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions apps/telnet65.s
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,12 @@ send_char:
jsr tcp_send
bcs :+
rts
: lda ip65_error
cmp #KPR_ERROR_CONNECTION_CLOSED
bne :+
lda #1
sta connection_closed
rts
: ldax #send_error
jsr print_ascii_as_native
jmp print_error
Expand Down

0 comments on commit ae4c369

Please sign in to comment.