Files
voice-cat/core/src/net/transport.h

40 lines
1.1 KiB
C
Raw Normal View History

/*
* net/transport.h TCP control channel + UDP media channel.
*
* Design: docs/architecture.md (Net thread), docs/protocol.md §1 (framing), docs/voice.md §2
* (UDP frame). Implementation will use standalone Asio (one reactor) for sockets/timers.
*
* STATUS: M0 stub interfaces only, no Asio yet.
*/
#ifndef VOICECAT_NET_TRANSPORT_H
#define VOICECAT_NET_TRANSPORT_H
#include <cstdint>
#include <string>
namespace voicecat::net {
// Length-prefixed [u32 length][payload] framing over a TLS 1.3 byte stream (protocol.md §1).
class TcpControlChannel {
public:
// TODO(M1): connect(host, port), TLS handshake, send/recv framed Envelopes.
bool connected() const { return connected_; }
private:
bool connected_ = false;
};
// UDP media channel: encrypted voice frames (voice.md §2), bound to a session via token.
class UdpMediaChannel {
public:
// TODO(M2): bind, send/recv AEAD-sealed voice frames, keepalive.
bool bound() const { return bound_; }
private:
bool bound_ = false;
};
} // namespace voicecat::net
#endif // VOICECAT_NET_TRANSPORT_H