pub struct RtmpHandler<RW: AsyncRead + AsyncWrite + Unpin>(/* private fields */);
Expand description
The default RTMP handler.
This handles the raw RTMP by well-known communication steps. That is, this performs just following steps.
- Checks the application name from the
Connect
command. - Checks the playpath from the
ReleaseStream
/FcPublish
command. - Provides a message ID when receives the
CreateStream
command. - Checks publication informations from the
Publish
command. - Then receives FLV media data.
If receiving data size exceeds server’s bandwidth, this reports its thing via the Acknowledgement
message to its client.
And if some error occurs in any step, sends commands which are FcUnpublish
and DeleteStream
to its client, then terminates its connection.
These perform to delete the playpath and a message ID from its context.
However also these can be sent from clients.
§Examples
use std::marker::PhantomData;
use sheave_core::handlers::{
RtmpContext,
VecStream
};
use sheave_server::{
Server,
handlers::RtmpHandler,
};
let stream = VecStream::default();
let rtmp_context = RtmpContext::default();
let server = Server::new(stream, rtmp_context, PhantomData::<RtmpHandler<VecStream>>);
Trait Implementations§
Source§impl<RW: AsyncRead + AsyncWrite + Unpin> AsyncHandler for RtmpHandler<RW>
impl<RW: AsyncRead + AsyncWrite + Unpin> AsyncHandler for RtmpHandler<RW>
fn poll_handle( self: Pin<&mut Self>, cx: &mut FutureContext<'_>, rtmp_context: &mut RtmpContext, ) -> Poll<IOResult<()>>
Source§impl<RW: AsyncRead + AsyncWrite + Unpin> HandlerConstructor<StreamWrapper<RW>> for RtmpHandler<RW>
impl<RW: AsyncRead + AsyncWrite + Unpin> HandlerConstructor<StreamWrapper<RW>> for RtmpHandler<RW>
fn new(stream: Arc<StreamWrapper<RW>>) -> Self
Auto Trait Implementations§
impl<RW> Freeze for RtmpHandler<RW>
impl<RW> RefUnwindSafe for RtmpHandler<RW>where
RW: RefUnwindSafe,
impl<RW> Send for RtmpHandler<RW>
impl<RW> Sync for RtmpHandler<RW>
impl<RW> Unpin for RtmpHandler<RW>
impl<RW> UnwindSafe for RtmpHandler<RW>where
RW: RefUnwindSafe,
Blanket Implementations§
Source§impl<H> AsyncHandlerExt for Hwhere
H: AsyncHandler,
impl<H> AsyncHandlerExt for Hwhere
H: AsyncHandler,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more