Click or drag to resize
HttpMJpegServer Class
Represent an Motion JPEG server, able to handle multiple requests. Pictures are enqueued to the server and fed to all connected contexts.
Inheritance Hierarchy
SystemObject
  StreamCoders.MotionJpegHttpMJpegServer

Namespace: StreamCoders.MotionJpeg
Assembly: MediaBase (in MediaBase.dll) Version: 2.0.5.0 (2.0.5.0)
Syntax
public class HttpMJpegServer

The HttpMJpegServer type exposes the following members.

Constructors
  NameDescription
Public methodHttpMJpegServer(HttpListener)
Construct server using a previous created HttpListener object.
Public methodHttpMJpegServer(String)
Constructs HTTP server with a number of prefixes.
Top
Properties
  NameDescription
Public propertyBoundary
Custom boundary string.
Public propertyConnectedClients
Number of currently connected clients.
Top
Methods
  NameDescription
Public methodAddContext
Adds a context to the server.
Public methodContextQueueCount
Retrieves the number of queued pictures for a specific context.
Public methodDequeueFromContext
Deques an item from a specific context.
Public methodEnqueue
Enqueues a new stream to the server. The stream have to be of a complete encoded JPEG picture.
Public methodEnqueueToAllContexts
Enqueues an already serialized picture to all contexts.
Public methodPrepareEnqueue
Transforms a stream containing a JPEG into a M-JPEG (streamable) buffer.
Public methodRemoveContext
Removes a context from the server. Note that this only removes the structure, but does not disconnect the actual client. To deny a client access, set CancelRequest to true in the OnInitialRequest event.
Public methodStart
Starts the listener to allow incoming connections. The listener cannot be started again after calling Stop().
Public methodStop
Stops the listener and disposes all connected contexts.
Top
Events
  NameDescription
Public eventOnAddContext
Is raised to notify the application of the creation of a new context, identified by a unique Id.
Public eventOnInitialRequest
is raised in order to notify application of newly created context, request and response. The application has the option to cancel the request and deny access to the client. The application can also modify the response message.
Public eventOnRemoveContext
Is raised to notify the application of the removal of a specific context, identified by a unique Id.
Top
Extension Methods
  NameDescription
Public Extension MethodCopyOverloaded.
Creates a copy of the object.
(Defined by ObjectExtensions.)
Public Extension MethodCopy(Object)Overloaded.
Creates a deep copy of the object using the supplied object as a target for the copy operation.
(Defined by ObjectExtensions.)
Top
Remarks
HttpMJpegServer works in terms of contexts. Each time a client connects a new context is created, identified by a unique Id. When a client connects initially, the OnAddContext event is raised to notify the application of a new guid. Immediately after that, OnInitialRequest is raised, to communicate context, request and response to the application. When a client disconnects, the OnRemoveContext event is raised.
See Also