ClientAbortException: java.net. SocketException: Соединение сбрасывается одноранговым узлом: ошибка при записи сокета [дубликат]

Swift 4 - Создайте CustomWindow в вашем AppDelegate.swift, который просматривает ваши раскадровки, который регистрирует касания, но не отменяет их. Код:

import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate{

var topWindow: CustomWindow?

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        topWindow = CustomWindow(frame: UIScreen.main.bounds)
        topWindow?.rootViewController = UIViewController()
        topWindow?.windowLevel = UIWindowLevelNormal + 1
        topWindow?.isHidden = false
    }

Создайте класс CustomWindow.swift, который получает ваши действия и обрабатывает их. Код:

import UIKit

class CustomWindow: UIWindow{

    override func point(inside point: CGPoint, with event: UIEvent?) -> Bool {
        // What you want to do in here.
        return false
    }
17
задан ROMANIA_engineer 11 January 2016 в 12:13
поделиться

1 ответ

Ваш HTTP-клиент отключен.

У этого может быть несколько причин:

  • Ответ на запрос занял слишком много времени, клиент отказался
  • Вы ответили чем-то, что клиент не понял
  • Конечный пользователь фактически отменил запрос
  • Произошла сетевая ошибка
  • ... вероятно, больше

Вы можете довольно легко эмулировать поведение:

URL url = new URL("http://example.com/path/to/the/file");

int numberOfBytesToRead = 200;

byte[] buffer = new byte[numberOfBytesToRead];
int numberOfBytesRead = url.openStream().read(buffer);
33
ответ дан 30 November 2019 в 11:32
поделиться
Другие вопросы по тегам:

Похожие вопросы: