#onMessage not being triggered

7 messages · Page 1 of 1 (latest)

torn narwhal
#

init

left solarBOT
#

This post has been reserved for your question.

Hey @torn narwhal! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

torn narwhal
#
    public WebSocketConnection() {
        try {
            websocket = new WebSocketClient(new URI("ws://127.0.0.1:1226")) {

                public void onOpen(ServerHandshake handshakedata) {

                }

                public void onMessage(String message) {

                    ChatMessageUtil.sendMessage("Message Recieved!");

                    // Receive general chat messages.
                    if (message.startsWith("chatgeneral")) {
                        String json = message.replace("chatgeneral ", "");
                        if (GeneralChat.getInstance() != null) {
                            generalChat.onReceive(json);
                        }
                    }

                    // Receive version check.
                    if ( message.startsWith( "ver" ) )
                    {
                        if ( message.equals( "ver false" ) )
                            System.out.println( "HockeyLink Outdated!" );
                        else
                            System.out.println( "HockeyLink Up To Date!");
                    }
                }
#

on message isn’t triggered when there is a message sent from the server

#

the connection is fine and it’s sending the message

#

it it not receiving it properly or something what did i do wrong