-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
conn is null #10
Comments
I also encountered the same error. # My deno environment
$ deno --version
deno 1.23.0 (release, aarch64-apple-darwin)
v8 10.4.132.5
typescript 4.7.2 I debugged it and found that rewriting the code like this eliminated the error, but this is not a fundamental solution. diff --git a/client.ts b/client.ts
index 4a13ce2..f802ae5 100644
--- a/client.ts
+++ b/client.ts
@@ -166,7 +166,7 @@ export class GrpcClientImpl implements GrpcClient {
while (this.frames.length) {
const f = this.frames.shift();
- if (!f) {
+ if (f.type === "WINDOW_UPDATE" && f.window_size % 24 === 0) {
break;
}
await this.sendFrame(f); I have not been able to get to the specific solution as I still do not understand the relevant processes in the project. |
Thank you. still f is possibly be null. Is this better? const f = this.frames.shift!(); |
Wow, cool! |
Hi, I also have same problem. |
Thanks for the comment. Sounds good! |
I know another issue that occur errors when client is closed. Will it be fixed by the change? package main
import (
"context"
"fmt"
"log"
"github.com/mattn/grpc-deno-go/greeter"
"google.golang.org/grpc"
)
func main() {
conn, err := grpc.Dial("127.0.0.1:15070", grpc.WithInsecure())
if err != nil {
log.Fatal(err)
}
defer conn.Close()
client := greeter.NewGreeterClient(conn)
req := greeter.HelloRequest{Name: "mattn"}
reply, err := client.SayHello(context.Background(), &req)
if err != nil {
log.Fatal(err)
}
fmt.Println(reply)
stream, err := client.ShoutHello(context.Background(), &req)
defer stream.CloseSend()
for {
reply, err := stream.Recv()
if err != nil {
break
}
fmt.Println(reply)
}
} |
@mattn |
Sorry for long response. Most of these errors caused by excesive console logging during development stage. Fixed (actually muted) them at https://github.com/prohazko2/deno-grpc/tree/0.4.6 |
Also, if You are planning to use gPRC on Deno - consider tracking denoland/deno#3326 issue from Deno team, because this project (deno-grpc) is not actively maintained right now |
Hi, I'm trying to use this on Windows. client.ts on README.md works good with SayHello but ShoutHello does not.
The text was updated successfully, but these errors were encountered: