drop() public method

public drop ( DropReason reason ) : void
reason DropReason
return void
コード例 #1
0
 /// <summary>
 ///     Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
 /// </summary>
 public void Dispose()
 {
     if (connection != null && !connection.dropped)
     {
         connection.drop(Connection.DropReason.Destructing);
         connection = null;
     }
 }
コード例 #2
0
 public void Dispose()
 {
     dropping = true;
     if (retry_timer != null)
     {
         ROS.timer_manager.RemoveTimer(ref retry_timer);
     }
     connection.drop(Connection.DropReason.Destructing);
 }
コード例 #3
0
 public virtual void drop()
 {
     if (connection.sendingHeaderError)
     {
         connection.DroppedEvent -= onConnectionDropped;
     }
     else
     {
         connection.drop(Connection.DropReason.Destructing);
     }
 }
コード例 #4
0
        private void processNextCall()
        {
            bool empty = false;

            lock (call_queue_mutex)
            {
                if (current_call != null)
                {
                    return;
                }
                if (call_queue.Count > 0)
                {
                    current_call = call_queue.Dequeue();
                }
                else
                {
                    empty = true;
                }
            }
            if (empty)
            {
                if (persistent)
                {
                    connection.drop(Connection.DropReason.Destructing);
                }
            }
            else
            {
                IRosMessage request;
                lock (call_queue_mutex)
                {
                    request = current_call.req;
                }
                request.Serialize();
                connection.write(request.Serialized, (uint)request.Serialized.Length, onRequestWritten);
            }
        }
コード例 #5
0
        private void onHeaderLengthRead(Connection conn, ref byte[] data, uint size, bool success)
        {
            if (conn != this)
            {
                throw new Exception("THAT EVENT IS NOT FOR MEEE!");
            }
            if (size != 4)
            {
                throw new Exception("THAT SIZE ISN'T 4! SDKJSDLKJHSDLKJSHD");
            }
            if (!success)
            {
                return;
            }
            uint len = BitConverter.ToUInt32(data, 0);

            if (len > 1000000000)
            {
                conn.drop(DropReason.HeaderError);
            }
            read(len, onHeaderRead);
        }
コード例 #6
0
ファイル: Connection.cs プロジェクト: christlurker/ROS.NET
 private void onHeaderLengthRead(Connection conn, ref byte[] data, uint size, bool success)
 {
     if (conn != this) throw new Exception("THAT EVENT IS NOT FOR MEEE!");
     if (size != 4) throw new Exception("THAT SIZE ISN'T 4! SDKJSDLKJHSDLKJSHD");
     if (!success)
     {
         return;
     }
     uint len = BitConverter.ToUInt32(data, 0);
     if (len > 1000000000)
     {
         conn.drop(DropReason.HeaderError);
     }
     read(len, onHeaderRead);
 }