Comments (5)
cc @sigurdm, any idea what's going on here?
from grpc-dart.
I think I need to know more about the type of stub
and the implementation of postImage
to really help here. You are right that it looks like you are using the first byte as a method name. You should be calling a named remote method with the content as a parameter.
As a side-comment, I think your chunkFileBytes
has a mistake in the second if-statement. It should be outside the for-loop I think. Otherwise it will send chunks of length '1, 2, 3, 4...'.
from grpc-dart.
Nice catch on the chunkFileBytes
function @sigurdm
Some extra details on the stub, I have a service declared as
service PostService {
rpc PostImage (stream ImageRequest) returns (PostResponse) {
}
}
And the respective messages
message ImageRequest {
bytes content = 1;
}
message PostResponse {
string id = 1;
string url = 2;
}
from grpc-dart.
An update, seems like that last block I have over here, that @sigurdm pointed out
if (counter > 0) {
var req = new ImageRequest();
req.content = buffer;
yield req;
}
which probably has a different size is the problem, in the main loop I can actually stream and send full 1024 chunks, but the very last chunk throws the error, I'm assuming there's a termination character that I'm getting from dart that I'm trying to pass to grpc which should probably be handled differently?
Strangely the last byte of that stream si 217
so I don't think that is the problem, the complaint from grpc is that a byte 255 was passed
last two bytes of the chunk in case it's relevant and mean something I'm missing
flutter: LAST BYTE 255
flutter: LAST BYTE 217
from grpc-dart.
The problem was I was trying to send a buffer of size 1024 with only 462 bytes populated, I just had to build a buffer of the right size, before passing it to grpc
from grpc-dart.
Related Issues (20)
- [help needed] Use generated service methods to process gRPC-web data. HOT 2
- Is ResponseStream.cancel supposed to update ServiceCall.isCancelled? HOT 1
- Repeated requests in a loop with a timeout. GRPC DEADLINE_EXCEEDED -> Next request HTTP/2 error: (errorCode: 1) HOT 5
- Support .map() that returns ResponseStream instead of Stream HOT 4
- Reconnect logic HOT 7
- `timeline_test` failure on Windows. HOT 3
- Track some specific request using ClientCall HOT 3
- Replace `package:archive` use by `dart:io` and `DecompressionStream`
- #703 broke grpc interop testing HOT 7
- Is it possible to expose stream state to the app? It's vital for tracking http2 requests and make appropriate reconnect logic etc.... HOT 19
- Question: Best practice for using ClientChannel HOT 4
- Question: How to implement a ClientInterceptor with async body
- Migrate off legacy JS/HTML apis HOT 7
- Grpc connect to some site and fail on some HOT 4
- Streaming issue on web only HOT 1
- Creating GrpcOrGrpcWebChannel always throws `UnsupportedError('not supported by gRPC-web') HOT 1
- ClientChannel has no way to trigger a connection to the server if no RPC is being invoked HOT 5
- Error connecting: Unsupported operation: Socket constructor (WASM) HOT 1
- Awaiting ResponseFuture.headers hangs indefinetly for not implemented services HOT 1
- Exceptions thrown without stack traces 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 grpc-dart.