cpp-libp2p icon indicating copy to clipboard operation
cpp-libp2p copied to clipboard

Remove TLS dependency on TCP

Open turuslan opened this issue 3 years ago • 0 comments

  • Remove dynamic_cast.
  • Can use TLS over any libp2p stream.
  • Can use in WASM (browsers don't allow TCP).

Open questions:

  • std::error_code and boost::system::error_code conversion.
    • Inconsistent conversions may create memory leaks (e.g. s1 -> b1, b1 -> s1', s1' -> b1', ...).
    • Error comparison may be unavailable (e.g. error == EOF) for underlying stream errors.
      • If we will map to single boost error.
      • Or if conversion is inconsistent (e.g. s1 -> b1, b1 -> s1', s1 != s1').
    • May store last read and write errors in stream instance (like errno), as there can only be one active read/write.
  • May need to check lifetimes during async read/write operation.

turuslan avatar Jun 07 '22 08:06 turuslan