Send() public method

public Send ( byte buf, int off, int len ) : void
buf byte
off int
len int
return void
            internal void SendToRecordLayer(DtlsRecordLayer recordLayer)
            {
                byte[] buffer = ((MemoryStream)this).GetBuffer();
                int    len    = (int)((Stream)this).get_Length();

                recordLayer.Send(buffer, 0, len);
                Platform.Dispose((Stream)(object)this);
            }
Ejemplo n.º 2
0
            internal void SendToRecordLayer(DtlsRecordLayer recordLayer)
            {
                byte[] buf    = ToArray();
                int    bufLen = buf.Length;

                recordLayer.Send(buf, 0, bufLen);
                Platform.Dispose(this);
            }
Ejemplo n.º 3
0
        public virtual void Send(byte[] buf, int off, int len)
        {
            if (null == buf)
            {
                throw new ArgumentNullException("buf");
            }
            if (off < 0 || off >= buf.Length)
            {
                throw new ArgumentException("invalid offset: " + off, "off");
            }
            if (len < 0 || len > buf.Length - off)
            {
                throw new ArgumentException("invalid length: " + len, "len");
            }

            try
            {
                mRecordLayer.Send(buf, off, len);
            }
            catch (TlsFatalAlert fatalAlert)
            {
                mRecordLayer.Fail(fatalAlert.AlertDescription);
                throw fatalAlert;
            }
            catch (TlsTimeoutException e)
            {
                throw e;
            }
#if !PORTABLE || DOTNET
            catch (SocketException e)
            {
                if (TlsUtilities.IsTimeout(e))
                {
                    throw e;
                }

                mRecordLayer.Fail(AlertDescription.internal_error);
                throw new TlsFatalAlert(AlertDescription.internal_error, e);
            }
#endif
            //catch (InterruptedIOException e)
            //{
            //    throw e;
            //}
            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);
            }
        }
Ejemplo n.º 4
0
            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);
            }
Ejemplo n.º 5
0
 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);
     }
 }
Ejemplo n.º 6
0
 public virtual void Send(byte[] buf, int off, int len)
 {
     //IL_0025: Expected O, but got Unknown
     try
     {
         mRecordLayer.Send(buf, off, len);
     }
     catch (TlsFatalAlert tlsFatalAlert)
     {
         mRecordLayer.Fail(tlsFatalAlert.AlertDescription);
         throw tlsFatalAlert;
     }
     catch (IOException val)
     {
         IOException val2 = val;
         mRecordLayer.Fail(80);
         throw val2;
     }
     catch (global::System.Exception alertCause)
     {
         mRecordLayer.Fail(80);
         throw new TlsFatalAlert(80, alertCause);
     }
 }
 internal void SendToRecordLayer(DtlsRecordLayer recordLayer)
 {
     recordLayer.Send(GetBuffer(), 0, (int)Length);
     this.Close();
 }
 internal void SendToRecordLayer(DtlsRecordLayer recordLayer)
 {
     recordLayer.Send(this.GetBuffer(), 0, (int)this.Length);
     this.Close();
 }
            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);
            }