MCPcopy Create free account
hub / github.com/livekit/livekit / handleDataMessage

Method handleDataMessage

test/client/client.go:1138–1150  ·  view source on GitHub ↗
(kind livekit.DataPacket_Kind, data []byte)

Source from the content-addressed store, hash-verified

1136}
1137
1138func (c *RTCClient) handleDataMessage(kind livekit.DataPacket_Kind, data []byte) {
1139 dp := &livekit.DataPacket{}
1140 err := proto.Unmarshal(data, dp)
1141 if err != nil {
1142 return
1143 }
1144 dp.Kind = kind
1145 if val, ok := dp.Value.(*livekit.DataPacket_User); ok {
1146 if c.OnDataReceived != nil {
1147 c.OnDataReceived(val.User.Payload, val.User.ParticipantSid)
1148 }
1149 }
1150}
1151
1152func (c *RTCClient) handleDataMessageUnlabeled(data []byte) {
1153 if c.OnDataUnlabeledReceived != nil {

Callers

nothing calls this directly

Calls 1

UnmarshalMethod · 0.45

Tested by

no test coverage detected