MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / StartStream

Method StartStream

pkg/jobmanager/jobmanager.go:353–377  ·  view source on GitHub ↗
(msc *MainServerConn)

Source from the content-addressed store, hash-verified

351}
352
353func (jm *JobManager) StartStream(msc *MainServerConn) error {
354 jm.lock.Lock()
355 defer jm.lock.Unlock()
356
357 if jm.Cmd == nil {
358 return fmt.Errorf("job not started")
359 }
360 if jm.pendingStreamMeta == nil {
361 return fmt.Errorf("no pending stream (call PrepareConnect first)")
362 }
363
364 err := msc.WshRpc.StreamBroker.AttachStreamWriter(jm.pendingStreamMeta, jm.StreamManager)
365 if err != nil {
366 return fmt.Errorf("failed to attach stream writer: %w", err)
367 }
368
369 err = jm.StreamManager.SetRwndSize(int(jm.pendingStreamMeta.RWnd))
370 if err != nil {
371 return fmt.Errorf("failed to set rwnd size: %w", err)
372 }
373
374 log.Printf("StartStream: streamid=%s rwnd=%d streaming started\n", jm.pendingStreamMeta.Id, jm.pendingStreamMeta.RWnd)
375 jm.pendingStreamMeta = nil
376 return nil
377}
378
379func MakeJobDomainSocket(clientId string, jobId string) error {
380 socketDir := filepath.Join("/tmp", fmt.Sprintf("waveterm-%d", os.Getuid()))

Callers 1

JobStartStreamCommandMethod · 0.80

Calls 2

AttachStreamWriterMethod · 0.80
SetRwndSizeMethod · 0.80

Tested by

no test coverage detected