Skip to content
This repository was archived by the owner on Dec 29, 2019. It is now read-only.
This repository was archived by the owner on Dec 29, 2019. It is now read-only.

serviceAddress is null #33

@junzew

Description

@junzew

I am using Salut 0.5.0 and I have two client devices and a host successfully connected to each other.
Communication between host and client works fine. However, when I invoke sendToDevice to try to send some data from one client to another client:

network.sendToDevice(anotherClientDevice, data, new SalutCallback() {
        @Override
        public void call() {
            Log.d(TAG, "send data to device failed");
        }
    }
);

I got the following exception:
java.lang.IllegalArgumentException: host=null, port=4321
at java.net.InetSocketAddress.(InetSocketAddress.java:99)
at java.net.InetSocketAddress.(InetSocketAddress.java:90)
at com.peak.salut.BackgroundDataSendJob.doOnBackground(BackgroundDataSendJob.java:37)
at com.arasthel.asyncjob.AsyncJob$2.run(AsyncJob.java:59)
at java.lang.Thread.run(Thread.java:818)

It turns out that device.serviceAddress is null in BackgroundDataSendJob:

try {
     dataSocket.connect(new InetSocketAddress(device.serviceAddress, device.servicePort));
     // ...
}

The field Salut.serviceAddress seems to be not properly set in BackgroundClientRegistrationJob and BackgroundServerRegistrationJob.

Any thoughts on this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions