资源简介
Implementing a MJPEG (or Motion JPEG) streaming server that can be used to steam screenshots or any other source of images over the HTTP protocol to any web browser client (MJPEG stream writer is included in the library).
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using System.Windows.Forms;
using System.IO;
// -------------------------------------------------
// Developed By : Ragheed Al-Tayeb
// e-Mail : ragheedemail@gmail.com
// Date : April 2012
// -------------------------------------------------
namespace rtaNetworking.Streaming
{
///
/// Provides a streaming server that can be used to stream any images source
/// to any client.
///
public class ImageStreamingServer:IDisposable
{
private List _Clients;
private Thread _Thread;
public ImageStreamingServer():this(Screen.Snapshots(600450true))
{
}
public ImageStreamingServer(IEnumerable imagesSource)
{
_Clients = new List();
_Thread = null;
this.ImagesSource = imagesSource;
this.Interval = 50;
}
///
/// Gets or sets the source of images that will be streamed to the
/// any connected client.
///
public IEnumerable ImagesSource { get; set; }
///
/// Gets or sets the interval in milliseconds (or the delay time) between
/// the each image and the other of the stream (the default is .
///
public int Interval { get; set; }
///
/// Gets a collection of client sockets.
///
public IEnumerable Clients { get { return _Clients; } }
///
/// Returns the status of the server. True means the server is currently
/// running and ready to serve any client requests.
///
public bool IsRunning { get { return (_Thread != null && _Thread.IsAlive); } }
///
/// Starts the server to accepts any new connections on the specified port.
///
///
public void Start(int port)
{
lock (this)
{
_Thread = new Thread(new ParameterizedThreadStart(ServerThread));
_Thread.IsBackground = true;
_Thread.Start(port);
}
}
///
/// Starts the server to accepts any new connections on the default port (8080).
///
public void Start()
{
this.Start(8080);
}
public void Stop()
{
if (this.IsRunning)
{
try
{
_Thread.Join();
_Thread.Abort();
}
finally
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2012-04-24 00:45 rtaVideoStreamer\rtaNetworking.Streaming\
文件 8500 2012-04-23 00:17 rtaVideoStreamer\rtaNetworking.Streaming\ImageStreamingServer.cs
文件 3445 2012-04-23 00:29 rtaVideoStreamer\rtaNetworking.Streaming\MjpegWriter.cs
目录 0 2012-04-24 00:45 rtaVideoStreamer\rtaNetworking.Streaming\obj\
目录 0 2012-04-24 00:45 rtaVideoStreamer\rtaNetworking.Streaming\obj\Debug\
目录 0 2012-04-24 00:45 rtaVideoStreamer\rtaNetworking.Streaming\obj\Debug\Refactor\
文件 5120 2012-04-23 01:07 rtaVideoStreamer\rtaNetworking.Streaming\obj\Debug\Refactor\rtaNetworking.Streaming.dll
文件 608 2012-04-22 21:58 rtaVideoStreamer\rtaNetworking.Streaming\obj\Debug\rtaNetworking.Streaming.csproj.FileListAbsolute.txt
文件 14848 2012-04-23 00:29 rtaVideoStreamer\rtaNetworking.Streaming\obj\Debug\rtaNetworking.Streaming.dll
文件 30208 2012-04-23 00:29 rtaVideoStreamer\rtaNetworking.Streaming\obj\Debug\rtaNetworking.Streaming.pdb
目录 0 2012-04-20 10:16 rtaVideoStreamer\rtaNetworking.Streaming\obj\Debug\TempPE\
目录 0 2012-04-24 00:45 rtaVideoStreamer\rtaNetworking.Streaming\Properties\
文件 1458 2012-04-20 10:16 rtaVideoStreamer\rtaNetworking.Streaming\Properties\AssemblyInfo.cs
文件 2672 2012-04-21 20:29 rtaVideoStreamer\rtaNetworking.Streaming\rtaNetworking.Streaming.csproj
文件 1461 2012-04-23 01:05 rtaVideoStreamer\rtaVideoStreamer.sln
文件 32768 2012-04-24 00:44 rtaVideoStreamer\rtaVideoStreamer.suo
目录 0 2012-04-24 00:47 rtaVideoStreamer\rtaVideoStreamer\
文件 1223 2012-04-24 00:44 rtaVideoStreamer\rtaVideoStreamer\Form1.cs
文件 4643 2012-04-23 01:25 rtaVideoStreamer\rtaVideoStreamer\Form1.Designer.cs
文件 6209 2012-04-23 01:25 rtaVideoStreamer\rtaVideoStreamer\Form1.resx
目录 0 2012-04-24 00:45 rtaVideoStreamer\rtaVideoStreamer\obj\
目录 0 2012-04-24 00:45 rtaVideoStreamer\rtaVideoStreamer\obj\Debug\
目录 0 2012-04-23 01:07 rtaVideoStreamer\rtaVideoStreamer\obj\Debug\Refactor\
文件 8279 2012-04-23 00:29 rtaVideoStreamer\rtaVideoStreamer\obj\Debug\ResolveAssemblyReference.cache
文件 1159 2012-04-24 00:44 rtaVideoStreamer\rtaVideoStreamer\obj\Debug\rtaVideoStreamer.csproj.FileListAbsolute.txt
文件 847 2012-04-23 01:25 rtaVideoStreamer\rtaVideoStreamer\obj\Debug\rtaVideoStreamer.csproj.GenerateResource.Cache
文件 10240 2012-04-24 00:44 rtaVideoStreamer\rtaVideoStreamer\obj\Debug\rtaVideoStreamer.exe
文件 180 2012-04-24 00:44 rtaVideoStreamer\rtaVideoStreamer\obj\Debug\rtaVideoStreamer.Form1.resources
文件 26112 2012-04-24 00:44 rtaVideoStreamer\rtaVideoStreamer\obj\Debug\rtaVideoStreamer.pdb
文件 180 2012-04-24 00:44 rtaVideoStreamer\rtaVideoStreamer\obj\Debug\rtaVideoStreamer.Properties.Resources.resources
目录 0 2012-04-20 10:14 rtaVideoStreamer\rtaVideoStreamer\obj\Debug\TempPE\
............此处省略9个文件信息
相关资源
- FusionCharts+asp.net+sqlserver生成图表
- C#图片转换成二进制流并且保存到sq
- 网上书店系统源码C#+SQLSERVER
- C#仓库管理系统
- 上传文件夹stream控件
- 教务管理系统asp.net+c#+sql server2005
- C#远程连接SQLserver 数据库
- HTML、C#以及SQL Server学生信息管理系统
- SQL Server数据库备份与恢复C#代码
- c#仓库信息管理系统
- c#+SQL server物资管理系统
- FusionCharts ASP.NET+SQLServer
- .net 天气预报 C#应用程序
- C#中读取sql server的数据,并在datagri
- 图书馆管理系统ASP.NET+SQL Server 2008
- .NETvb/C#开发OPC Server(源码及详细说明
- C#编写的MemoryStream播放Wav格式流文件
- TCP_ServerAndClient.rar
- C#winform TCP通信 UDP通信 Socket通信 vs2
- 通过KEPServer opc与PLC通讯程序。
- SQL Server Profiler with C#
- 大屏滚动显示源码 C#
- SqlServer数据库对应生成c#实体类生成工
- 物流配送中心管理系统C#+SQLserver
- C#使用了SQLserver编写的简易学生信息管
- 基于asp.net开发的学生信息管理系统
- c#+sql server医院管理系统电子病历系统
- 超市进销存管理系统 Sqlserver 数据库文
- C# winform 学生信息管理系统(毕业设计
- 网上书店系统(asp.net + sql server)
评论
共有 条评论