Skip to content

Commit

Permalink
fix: Detect client disconnect, avoiding crash (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
meyfa authored Apr 2, 2024
1 parent 006d803 commit 385ef47
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions server.cob
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ AcceptConnection.
ReceivePacket SECTION.
*> Read packet length
CALL "Read-VarInt" USING HNDL ERRNO BYTE-COUNT PACKET-LENGTH.
IF ERRNO = 2
DISPLAY "Client lost connection"
MOVE 255 TO CLIENT-STATE
EXIT SECTION
END-IF
PERFORM HandleError.

*> Read packet ID
Expand Down

0 comments on commit 385ef47

Please sign in to comment.