Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
com.ccwangluo.accelerator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sheteng
com.ccwangluo.accelerator
Commits
922eb8b2
Commit
922eb8b2
authored
Dec 17, 2017
by
Mygod
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Faster VPN connection and less wait
I just saved everyone ~0.9s every VPN connection.
parent
1010edc5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
mobile/src/main/java/com/github/shadowsocks/bg/VpnService.kt
mobile/src/main/java/com/github/shadowsocks/bg/VpnService.kt
+3
-3
No files found.
mobile/src/main/java/com/github/shadowsocks/bg/VpnService.kt
View file @
922eb8b2
...
...
@@ -194,9 +194,9 @@ class VpnService : BaseVpnService(), LocalDnsService.Interface {
private
fun
sendFd
(
fd
:
Int
):
Boolean
{
if
(
fd
!=
-
1
)
{
var
tries
=
1
while
(
tries
<
5
)
{
Thread
.
sleep
(
1000L
*
tries
)
var
tries
=
0
while
(
tries
<
10
)
{
Thread
.
sleep
(
30L
shl
tries
)
if
(
JniHelper
.
sendFd
(
fd
,
File
(
app
.
deviceContext
.
filesDir
,
"sock_path"
).
absolutePath
)
!=
-
1
)
return
true
tries
+=
1
}
...
...
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