Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AloqaIM-Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
AloqaIM-Android
Commits
8e235f66
Commit
8e235f66
authored
Jan 23, 2017
by
Yusuke Iwaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add error handling for "already closed"
parent
a0d5c1cb
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
142 additions
and
115 deletions
+142
-115
DDPClientCallback.java
.../main/java/chat/rocket/android_ddp/DDPClientCallback.java
+13
-6
DDPClientImpl.java
.../src/main/java/chat/rocket/android_ddp/DDPClientImpl.java
+125
-105
RxWebSocket.java
...src/main/java/chat/rocket/android_ddp/rx/RxWebSocket.java
+4
-4
No files found.
android-ddp/src/main/java/chat/rocket/android_ddp/DDPClientCallback.java
View file @
8e235f66
...
...
@@ -15,7 +15,8 @@ public class DDPClientCallback {
public
static
abstract
class
BaseException
extends
Exception
{
public
DDPClient
client
;
public
BaseException
(
DDPClient
client
)
{
public
BaseException
(
Class
<?
extends
BaseException
>
clazz
,
DDPClient
client
)
{
super
(
clazz
.
getName
());
this
.
client
=
client
;
}
}
...
...
@@ -32,14 +33,14 @@ public class DDPClientCallback {
public
String
version
;
public
Failed
(
DDPClient
client
,
String
version
)
{
super
(
client
);
super
(
Failed
.
class
,
client
);
this
.
version
=
version
;
}
}
public
static
class
Timeout
extends
BaseException
{
public
Timeout
(
DDPClient
client
)
{
super
(
client
);
super
(
Timeout
.
class
,
client
);
}
}
}
...
...
@@ -54,7 +55,7 @@ public class DDPClientCallback {
public
static
class
Timeout
extends
BaseException
{
public
Timeout
(
DDPClient
client
)
{
super
(
client
);
super
(
Timeout
.
class
,
client
);
}
}
}
...
...
@@ -74,7 +75,7 @@ public class DDPClientCallback {
public
JSONObject
error
;
public
Error
(
DDPClient
client
,
String
id
,
JSONObject
error
)
{
super
(
client
);
super
(
Error
.
class
,
client
);
this
.
id
=
id
;
this
.
error
=
error
;
}
...
...
@@ -82,8 +83,14 @@ public class DDPClientCallback {
public
static
class
Timeout
extends
BaseException
{
public
Timeout
(
DDPClient
client
)
{
super
(
client
);
super
(
Timeout
.
class
,
client
);
}
}
}
public
static
class
Closed
extends
BaseException
{
public
Closed
(
DDPClient
client
)
{
super
(
Closed
.
class
,
client
);
}
}
}
android-ddp/src/main/java/chat/rocket/android_ddp/DDPClientImpl.java
View file @
8e235f66
This diff is collapsed.
Click to expand it.
android-ddp/src/main/java/chat/rocket/android_ddp/rx/RxWebSocket.java
View file @
8e235f66
...
...
@@ -63,15 +63,15 @@ public class RxWebSocket {
}).
publish
();
}
public
void
sendText
(
String
message
)
throws
IOException
{
webSocket
.
send
(
message
);
public
boolean
sendText
(
String
message
)
throws
IOException
{
return
webSocket
.
send
(
message
);
}
public
boolean
isConnected
()
{
return
isConnected
;
}
public
void
close
(
int
code
,
String
reason
)
throws
IOException
{
webSocket
.
close
(
code
,
reason
);
public
boolean
close
(
int
code
,
String
reason
)
throws
IOException
{
return
webSocket
.
close
(
code
,
reason
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment