无法使用fetch在typescript中设置arrayList

时间:2017-06-02 09:19:58

标签: javascript java json typescript nativescript

我无法使用fetch方法在vehiculeList中设置我的vehicule对象。

Socket socket = new Socket(hostName, portNumber);
    TlsClientProtocol protocol = new TlsClientProtocol(socket.getInputStream(), socket.getOutputStream(),new SecureRandom());

    // client
    DefaultTlsClient client = new DefaultTlsClient() {
        // getAuthentication should be implemented
        public TlsAuthentication getAuthentication() throws IOException {

            TlsAuthentication auth = new TlsAuthentication() {
                // Capture the server certificate information!

                // Called by the protocol handler to report the server certificate Note: this method is responsible for certificate verification and validation
                public void notifyServerCertificate(org.bouncycastle.crypto.tls.Certificate serverCertificate) throws IOException {
                }

                // Return client credentials in response to server's certificate request
                public TlsCredentials getClientCredentials(CertificateRequest certificateRequest) throws IOException {


                    return null;
                }
            };
            return auth;
        }
    };
    protocol.connect(client);


    try (
            PrintWriter out = new PrintWriter(socket.getOutputStream(), true);
            BufferedReader in = new BufferedReader(
                new InputStreamReader(socket.getInputStream()));
        ) {
            BufferedReader stdIn =
                new BufferedReader(new InputStreamReader(System.in));
            String fromServer;
            String fromUser;

            while ((fromServer = in.readLine()) != null) {
                System.out.println("Server: " + fromServer);
                if (fromServer.equals("Bye."))
                    break;

                fromUser = stdIn.readLine();
                if (fromUser != null) {
                    System.out.println("Client: " + fromUser);
                    out.println(fromUser);
                }
            }
        } catch (UnknownHostException e) {
            System.err.println("Don't know about host " + hostName);
            System.exit(1);
        } catch (IOException e) {
            System.err.println("Couldn't get I/O for the connection to " +
                hostName);
            System.exit(1);
        }

}

我是新来的,希望有人可以帮助我! 谢谢,F

0 个答案:

没有答案