change package of proto and method name of service
to comply with tonic, grpc implementation in rust
This commit is contained in:
@ -197,7 +197,7 @@ func (client *SignalClient) ConnectServer(ctx context.Context) {
|
||||
|
||||
client.Program.Send(systemMsg("Connecting to room..."))
|
||||
signal_server := proto.NewSignalingClient(grpcClient)
|
||||
stream, err := signal_server.Connect(context.Background())
|
||||
stream, err := signal_server.Biu(context.Background())
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@ -206,7 +206,7 @@ func (client *SignalClient) ConnectServer(ctx context.Context) {
|
||||
go client.HandleConnection(ctx, grpcClient, stream)
|
||||
}
|
||||
|
||||
func (client *SignalClient) HandleConnection(ctx context.Context, grpcClient *grpc.ClientConn, stream proto.Signaling_ConnectClient) {
|
||||
func (client *SignalClient) HandleConnection(ctx context.Context, grpcClient *grpc.ClientConn, stream proto.Signaling_BiuClient) {
|
||||
defer grpcClient.Close()
|
||||
room := client.Room
|
||||
clientId := client.Name
|
||||
@ -226,6 +226,9 @@ func (client *SignalClient) HandleConnection(ctx context.Context, grpcClient *gr
|
||||
if err == io.EOF {
|
||||
break
|
||||
}
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
switch inner := msg.Message.(type) {
|
||||
case *proto.SignalingMessage_Bootstrap:
|
||||
client.OnBootstrapReady(ctx, stream, room, clientId)
|
||||
@ -241,7 +244,7 @@ func (client *SignalClient) HandleConnection(ctx context.Context, grpcClient *gr
|
||||
}
|
||||
}
|
||||
|
||||
func (client *SignalClient) OnBootstrapReady(ctx context.Context, stream proto.Signaling_ConnectClient, room, name string) {
|
||||
func (client *SignalClient) OnBootstrapReady(ctx context.Context, stream proto.Signaling_BiuClient, room, name string) {
|
||||
client.Program.Send(systemMsg("Server ready!"))
|
||||
stream.Send(&proto.SignalingMessage{
|
||||
Room: room,
|
||||
@ -250,7 +253,7 @@ func (client *SignalClient) OnBootstrapReady(ctx context.Context, stream proto.S
|
||||
})
|
||||
}
|
||||
|
||||
func (client *SignalClient) OnDiscoverRequest(ctx context.Context, stream proto.Signaling_ConnectClient, room, name, sender string) {
|
||||
func (client *SignalClient) OnDiscoverRequest(ctx context.Context, stream proto.Signaling_BiuClient, room, name, sender string) {
|
||||
client.Program.Send(systemMsg("Client " + sender + " is joining into the room " + room))
|
||||
stream.Send(&proto.SignalingMessage{
|
||||
Room: room,
|
||||
@ -260,7 +263,7 @@ func (client *SignalClient) OnDiscoverRequest(ctx context.Context, stream proto.
|
||||
})
|
||||
}
|
||||
|
||||
func (client *SignalClient) OnDiscoverResponse(ctx context.Context, stream proto.Signaling_ConnectClient, room, name, sender string) {
|
||||
func (client *SignalClient) OnDiscoverResponse(ctx context.Context, stream proto.Signaling_BiuClient, room, name, sender string) {
|
||||
client.Program.Send(systemMsg("Client " + sender + " ponged"))
|
||||
|
||||
peerConnection, err := client.GetOrCreatePeerConnection(sender)
|
||||
@ -306,7 +309,7 @@ func (client *SignalClient) OnDiscoverResponse(ctx context.Context, stream proto
|
||||
})
|
||||
}
|
||||
|
||||
func (client *SignalClient) OnOffer(ctx context.Context, stream proto.Signaling_ConnectClient, room, name, sender, sdp string) {
|
||||
func (client *SignalClient) OnOffer(ctx context.Context, stream proto.Signaling_BiuClient, room, name, sender, sdp string) {
|
||||
client.Program.Send(systemMsg("Client " + sender + " is offering"))
|
||||
|
||||
peerConnection, err := client.GetOrCreatePeerConnection(sender)
|
||||
|
Reference in New Issue
Block a user