Skip to content

Commit 9ac1aa3

Browse files
authored
Update README.md
1 parent acf7297 commit 9ac1aa3

File tree

1 file changed

+5
-43
lines changed

1 file changed

+5
-43
lines changed

README.md

Lines changed: 5 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -164,39 +164,6 @@ AsyncHttpClient.getDefaultInstance().websocket(get, "my-protocol", new WebSocket
164164
```
165165

166166

167-
### AndroidAsync also supports socket.io (version 0.9.x)
168-
169-
```java
170-
SocketIOClient.connect(AsyncHttpClient.getDefaultInstance(), "http://192.168.1.2:3000", new ConnectCallback() {
171-
@Override
172-
public void onConnectCompleted(Exception ex, SocketIOClient client) {
173-
if (ex != null) {
174-
ex.printStackTrace();
175-
return;
176-
}
177-
client.setStringCallback(new StringCallback() {
178-
@Override
179-
public void onString(String string) {
180-
System.out.println(string);
181-
}
182-
});
183-
client.on("someEvent", new EventCallback() {
184-
@Override
185-
public void onEvent(JSONArray argument, Acknowledge acknowledge) {
186-
System.out.println("args: " + arguments.toString());
187-
}
188-
});
189-
client.setJSONCallback(new JSONCallback() {
190-
@Override
191-
public void onJSON(JSONObject json) {
192-
System.out.println("json: " + json.toString());
193-
}
194-
});
195-
}
196-
});
197-
```
198-
199-
200167
### AndroidAsync also let's you create simple HTTP servers:
201168
202169
```java
@@ -221,17 +188,12 @@ server.listen(5000);
221188
222189
```java
223190
AsyncHttpServer httpServer = new AsyncHttpServer();
224-
httpServer.setErrorCallback(new CompletedCallback() {
225-
@Override
226-
public void onCompleted(Exception ex) {
227-
Log.e("WebSocket", "An error occurred", ex);
228-
}
229-
});
230-
httpServer.listen(AsyncServer.getDefault(), port);
231191
232-
httpServer.websocket("/live", new AsyncHttpServer.WebSocketRequestCallback() {
233-
@Override
234-
public void onConnected(final WebSocket webSocket, AsyncHttpServerRequest request) {
192+
httpServer.listen(AsyncServer.getDefault(), port);
193+
194+
httpServer.websocket("/live", new AsyncHttpServer.WebSocketRequestCallback() {
195+
@Override
196+
public void onConnected(final WebSocket webSocket, AsyncHttpServerRequest request) {
235197
_sockets.add(webSocket);
236198
237199
//Use this to clean up any references to your websocket

0 commit comments

Comments
 (0)