WIFI upload speed C# vs Android Java -
i working on wifi boot loader embedded device. working fine, want increase speed. have c# client , android client device acting server. embedded device rather slow clients must sleep between data records while device writes program memory. here strange part: required sleep windows c# client 300ms while 800ms android. less of wait causes server send error. results in 8 minute operation in c# , 21 minutes in android. why this?
here loop in c#:
(int line = 0; line < lines.count; line++) { if (lines[line].startswith(";")) break; byte[] sbytes = encoding.ascii.getbytes(lines[line]); gstream.write(sbytes, 0, sbytes.length); textboxterminal.appendtext(lines[line]); textboxterminal.appendtext("\n"); application.doevents(); wait(300); if (gstream.dataavailable) break; }
here in android java:
while((data = br.readline()) != null) { if (data.startswith(";")) break; dataoutputstream.writebytes(data + "\r"); lines++; mdata = lines + " lines of " + tlines + " sent"; mhandler.post(mshowdata); dataoutputstream.flush(); thread.sleep(800); if (inputstream.available() > 0) break; }
Comments
Post a Comment