12-21-2016, 09:08 AM
How to solve ?
[SRC="csharp"] private void OnReceiveCallback(IAsyncResult result)
{
this._stream.EndRead(result);
byte[] data = new byte[(int)this._buffer.Length];
this._buffer.CopyTo(data, 0);
if ((int)data.Length >= 2)
{
this.handlePacket(this.decryptC(data, (int)data.Length));
}
(new Thread(new ThreadStart(this.read))).Start();
}
private void OnReceiveCallbackStatic(IAsyncResult result)
{
try
{
if (this._stream.EndRead(result) > 0)
{
byte num = this._buffer[0];
if (this._stream.DataAvailable)
{
this._buffer = new byte[num + 2];
this._stream.BeginRead(this._buffer, 0, num + 2, new AsyncCallback(this.OnReceiveCallback), result.AsyncState);
}
}
else
{
return;
}
}
catch (Exception exception)
{
Exception ex = exception;
CLogger instance = CLogger.getInstance();
object[] objArray = new object[] { DateTime.Now.ToString("[ HH.mm.ss | dd/MM/yyyy ] - ") + "[LC] : ", this._address, " Foi Fechado a Força: ", ex };
instance.Warning(string.Concat(objArray));
this.close();
}
}[/SRC]
http://imgur.com/a/mJB9E
[SRC="csharp"] private void OnReceiveCallback(IAsyncResult result)
{
this._stream.EndRead(result);
byte[] data = new byte[(int)this._buffer.Length];
this._buffer.CopyTo(data, 0);
if ((int)data.Length >= 2)
{
this.handlePacket(this.decryptC(data, (int)data.Length));
}
(new Thread(new ThreadStart(this.read))).Start();
}
private void OnReceiveCallbackStatic(IAsyncResult result)
{
try
{
if (this._stream.EndRead(result) > 0)
{
byte num = this._buffer[0];
if (this._stream.DataAvailable)
{
this._buffer = new byte[num + 2];
this._stream.BeginRead(this._buffer, 0, num + 2, new AsyncCallback(this.OnReceiveCallback), result.AsyncState);
}
}
else
{
return;
}
}
catch (Exception exception)
{
Exception ex = exception;
CLogger instance = CLogger.getInstance();
object[] objArray = new object[] { DateTime.Now.ToString("[ HH.mm.ss | dd/MM/yyyy ] - ") + "[LC] : ", this._address, " Foi Fechado a Força: ", ex };
instance.Warning(string.Concat(objArray));
this.close();
}
}[/SRC]
http://imgur.com/a/mJB9E