ArtemisComm.Connector.Send C# (CSharp) Method

Send() public method

public Send ( MemoryStream stream ) : void
stream System.IO.MemoryStream
return void
        public void Send(MemoryStream stream)
        {
            if (stream != null && stream.Length > 0)
            {

                stream.Position = 0;
                //try
                //{
                lock (SendQueue)
                {
                    SendQueue.Enqueue(stream.GetMemoryStream(0));
                }
                mreSender.Set();

                //}
                //catch (ArgumentException)
                //{ 
                //    //For some odd reason I'm getting an occasional ArgumentException:
                //    //Source array was not long enough. Check srcIndex and length, and the array's lower bounds.
                //    //This does not make sense, and there is nothing I can do to fix.  So I am choosing to ignore it,
                //    //  hoping that things will still work.


                //}
            }
        }
        //TODO: remove this routine in favor of the MemoryStream version.