private static void StartClient()
{
th_cli = new Thread (delegate() {
try
{
ConsoleAdditives.WriteHeader("Stream started");
Capture cap = new Capture();
while(_isRunning) {
byte[] buf = cap.QueryGrayFrame().Bytes;
int buflp = buf.Length/5;
for(byte i=0;i<5;i++)
{
byte[] tbuf = new byte[buflp];
tbuf[0]=i;
for(int j=1;j<buflp;j++)
{
tbuf[j]=buf[i*buflp+j];
}
client.Send(tbuf,buflp,remoteEP);
}
}
ConsoleAdditives.WriteHeader("Stream stoped");
}
catch(Exception ex)
{
Console.WriteLine(ex.ToString());
}
});
th_cli.Start ();
}