toitlang / pkg-http

Package: Implement your REST server or client in Toit and run it on your ESP32.
MIT License
1 stars 1 forks source link

Client enters bad state #100

Closed floitsch closed 1 year ago

floitsch commented 1 year ago

At some point the client doesn't connect anymore and always throws the following exception.

version 2.1.0 SDK: v2.0.0-alpha.86

EXCEPTION error. 
Connection closed
  0: tcp_set_option_           <sdk>/net/modules/tcp.toit:214:3
  1: TcpSocket_.set_option_    <sdk>/net/modules/tcp.toit:89:12
  2: TcpSocket.no_delay=       <sdk>/net/modules/tcp.toit:137:33
  3: Socket.no_delay=          <sdk>/tls/socket.toit:126:22
  4: Connection.send_headers   <pkg:pkg-http>/connection.toit:117:22
  5: RequestOutgoing.send      <pkg:pkg-http>/request.toit:48:32
  6: Client.post_.<block>.<block> <pkg:pkg-http>/client.toit:463:28
  7: Client.try_to_reuse_.<block> <pkg:pkg-http>/client.toit:642:7
  8: catch.<block>             <sdk>/core/exceptions.toit:124:10
  9: catch                     <sdk>/core/exceptions.toit:122:1
 10: catch                     <sdk>/core/exceptions.toit:85:10
 11: Client.try_to_reuse_      <pkg:pkg-http>/client.toit:641:5
 12: Client.post_.<block>      <pkg:pkg-http>/client.toit:460:7
 13: SmallInteger_.repeat      <sdk>/core/numbers.toit:1194:3
 14: Client.post_              <pkg:pkg-http>/client.toit:458:19
 15: Client.post_json          <pkg:pkg-http>/client.toit:523:12
 16: Client.request_.<block>   <pkg:toit-telegram>/telegram.toit:175:26
 17: Client.request_           <pkg:toit-telegram>/telegram.toit:151:3
 18: Client.listen.<block>     <pkg:toit-telegram>/telegram.toit:103:20
 19: catch.<block>             <sdk>/core/exceptions.toit:124:10
 20: catch                     <sdk>/core/exceptions.toit:122:1
 21: catch                     <sdk>/core/exceptions.toit:73:10
 22: Client.listen             <pkg:toit-telegram>/telegram.toit:92:20
 23: TelegramChatBot.run       telegram.toit:111:22
 24: main                      telegram.toit:62:7
 25: main                      telegram_esp32_family_ai.toit:13:3
floitsch commented 1 year ago

Dupe of #90