Skip to content

Commit

Permalink
Don't throw when in or out are closed. (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
floitsch authored Apr 10, 2024
1 parent a71c674 commit 7d01475
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/modules/quectel/quectel.toit
Original file line number Diff line number Diff line change
Expand Up @@ -179,17 +179,17 @@ class TcpSocket extends Socket_ with io.CloseableInMixin io.CloseableOutMixin im
return 0

close-reader_:
// TODO(florian): is this the right thing to do?
// Do nothing.
/**
Closes the socket for write. The socket is still be able to read incoming data.
Deprecated. Call ($out).close instead.
*/
close_write:
throw "UNSUPPORTED"
out.close

close-writer_:
throw "UNSUPPORTED"
// Do nothing.
// Immediately close the socket and release any resources associated.
close:
Expand Down
3 changes: 1 addition & 2 deletions src/modules/sequans/sequans.toit
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ class TcpSocket extends Socket_ with io.CloseableInMixin io.CloseableOutMixin im
return 0

close-reader_:
// TODO(florian): is this the right way to close the reader?
// Do nothing.
/**
Expand All @@ -192,7 +191,7 @@ class TcpSocket extends Socket_ with io.CloseableInMixin io.CloseableOutMixin im
out.close

close-writer_:
throw "UNSUPPORTED"
// Do nothing.
// Immediately close the socket and release any resources associated.
close:
Expand Down
4 changes: 2 additions & 2 deletions src/modules/ublox/ublox.toit
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,10 @@ class TcpSocket extends Socket_ with io.CloseableInMixin io.CloseableOutMixin im
Deprecated. Use ($out).close instead.
*/
close_write:
throw "UNSUPPORTED"
out.close

close-writer_:
throw "UNSUPPORTED"
// Do nothing.
// Immediately close the socket and release any resources associated.
close:
Expand Down

0 comments on commit 7d01475

Please sign in to comment.