C# Class iSpyApplication.Server.LocalServer

Mostrar archivo Open project: ispysoftware/iSpy Class Usage Examples

Public Properties

Property Type Description
ClientConnected System.Threading.AutoResetEvent
NumErr int
ServerRoot string
ServerStartupFailed bool
WebSocketServer iSpyApplication.Server.WebSocketServer

Private Properties

Property Type Description
AudioIn void
BuildApijson string
CheckAccess bool
CheckAuth bool
ClientValidationCallback bool
DeleteFiles void
DeviceScannerScanComplete void
DeviceScannerURLFound void
DoCommand string
FormatDays string
FormatTime string
GetCameraWindows List
GetDirectoryPath void
GetFileOptionsList string
GetFromBuffer string
GetObjectList string
GetPropValue object
GetStatus string
GetVar string
GetWidthHeight void
Gzip byte[]
HeaderEnabled bool
LoadJson void
MJPEGFeedMulti void
NV string
NVSet string
OnAuthenticateAsServer void
ParseMimeType void
ParseRequest void
Populate void
PopulateObject void
PopulateResponse dynamic
ProcessCommandInternal string
ProcessRequest void
ReadCallback void
SaveJson void
ScannerDeviceFound void
ScannerScanFinished void
SendAudioFeed void
SendClip void
SendDesktop void
SendFloorPlanFeed void
SendGrab void
SendHeader bool
SendHeader bool
SendHeaderWithRange bool
SendImage void
SendLiveFeed void
SendLogFile void
SendLogFile void
SendMJPEGFeed void
ServeFile void
ServeNotFound void
SetDesiredKeepAlive void
SetKeepAlive void
SetPropValue void
StartListen void
TagUp string
Translate string
Translate void
getJSONObject dynamic

Public Methods

Method Description
DisconnectRequest ( HttpRequest req ) : void
Dispose ( ) : void
DoAcceptClientCallback ( IAsyncResult ar ) : void
FormatBytes ( long bytes ) : string
GetMimeType ( string sRequestedFile ) : string

This function takes FileName as Input and returns the mime type..

ReloadAllowedIPs ( ) : void
ReloadAllowedReferrers ( ) : void
SendResponse ( string sHttpVersion, string sMimeType, byte bData, string statusCode, int cacheDays, HttpRequest req, bool gZip = false ) : bool
SendResponse ( string sHttpVersion, string sMimeType, string sData, string statusCode, int cacheDays, HttpRequest req, bool gZip = false ) : bool
SendToBrowser ( byte bSendData, HttpRequest req ) : bool

Sends data to the browser (client)

SendToBrowser ( string sData, HttpRequest req ) : bool
SendToBrowser ( byte bSendData, int datalength, HttpRequest req ) : void

Sends data to the browser (client)

StartServer ( ) : string
StopServer ( ) : void
ThumbnailCallback ( ) : bool

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Private Methods

Method Description
AudioIn ( HttpRequest req, int cameraId ) : void
BuildApijson ( string r, string lc ) : string
CheckAccess ( string group, string groups ) : bool
CheckAuth ( string sPhysicalFilePath ) : bool
ClientValidationCallback ( object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors ) : bool
DeleteFiles ( int oid, int ot, List files ) : void
DeviceScannerScanComplete ( object sender, EventArgs e ) : void
DeviceScannerURLFound ( object sender, ConnectionOptionEventArgs e ) : void
DoCommand ( string sRequest, int otid, string resp, string cmd, int oid, string fn, string &func ) : string
FormatDays ( IEnumerable d ) : string
FormatTime ( int t ) : string
GetCameraWindows ( string cameraids, int &w, int &h ) : List
GetDirectoryPath ( String sRequest, String sMyWebServerRoot, String &sLocalDir, String &sDirName ) : void
GetFileOptionsList ( string relPath, string filter ) : string
GetFromBuffer ( string buffer, string field ) : string
GetObjectList ( ) : string
GetPropValue ( object src, string propName ) : object
GetStatus ( bool active ) : string
GetVar ( string url, string var ) : string
GetWidthHeight ( string size, int &w, int &h ) : void
Gzip ( byte bytes ) : byte[]
HeaderEnabled ( string req, string header, string val ) : bool
LoadJson ( string sPhysicalFilePath, string sBuffer, string sHttpVersion, HttpRequest req ) : void
MJPEGFeedMulti ( string cameraids, HttpRequest req, int w, int h, bool basicContentType, bool maintainAspectRatio, bool includeOverlay ) : void
NV ( string source, string name ) : string
NVSet ( string source, string name, string value ) : string
OnAuthenticateAsServer ( IAsyncResult result ) : void
ParseMimeType ( String sRequestedFile, string &sFileName, String &sMimeType ) : void
ParseRequest ( string sMyWebServerRoot, string sBuffer, string &sRequest, string &sRequestedFile, string &sErrorMessage, string &sLocalDir, string &sDirName, string &sPhysicalFilePath, string &sHttpVersion, string &sFileName, string &sMimeType, bool &bServe, string &errMessage, HttpRequest req ) : void
Populate ( dynamic item, object o ) : void
PopulateObject ( dynamic d, object o ) : void
PopulateResponse ( string resp, object o, string lc ) : dynamic
ProcessCommandInternal ( string sRequest ) : string
ProcessRequest ( string sBuffer, HttpRequest req ) : void
ReadCallback ( IAsyncResult result ) : void
SaveJson ( string sPhysicalFilePath, string sHttpVersion, string sBuffer, HttpRequest req ) : void
ScannerDeviceFound ( object sender, iSpyApplication.Server.DeviceFoundEventArgs e ) : void
ScannerScanFinished ( object sender, EventArgs e ) : void
SendAudioFeed ( System.Enums streamMode, String sBuffer, String sPhysicalFilePath, HttpRequest req ) : void
SendClip ( String sPhysicalFilePath, string sBuffer, string sHttpVersion, HttpRequest req, bool downloadFile ) : void
SendDesktop ( String sPhysicalFilePath, string sHttpVersion, HttpRequest req ) : void
SendFloorPlanFeed ( String sPhysicalFilePath, string sHttpVersion, HttpRequest req ) : void
SendGrab ( String sPhysicalFilePath, string sHttpVersion, HttpRequest req ) : void
SendHeader ( string sHttpVersion, string sMimeHeader, int iTotBytes, string sStatusCode, int cacheDays, HttpRequest req ) : bool
SendHeader ( string sHttpVersion, string sMimeHeader, int iTotBytes, string sStatusCode, int cacheDays, HttpRequest req, string fileName, bool gZip ) : bool
SendHeaderWithRange ( string sHttpVersion, string sMimeHeader, int iStartBytes, int iEndBytes, int iTotBytes, string sStatusCode, int cacheDays, HttpRequest req, string fileName ) : bool
SendImage ( String sPhysicalFilePath, string sHttpVersion, HttpRequest req ) : void
SendLiveFeed ( String sPhysicalFilePath, string sHttpVersion, HttpRequest req ) : void
SendLogFile ( string sHttpVersion, HttpRequest req ) : void
SendLogFile ( string sPhysicalFilePath, string sHttpVersion, HttpRequest req ) : void
SendMJPEGFeed ( String sPhysicalFilePath, HttpRequest req ) : void
ServeFile ( string sHttpVersion, string sFileName, String sMimeType, HttpRequest req ) : void
ServeNotFound ( string sHttpVersion, HttpRequest req ) : void
SetDesiredKeepAlive ( System.Net.Socket socket ) : void
SetKeepAlive ( System.Net.Socket s, bool on, uint time, uint interval ) : void
SetPropValue ( object src, string propName, object propValue ) : void
StartListen ( ) : void
TagUp ( string v ) : string
Translate ( string json, string lc ) : string
Translate ( dynamic &item, string lc ) : void
getJSONObject ( string sBuffer ) : dynamic

Method Details

DisconnectRequest() public method

public DisconnectRequest ( HttpRequest req ) : void
req HttpRequest
return void

Dispose() public method

public Dispose ( ) : void
return void

Dispose() protected method

protected Dispose ( bool disposing ) : void
disposing bool
return void

DoAcceptClientCallback() public method

public DoAcceptClientCallback ( IAsyncResult ar ) : void
ar IAsyncResult
return void

FormatBytes() public method

public FormatBytes ( long bytes ) : string
bytes long
return string

GetMimeType() public method

This function takes FileName as Input and returns the mime type..
public GetMimeType ( string sRequestedFile ) : string
sRequestedFile string To indentify the Mime Type
return string

ReloadAllowedIPs() public static method

public static ReloadAllowedIPs ( ) : void
return void

ReloadAllowedReferrers() public static method

public static ReloadAllowedReferrers ( ) : void
return void

SendResponse() public method

public SendResponse ( string sHttpVersion, string sMimeType, byte bData, string statusCode, int cacheDays, HttpRequest req, bool gZip = false ) : bool
sHttpVersion string
sMimeType string
bData byte
statusCode string
cacheDays int
req HttpRequest
gZip bool
return bool

SendResponse() public method

public SendResponse ( string sHttpVersion, string sMimeType, string sData, string statusCode, int cacheDays, HttpRequest req, bool gZip = false ) : bool
sHttpVersion string
sMimeType string
sData string
statusCode string
cacheDays int
req HttpRequest
gZip bool
return bool

SendToBrowser() public method

Sends data to the browser (client)
public SendToBrowser ( byte bSendData, HttpRequest req ) : bool
bSendData byte Byte Array
req HttpRequest HTTP Request
return bool

SendToBrowser() public method

public SendToBrowser ( string sData, HttpRequest req ) : bool
sData string
req HttpRequest
return bool

SendToBrowser() public method

Sends data to the browser (client)
public SendToBrowser ( byte bSendData, int datalength, HttpRequest req ) : void
bSendData byte Byte Array
datalength int
req HttpRequest HTTP Request
return void

StartServer() public method

public StartServer ( ) : string
return string

StopServer() public method

public StopServer ( ) : void
return void

ThumbnailCallback() public method

public ThumbnailCallback ( ) : bool
return bool

Property Details

ClientConnected public_oe static_oe property

public static AutoResetEvent,System.Threading ClientConnected
return System.Threading.AutoResetEvent

NumErr public_oe property

public int NumErr
return int

ServerRoot public_oe property

public string ServerRoot
return string

ServerStartupFailed public_oe property

public bool ServerStartupFailed
return bool

WebSocketServer public_oe property

public WebSocketServer,iSpyApplication.Server WebSocketServer
return iSpyApplication.Server.WebSocketServer