CVB.Net 14.0
Stream Class Reference

The stream to send Images or other data. More...

Public Member Functions

void Send (Image image, Action imageReleased=null)
 Sends the given image to the remote client. More...
 
bool TrySend (Image image, Action imageReleased=null)
 Tries to send the given image to the remote client. More...
 
void Send (ImageBufferDescription bufferDescription, IntPtr basePtr, long bufferSize, Action bufferReleased)
 Sends the image at the given basePtr . More...
 
bool TrySend (ImageBufferDescription bufferDescription, IntPtr basePtr, long bufferSize, Action bufferReleased)
 Tries to send the image at the given basePtr . More...
 

Properties

GevServer Parent [get]
 Gets the parent server object.
 
bool IsRunning [get]
 Gets whether this stream is running. More...
 
int ResendBuffersCount [get, set]
 Gets or sets the number of resend buffers. More...
 

Detailed Description

The stream to send Images or other data.

Member Function Documentation

◆ Send() [1/2]

void Send ( Image  image,
Action  imageReleased = null 
)

Sends the given image to the remote client.

The given image must fit into the payload size set at creation/GevServerState.Configuration state.

If packet resend is enabled (ResendBuffersCount larger than zero), then the given image must remain unchanged until imageReleased has been called! In case packet resend is disabled imageReleased will be called immediately.

Parameters
imageImage to be sent.
imageReleasedDelegate to be called when the given image is not needed anymore for packet resend. If null the image will be copied to the resend buffer.

◆ Send() [2/2]

void Send ( ImageBufferDescription  bufferDescription,
IntPtr  basePtr,
long  bufferSize,
Action  bufferReleased 
)

Sends the image at the given basePtr .

The given image buffer must fit into the payload size set at creation/GevServerState.Configuration state.

If packet resend is enabled (ResendBuffersCount larger than zero), then the given image buffer must remain unchanged until bufferReleased has been called! In case packet resend is disabled bufferReleased will be called immediately.

Parameters
bufferDescriptionDescription of the image at basePtr .
basePtrAddress of the image buffer to send.
bufferSizeLength in bytes of the buffer at basePtr .
bufferReleasedMandatory delegate to be called when the given image buffer is not needed anymore for packet resend.

◆ TrySend() [1/2]

bool TrySend ( Image  image,
Action  imageReleased = null 
)

Tries to send the given image to the remote client.

The given image must fit into the payload size set at creation/GevServerState.Configuration state.

If packet resend is enabled (ResendBuffersCount larger than zero), then the given image must remain unchanged until imageReleased has been called! In case packet resend is disabled imageReleased will be called immediately.

Parameters
imageImage to be sent.
imageReleasedDelegate to be called when the given image is not needed anymore for packet resend. If null the image will be copied to the resend buffer.
Returns
true if successfully sent; false on any error. Parameter errors and disposed exception will still be thrown.

◆ TrySend() [2/2]

bool TrySend ( ImageBufferDescription  bufferDescription,
IntPtr  basePtr,
long  bufferSize,
Action  bufferReleased 
)

Tries to send the image at the given basePtr .

Parameters
bufferDescriptionDescription of the image at basePtr .
basePtrAddress of the image buffer to send.
bufferSizeLength in bytes of the buffer at basePtr .
bufferReleasedDelegate to be called when the given image buffer is not needed anymore for packet resend.
Returns
true if successfully sent; false on any error. Parameter errors and disposed exception will still be thrown.

Property Documentation

◆ IsRunning

bool IsRunning
get

Gets whether this stream is running.

Streaming can only be enabled by the remote client. Send is only possible as long as the stream is active (running).

Note that acquisition start/stop is an asynchronous action without any means to synchronize. Use the TrySend methods to avoid exceptions.

true if Parent's GevServer.State is GevServerState.AcquisitionEnabled; false otherwise.

◆ ResendBuffersCount

int ResendBuffersCount
getset

Gets or sets the number of resend buffers.

This number specifies for how many full frames a packet resend can be done; set to 0 if no packet resend is to be supported.

This property can only be change if the parent is in GevServerState.Configuration GevServer.State.