Comments (6)
Yes, this stuff is definitely a work in progress! The whole Channel/Communication setup needs to be ironed out completely and tested fully....
from agent.contrib.
I'd also push the buffer out to the class level and preallocate it, for performance. Less GC and frag.
from agent.contrib.
Why close the issue if the code is still fragile/incomplete?
from agent.contrib.
Hit the wrong button.. :p
from agent.contrib.
This should do it...
protected byte[] GetBytes(SerialPort port)
{
byte[] buffer = new byte[port.BytesToRead];
port.Read(buffer, 0, buffer.Length);
return buffer;
}
seems simple enough..
what do you think?
from agent.contrib.
Could run out of memory quickly. Think 57.6k for example, 1+ seconds. Otherwise it is simply correct.
In my testing on the emulator, despite either timer polling or DataReceived, sometimes a stall occurred for a few seconds.
No doubt with an OS the AGENT may too.
Safer to use a limit, allowing User to tweak it.
Sent from my Kindle Fire
From: Rob Chartier [email protected]
Sent: Fri Jul 12 22:57:50 CST 2013
To: "nothingmn/AGENT.Contrib" [email protected]
Cc: Chris Meier [email protected]
Subject: Re: [AGENT.Contrib] BaseChannel/GetBytes, buffer overrun potential (#9)
This should do it...
protected byte[] GetBytes(SerialPort port) { byte[] buffer = new byte[port.BytesToRead]; port.Read(buffer, 0, buffer.Length); return buffer; }
seems simple enough..
what do you think?
—
Reply to this email directly or view it on GitHub.
from agent.contrib.
Related Issues (2)
- OutOfMemoryException. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from agent.contrib.