SrtSession.hpp 744 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#ifndef ZLMEDIAKIT_SRT_SESSION_H
#define ZLMEDIAKIT_SRT_SESSION_H

#include "Network/Session.h"
#include "SrtTransport.hpp"

namespace SRT {

using namespace toolkit;

class SrtSession : public UdpSession {
public:
    SrtSession(const Socket::Ptr &sock);
    ~SrtSession() override;

    void onRecv(const Buffer::Ptr &) override;
    void onError(const SockException &err) override;
    void onManager() override;
xiongguangjie committed
19
    void attachServer(const toolkit::Server &server) override;
20 21 22 23 24 25 26 27 28 29
    static EventPoller::Ptr queryPoller(const Buffer::Ptr &buffer);

private:
    bool _find_transport = true;
    Ticker _ticker;
    struct sockaddr_storage _peer_addr;
    SrtTransport::Ptr _transport;
};

} // namespace SRT
ziyue committed
30
#endif // ZLMEDIAKIT_SRT_SESSION_H