socket client 简易封装:AndroidSocketClient
jopen
9年前
socket client 简易封装
导入
Add it in your project's build.gradle at the end of repositories:
repositories { // ... maven { url "https://jitpack.io" } }
Step 2. Add the dependency in the form
dependencies { compile 'com.github.vilyever:AndroidSocketClient:1.0.1' }
用法
VDSocketClient socketClient = new VDSocketClient(); socketClient.registerDelegate(new VDSocketClient.VDSocketClientDelegate() { @Override public void didConnectFromSocketClient(VDSocketClient client) { } @Override public void didDisconnectFromSocketClient(VDSocketClient client) { } @Override public void didReceiveResponseFromSocketClient(VDSocketClient client, String response) { } }); socketClient.connect("192.168.1.1", 80);