Back to project page LibGeppa.
The source code is released under:
Apache License
If you think the Android project LibGeppa listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package net.cattaka.libgeppa.adapter; //from ww w . ja v a2 s. co m import net.cattaka.libgeppa.data.DeviceInfo; import net.cattaka.libgeppa.data.IPacket; import net.cattaka.libgeppa.data.IPacketFactory; import net.cattaka.libgeppa.net.RemoteSocketPrepareTask; import net.cattaka.libgeppa.thread.ConnectionThread.IRawSocketPrepareTask; public class RemoteDeviceAdapter<T extends IPacket> extends AbsConnectionAdapter<T> { private String mHostname; private int mPort; public RemoteDeviceAdapter(IDeviceAdapterListener<T> listener, IPacketFactory<T> packetFactory, boolean useMainLooperForListener, String hostname, int port) { super(listener, packetFactory, useMainLooperForListener); if (hostname == null) { throw new NullPointerException(); } mHostname = hostname; mPort = port; } @Override protected IRawSocketPrepareTask createRawSocketPrepareTask() { return new RemoteSocketPrepareTask(mHostname, mPort); } @Override public DeviceInfo getDeviceInfo() { return DeviceInfo.createTcp(mHostname, mPort, true); } }