Returning -1 if no message was sent
This commit is contained in:
parent
7c84187681
commit
3159a44c3a
1 changed files with 4 additions and 4 deletions
|
@ -142,11 +142,12 @@ public class NetworkService extends Service {
|
||||||
if(mWebSocket != null){
|
if(mWebSocket != null){
|
||||||
if(mWebSocket.send(message)){
|
if(mWebSocket.send(message)){
|
||||||
Log.v(TAG,"-> " + message);
|
Log.v(TAG,"-> " + message);
|
||||||
|
return mCurrentId;
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
throw new RuntimeException("Websocket connection has not yet been established");
|
throw new RuntimeException("Websocket connection has not yet been established");
|
||||||
}
|
}
|
||||||
return mCurrentId;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long sendMessage(ApiCallable apiCallable, int requiredApi){
|
public long sendMessage(ApiCallable apiCallable, int requiredApi){
|
||||||
|
@ -158,11 +159,10 @@ public class NetworkService extends Service {
|
||||||
mRequestClassMap.put(mCurrentId, apiCallable.getClass());
|
mRequestClassMap.put(mCurrentId, apiCallable.getClass());
|
||||||
if(mWebSocket != null && mWebSocket.send(call.toJsonString())){
|
if(mWebSocket != null && mWebSocket.send(call.toJsonString())){
|
||||||
Log.v(TAG,"-> "+call.toJsonString());
|
Log.v(TAG,"-> "+call.toJsonString());
|
||||||
}else{
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
return mCurrentId;
|
return mCurrentId;
|
||||||
}
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method used to inform any external party a clue about the current connectivity status
|
* Method used to inform any external party a clue about the current connectivity status
|
||||||
|
|
Loading…
Reference in a new issue