diff --git a/ios/forward/forward.go b/ios/forward/forward.go index a630af31..a2be38c3 100644 --- a/ios/forward/forward.go +++ b/ios/forward/forward.go @@ -22,12 +22,12 @@ func Forward(device ios.DeviceEntry, hostPort uint16, phonePort uint16) error { log.Infof("Start listening on port %d forwarding to port %d on device", hostPort, phonePort) l, err := net.Listen("tcp", fmt.Sprintf("0.0.0.0:%d", hostPort)) - go connectionAccept(l, device.DeviceID, phonePort) - if err != nil { return err } + go connectionAccept(l, device.DeviceID, phonePort) + return nil } diff --git a/main.go b/main.go index 64c57e3f..76c2b32d 100644 --- a/main.go +++ b/main.go @@ -1096,7 +1096,8 @@ func handleProfileList(device ios.DeviceEntry) { } func startForwarding(device ios.DeviceEntry, hostPort int, targetPort int) { - forward.Forward(device, uint16(hostPort), uint16(targetPort)) + err := forward.Forward(device, uint16(hostPort), uint16(targetPort)) + exitIfError("failed to forward port", err) c := make(chan os.Signal, 1) signal.Notify(c, os.Interrupt) <-c