Moc signal message support

This commit is contained in:
Zoltán Papp 2024-06-19 18:40:49 +02:00
parent 4f890ff712
commit c7db2c0524

View File

@ -117,6 +117,10 @@ func (h *Handshaker) Handshake(args HandshakeArgs) (*OfferAnswer, error) {
// OnRemoteOffer handles an offer from the remote peer and returns true if the message was accepted, false otherwise // OnRemoteOffer handles an offer from the remote peer and returns true if the message was accepted, false otherwise
// doesn't block, discards the message if connection wasn't ready // doesn't block, discards the message if connection wasn't ready
func (h *Handshaker) OnRemoteOffer(offer OfferAnswer) bool { func (h *Handshaker) OnRemoteOffer(offer OfferAnswer) bool {
// todo remove this if signaling can support relay
if ForcedRelayAddress() != "" {
offer.RelaySrvAddress = ForcedRelayAddress()
}
select { select {
case h.remoteOffersCh <- offer: case h.remoteOffersCh <- offer:
return true return true
@ -130,6 +134,10 @@ func (h *Handshaker) OnRemoteOffer(offer OfferAnswer) bool {
// OnRemoteAnswer handles an offer from the remote peer and returns true if the message was accepted, false otherwise // OnRemoteAnswer handles an offer from the remote peer and returns true if the message was accepted, false otherwise
// doesn't block, discards the message if connection wasn't ready // doesn't block, discards the message if connection wasn't ready
func (h *Handshaker) OnRemoteAnswer(answer OfferAnswer) bool { func (h *Handshaker) OnRemoteAnswer(answer OfferAnswer) bool {
// todo remove this if signaling can support relay
if ForcedRelayAddress() != "" {
answer.RelaySrvAddress = ForcedRelayAddress()
}
select { select {
case h.remoteAnswerCh <- answer: case h.remoteAnswerCh <- answer:
return true return true