Hello,

I use an objective c client and the server is go, when I try to stream from 
the server to the client I encounter this problem, do you have any idea 
why? Thank you very much

Error: SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER
Proto: 
service Event {
rpc eventSubscription ( stream eventRequest) returns ( stream 
eventResponse) {}
rpc listFeatures(eventRequest) returns (stream eventResponse) {}
}

message eventRequest {
string id = 1;
}

message eventResponse {
string id = 1;
string key = 2;
string value = 3;
}

ObjC code:
#import <Foundation/Foundation.h>
#import <GRPCClient/GRPCCall+Tests.h>
#import "GrpcService.h"
#import <GrpcService/Event.pbrpc.h>

static NSString * const hostAddress = @"localhost:50052";
RCT_EXPORT_METHOD(stream:(NSString *)name)
{
[GRPCCall useInsecureConnectionsForHost:hostAddress];
CPHWEvent *client = [[CPHWEvent alloc] initWithHost:hostAddress];
CPHWeventRequest *request = [CPHWeventRequest message];
GRPCUnaryResponseHandler *handler =
[[GRPCUnaryResponseHandler alloc] initWithResponseHandler:
^(CPHWeventResponse *response, NSError *error) {
if (response) {
NSLog(@"%@", response);
} else {

}
} responseDispatchQueue:nil];

GRPCUnaryProtoCall *call = [client listFeaturesWithMessage:request 
responseHandler:handler callOptions:nil];

[call start];
}

Go code:
func (s *Server) EventSubscription(stream 
pbEvent.Event_EventSubscriptionServer) error {
log.Println("Started stream")
var length int
length = len(global.TestStrings)
for {
TestStrings := global.TestStrings

if len(TestStrings) > length {
response := &pbEvent.EventResponse{
Id: TestStrings[length].Id,
Value: TestStrings[length].Value,
Key: TestStrings[length].Key,
}

if err := stream.Send(response); err != nil {
log.Println(err)
} else {
log.Println("send...")
//global.TestStrings = append(global.TestStrings[:0], 
global.TestStrings[1:]...)
length++
}
}
}


-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/f49d05a9-1589-4e53-9f2a-6b7d04ad5d97n%40googlegroups.com.

Reply via email to