title: IOS Parse LiveQuery: Error processing message: Optional(POSIXErrorCode: Software caused connection abort)
body: <p>I've developed an app in SwiftUI where I also use a chat with Parse LiveQuery.
  The chat is working perfectly in real time until the app goes in background or the phone screen is closed.
  If I receive a notification for a new message and I open the app from the notification then the LiveQuery stopes working and I recieve the error : &quot;Parse LiveQuery: Error processing message: Optional(POSIXErrorCode: Software caused connection abort)&quot;</p>
  <p>I register the Message class</p>
  <pre><code>class Message: PFObject, PFSubclassing {
      @NSManaged var message   : String
      @NSManaged var receiver  : PFObject
      @NSManaged var thread_id : PFObject
      @NSManaged var produs    : PFObject
      @NSManaged var sender    : PFObject
      @NSManaged var picture   : PFObject
  
      class func parseClassName() -&gt; String {
          return &quot;Message&quot;
      }
  }
  </code></pre>
  <p>On the ChatView I have .onReceive where I start the function for chat and liveQuery</p>
  <pre><code>                        var messagesQuery: PFQuery&lt;Message&gt; {
                              return (Message.query()?
                                          .whereKey(&quot;thread_id&quot;, equalTo: self.mainThread_obj)
                                          .order(byDescending: &quot;createdAt&quot;)) as! PFQuery&lt;Message&gt;
                          }
                          self.StartMessagesLiveQuery(messagesQuery: messagesQuery)
  </code></pre>
  <p>The func StartMessagesLiveQuery is:</p>
  <pre><code> let subscription: Subscription&lt;Message&gt; = Client.shared.subscribe(messagesQuery)        
          subscription.handle(Event.created) { query, object in
              print(&quot;Live Query Trigered&quot;)
              print(object)
              DispatchQueue.global(qos: .background).async {
                      ///reading object and appending to array}}
  </code></pre>
  <p>The only problem is when the app is opened from Notification.</p>
  <p>I've there any way to force ParseLiveQuery to reconnect?</p>
  <p>Error stack:</p>
  <pre><code>2021-03-03 10:15:47.442021+0200 App[35496:6350370] [connection] nw_read_request_report [C2] Receive failed with error &quot;Software caused connection abort&quot;
  2021-03-03 10:15:47.449044+0200 App[35496:6350370] [connection] nw_read_request_report [C3] Receive failed with error &quot;Software caused connection abort&quot;
  2021-03-03 10:15:47.449291+0200 App[35496:6350370] [connection] nw_read_request_report [C1] Receive failed with error &quot;Software caused connection abort&quot;
  2021-03-03 10:15:47.455008+0200 App[35496:6350370] [connection] nw_flow_add_write_request [C2.1 52.1.38.170:443 failed channel-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, dns)] cannot accept write requests
  2021-03-03 10:15:47.455055+0200 App[35496:6350370] [connection] nw_write_request_report [C2] Send failed with error &quot;Socket is not connected&quot;
  2021-03-03 10:15:47.455815+0200 App[35496:6350657] ParseLiveQuery: Error processing message: Optional(POSIXErrorCode: Software caused connection abort)
  2021-03-03 10:15:47.456612+0200 App[35496:6350370] Task &lt;F6A87098-D5D3-444B-B656-D1999D5089D1&gt;.&lt;44&gt; HTTP load failed, 42/0 bytes (error code: -1005 [1:53])
  2021-03-03 10:15:47.462120+0200 App[35496:6350657] Task &lt;F6A87098-D5D3-444B-B656-D1999D5089D1&gt;.&lt;44&gt; finished with error [-1005] Error Domain=NSURLErrorDomain Code=-1005 &quot;The network connection was lost.&quot; UserInfo={_kCFStreamErrorCodeKey=53, NSUnderlyingError=0x282d11830 {Error Domain=kCFErrorDomainCFNetwork Code=-1005 &quot;(null)&quot; UserInfo={NSErrorPeerAddressKey=&lt;CFData 0x280174aa0 [0x20a814660]&gt;{length = 16, capacity = 16, bytes = 0x100201bb344692570000000000000000}, _kCFStreamErrorCodeKey=53, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask &lt;F6A87098-D5D3-444B-B656-D1999D5089D1&gt;.&lt;44&gt;, _NSURLErrorRelatedURLSessionTaskErrorKey=(
      &quot;LocalDataTask &lt;F6A87098-D5D3-444B-B656-D1999D5089D1&gt;.&lt;44&gt;&quot;
  ), NSLocalizedDescription=The network connection was lost., NSErrorFailingURLStringKey=https://site.b4a.app/classes/_User, NSErrorFailingURLKey=https://site.b4a.app/classes/_User, _kCFStreamErrorDomainKey=1}
  2021-03-03 10:15:47.462237+0200 App[35496:6350657] [Error]: The network connection was lost. (Code: 100, Version: 1.19.1)
  2021-03-03 10:15:47.462335+0200 Bazar[35496:6350657] [Error]: Network connection failed. Making attempt 1 after sleeping for 1.588128 seconds.
  </code></pre>
  <p>After this the network connection is restored and the app is functional, only the LiveQuery are not working.</p>