|
1 | 1 | /* |
2 | 2 | * socket.io-java-client IOConnection.java |
3 | 3 | * |
4 | | - * Copyright (c) 2011, Enno Boland |
| 4 | + * Copyright (c) 2012, Enno Boland |
5 | 5 | * socket.io-java-client is a implementation of the socket.io protocol in Java. |
6 | 6 | * |
7 | 7 | * See LICENSE file for more information |
|
26 | 26 | import org.json.JSONException; |
27 | 27 | import org.json.JSONObject; |
28 | 28 |
|
| 29 | +// TODO: Auto-generated Javadoc |
29 | 30 | /** |
30 | 31 | * The Class IOConnection. |
31 | 32 | */ |
@@ -161,15 +162,6 @@ public void run() { |
161 | 162 | } |
162 | 163 | } |
163 | 164 |
|
164 | | - /** The heart beat task. */ |
165 | | - final TimerTask heartBeatTask = new TimerTask() { |
166 | | - |
167 | | - @Override |
168 | | - public void run() { |
169 | | - |
170 | | - } |
171 | | - }; |
172 | | - |
173 | 165 | /** |
174 | 166 | * The Class ConnectThread. Handles connecting to the server with an |
175 | 167 | * {@link IOTransport} |
@@ -307,12 +299,12 @@ public void ack(Object... args) { |
307 | 299 | } |
308 | 300 |
|
309 | 301 | /** |
310 | | - * Synthesize ack. |
| 302 | + * adds an {@link IOAcknowledge} to an {@link IOMessage}. |
311 | 303 | * |
312 | 304 | * @param message |
313 | | - * the message |
| 305 | + * the {@link IOMessage} |
314 | 306 | * @param ack |
315 | | - * the ack |
| 307 | + * the {@link IOAcknowledge} |
316 | 308 | */ |
317 | 309 | private void synthesizeAck(IOMessage message, IOAcknowledge ack) { |
318 | 310 | if (ack != null) { |
@@ -357,9 +349,9 @@ protected void error(SocketIOException e) { |
357 | 349 |
|
358 | 350 | /** |
359 | 351 | * Connects a socket to the IOConnection. |
360 | | - * |
361 | | - * @param socket |
362 | | - * the socket to be connected |
| 352 | + * |
| 353 | + * @param socket the socket to be connected |
| 354 | + * @return true, if successfully registered on this transport, otherwise false. |
363 | 355 | */ |
364 | 356 | public boolean register(SocketIO socket) { |
365 | 357 | String namespace = socket.getNamespace(); |
@@ -708,9 +700,9 @@ private void warning(String message) { |
708 | 700 | } |
709 | 701 |
|
710 | 702 | /** |
711 | | - * Returns the session id. This should be called from the |
| 703 | + * Returns the session id. This should be called from a {@link IOTransport} |
712 | 704 | * |
713 | | - * @return the session id {@link IOTransport} to connect to the right |
| 705 | + * @return the session id to connect to the right |
714 | 706 | * Session. |
715 | 707 | */ |
716 | 708 | public String getSessionId() { |
@@ -831,23 +823,26 @@ public boolean isConnected() { |
831 | 823 | } |
832 | 824 |
|
833 | 825 | /** |
834 | | - * Gets the current state of this IOConnection |
| 826 | + * Gets the current state of this IOConnection. |
| 827 | + * |
835 | 828 | * @return current state |
836 | 829 | */ |
837 | 830 | private synchronized int getState() { |
838 | 831 | return state; |
839 | 832 | } |
840 | 833 |
|
841 | 834 | /** |
842 | | - * Sets the current state of this IOConnection |
843 | | - * @param new state |
| 835 | + * Sets the current state of this IOConnection. |
| 836 | + * |
| 837 | + * @param state the new state |
844 | 838 | */ |
845 | 839 | private synchronized void setState(int state) { |
846 | 840 | this.state = state; |
847 | 841 | } |
848 | 842 |
|
849 | 843 | /** |
850 | | - * gets the currently used transport |
| 844 | + * gets the currently used transport. |
| 845 | + * |
851 | 846 | * @return currently used transport |
852 | 847 | */ |
853 | 848 | public IOTransport getTransport() { |
|
0 commit comments