internal void SendToRecordLayer(DtlsRecordLayer recordLayer) { #if PORTABLE byte[] buf = ToArray(); int bufLen = buf.Length; #else byte[] buf = GetBuffer(); int bufLen = (int)Length; #endif recordLayer.Send(buf, 0, bufLen); Platform.Dispose(this); }
public virtual void Send(byte[] buf, int off, int len) { try { mRecordLayer.Send(buf, off, len); } catch (TlsFatalAlert fatalAlert) { mRecordLayer.Fail(fatalAlert.AlertDescription); throw fatalAlert; } catch (IOException e) { mRecordLayer.Fail(AlertDescription.internal_error); throw e; } catch (Exception e) { mRecordLayer.Fail(AlertDescription.internal_error); throw new TlsFatalAlert(AlertDescription.internal_error, e); } }