MCPcopy Index your code
hub / github.com/TensorWorks/Unreal-PixelStreaming-RTP-Bridge / sendOffer

Function sendOffer

main.go:246–258  ·  view source on GitHub ↗

Send an "offer" string over websocket to Unreal Engine to start the WebRTC handshake.

(wsConn *websocket.Conn, peerConnection *webrtc.PeerConnection)

Source from the content-addressed store, hash-verified

244
245// Send an "offer" string over websocket to Unreal Engine to start the WebRTC handshake.
246func sendOffer(wsConn *websocket.Conn, peerConnection *webrtc.PeerConnection) {
247
248 offerString, err := createOffer(peerConnection)
249
250 if err != nil {
251 log.Printf("Error creating offer. Error: %s", err.Error())
252 } else {
253 // Write our offer over websocket: "{"type":"offer","sdp":"v=0\r\no=- 2927396662845926191 2 IN IP4 127.0.0.1....."
254 writeWSMessage(wsConn, offerString)
255 fmt.Println("Sending offer...")
256 fmt.Println(offerString)
257 }
258}
259
260// Send our local ICE candidate to Unreal Engine using websockets.
261func sendLocalIceCandidate(wsConn *websocket.Conn, localIceCandidate *webrtc.ICECandidate) {

Callers 1

mainFunction · 0.85

Calls 2

createOfferFunction · 0.85
writeWSMessageFunction · 0.85

Tested by

no test coverage detected