I'm asking you an error when connecting fcm x mpp.

Asked 1 years ago, Updated 1 years ago, 56 views

final XMPPTCPConnectionConfiguration.Builder config = XMPPTCPConnectionConfiguration.builder();

    config.setXmppDomain(Util.FCM_SERVER); // == "fcm-xmpp.googleapis.com"
    //config.setHost(Util.FCM_SERVER);
    config.setHostAddress(InetAddress.getByName(Util.FCM_SERVER));
    //config.setPort(Util.FCM_PORT);
    config.setSecurityMode(ConnectionConfiguration.SecurityMode.disabled);
    config.setSendPresence(false);
    config.setSocketFactory(SSLSocketFactory.getDefault());
    config.setDebuggerEnabled(debuggable); // launch a window with info about packets sent and received
    config.setCompressionEnabled(true);
    config.setCustomSSLContext(sslContext);

    // // Create the connection
    connection = new XMPPTCPConnection(config.build());

    // // Connect
    connection.connect();

I tried to connect like this, but I got the following error. What's wrong with this?<

Exception in thread "main" org.jivesoftware.smack.SmackException$ConnectionException: The following addresses failed: '64.233.188.188:5222' failed because: fcm-xmpp.googleapis.com/64.233.188.188 exception: java.net.ConnectException: Connection timed out: connect

at org.jivesoftware.smack.SmackException$ConnectionException.from(SmackException.java:278)

at org.jivesoftware.smack.tcp.XMPPTCPConnection.connectUsingConfiguration(XMPPTCPConnection.java:619)

at org.jivesoftware.smack.tcp.XMPPTCPConnection.connectInternal(XMPPTCPConnection.java:902)

at org.jivesoftware.smack.AbstractXMPPConnection.connect(AbstractXMPPConnection.java:380)

at com.example.Server.Client.connect(Client.java:122)

at com.example.Server.EntryPoint.main(EntryPoint.java:32)

xmpp fcm

2022-09-22 18:44

1 Answers

64.233.188.188 Is the daemon bound to 5222 ports on the equipment?

I can't connect. The error message is also when a city timeout occurs when connecting from the client side.


2022-09-22 18:44

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.