changeset 264:cb0d6aab498d main

Reduce the waiting time when polling for messages to receive, send
author Bob Cook <bob@bobcookdev.com>
date Fri, 25 Mar 2016 12:09:41 -0700
parents 51f23203883c
children 1d246b3260c4
files main/packages/linux/can/CANMsgProcessor.cpp
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/main/packages/linux/can/CANMsgProcessor.cpp	Sun Oct 25 13:44:20 2015 -0700
+++ b/main/packages/linux/can/CANMsgProcessor.cpp	Fri Mar 25 12:09:41 2016 -0700
@@ -9,7 +9,7 @@
 //  into a global queue for processing by other threads. Messages are pulled from another
 //  global queue for writing to the socket.
 //
-//  Copyright (c) 2011 Bob Cook
+//  Copyright (c) 2011-2016 Bob Cook
 //
 //  Permission is hereby granted, free of charge, to any person obtaining a copy
 //  of this software and associated documentation files (the "Software"), to deal
@@ -111,8 +111,8 @@
             CANSocket sock;
             sock.bind( m_canInterfaceName );
 
-            Poco::Timespan pollDelay( 100 * 1000 ); // 100ms
-            Poco::Timespan writeWaitTime( 100 * 1000 );
+            Poco::Timespan pollDelay( 100 ); // 0.1ms
+            Poco::Timespan writeWaitTime( 1 * 1000 ); // 1ms
 
             for ( ;; )
             {
@@ -134,7 +134,7 @@
 
                 // handle queued writes
 
-                Poco::AutoPtr<CANMessage> msg( CANMessage::WaitDequeueToSend( 100 ) ); // 100ms
+                Poco::AutoPtr<CANMessage> msg( CANMessage::WaitDequeueToSend( 0 ) );
 
                 if ( msg.get() != 0 )
                 {