Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
Socket
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
Android Widget
Socket
Commits
a3ef8fd4
Commit
a3ef8fd4
authored
Jun 29, 2023
by
李朝发
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
355c23af
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
100 additions
and
51 deletions
+100
-51
build.gradle
socket/build.gradle
+1
-1
NativeSocket.kt
socket/src/main/java/cn/qmai/socket/NativeSocket.kt
+99
-50
libsocket.so
socket/src/main/jniLibs/arm64-v8a/libsocket.so
+0
-0
libsocket.so
socket/src/main/jniLibs/armeabi-v7a/libsocket.so
+0
-0
No files found.
socket/build.gradle
View file @
a3ef8fd4
...
@@ -42,7 +42,7 @@ dependencies {
...
@@ -42,7 +42,7 @@ dependencies {
def
USERNAME
=
"lizhaofa"
def
USERNAME
=
"lizhaofa"
def
PASSWORD
=
"0oh7bcnZtweAo7EX"
def
PASSWORD
=
"0oh7bcnZtweAo7EX"
def
VERSION
=
"1.0.1
1
"
def
VERSION
=
"1.0.1
2
"
def
RELEASE_REPOSITORY_URL
=
"https://hub.zmcms.cn/repository/maven-releases"
def
RELEASE_REPOSITORY_URL
=
"https://hub.zmcms.cn/repository/maven-releases"
afterEvaluate
{
afterEvaluate
{
...
...
socket/src/main/java/cn/qmai/socket/NativeSocket.kt
View file @
a3ef8fd4
...
@@ -42,7 +42,7 @@ open class RustBuffer : Structure() {
...
@@ -42,7 +42,7 @@ open class RustBuffer : Structure() {
companion
object
{
companion
object
{
internal
fun
alloc
(
size
:
Int
=
0
)
=
rustCall
()
{
status
->
internal
fun
alloc
(
size
:
Int
=
0
)
=
rustCall
()
{
status
->
_UniFFILib
.
INSTANCE
.
ffi_NativeSocket_
2c48
_rustbuffer_alloc
(
size
,
status
).
also
{
_UniFFILib
.
INSTANCE
.
ffi_NativeSocket_
8561
_rustbuffer_alloc
(
size
,
status
).
also
{
if
(
it
.
data
==
null
)
{
if
(
it
.
data
==
null
)
{
throw
RuntimeException
(
"RustBuffer.alloc() returned null data pointer (size=${size})"
)
throw
RuntimeException
(
"RustBuffer.alloc() returned null data pointer (size=${size})"
)
}
}
...
@@ -50,7 +50,7 @@ open class RustBuffer : Structure() {
...
@@ -50,7 +50,7 @@ open class RustBuffer : Structure() {
}
}
internal
fun
free
(
buf
:
RustBuffer
.
ByValue
)
=
rustCall
()
{
status
->
internal
fun
free
(
buf
:
RustBuffer
.
ByValue
)
=
rustCall
()
{
status
->
_UniFFILib
.
INSTANCE
.
ffi_NativeSocket_
2c48
_rustbuffer_free
(
buf
,
status
)
_UniFFILib
.
INSTANCE
.
ffi_NativeSocket_
8561
_rustbuffer_free
(
buf
,
status
)
}
}
}
}
...
@@ -259,91 +259,91 @@ internal interface _UniFFILib : Library {
...
@@ -259,91 +259,91 @@ internal interface _UniFFILib : Library {
}
}
}
}
fun
ffi_NativeSocket_
2c48
_NativeSocketBuilder_object_free
(
`ptr`
:
Pointer
,
fun
ffi_NativeSocket_
8561
_NativeSocketBuilder_object_free
(
`ptr`
:
Pointer
,
_uniffi_out_err
:
RustCallStatus
_uniffi_out_err
:
RustCallStatus
):
Unit
):
Unit
fun
NativeSocket_
2c48
_NativeSocketBuilder_new
(
fun
NativeSocket_
8561
_NativeSocketBuilder_new
(
_uniffi_out_err
:
RustCallStatus
_uniffi_out_err
:
RustCallStatus
):
Pointer
):
Pointer
fun
NativeSocket_
2c48
_NativeSocketBuilder_host
(
`ptr`
:
Pointer
,
`host`
:
RustBuffer
.
ByValue
,
fun
NativeSocket_
8561
_NativeSocketBuilder_host
(
`ptr`
:
Pointer
,
`host`
:
RustBuffer
.
ByValue
,
_uniffi_out_err
:
RustCallStatus
_uniffi_out_err
:
RustCallStatus
):
Pointer
):
Pointer
fun
NativeSocket_
2c48
_NativeSocketBuilder_token
(
`ptr`
:
Pointer
,
`token`
:
RustBuffer
.
ByValue
,
fun
NativeSocket_
8561
_NativeSocketBuilder_token
(
`ptr`
:
Pointer
,
`token`
:
RustBuffer
.
ByValue
,
_uniffi_out_err
:
RustCallStatus
_uniffi_out_err
:
RustCallStatus
):
Pointer
):
Pointer
fun
NativeSocket_
2c48
_NativeSocketBuilder_brand
(
`ptr`
:
Pointer
,
`brand`
:
Int
,
fun
NativeSocket_
8561
_NativeSocketBuilder_brand
(
`ptr`
:
Pointer
,
`brand`
:
Int
,
_uniffi_out_err
:
RustCallStatus
_uniffi_out_err
:
RustCallStatus
):
Pointer
):
Pointer
fun
NativeSocket_
2c48
_NativeSocketBuilder_store
(
`ptr`
:
Pointer
,
`store`
:
Int
,
fun
NativeSocket_
8561
_NativeSocketBuilder_store
(
`ptr`
:
Pointer
,
`store`
:
Int
,
_uniffi_out_err
:
RustCallStatus
_uniffi_out_err
:
RustCallStatus
):
Pointer
):
Pointer
fun
NativeSocket_
2c48
_NativeSocketBuilder_device
(
`ptr`
:
Pointer
,
`device`
:
RustBuffer
.
ByValue
,
fun
NativeSocket_
8561
_NativeSocketBuilder_device
(
`ptr`
:
Pointer
,
`device`
:
RustBuffer
.
ByValue
,
_uniffi_out_err
:
RustCallStatus
_uniffi_out_err
:
RustCallStatus
):
Pointer
):
Pointer
fun
NativeSocket_
2c48
_NativeSocketBuilder_ty
(
`ptr`
:
Pointer
,
`type`
:
Int
,
fun
NativeSocket_
8561
_NativeSocketBuilder_ty
(
`ptr`
:
Pointer
,
`type`
:
Int
,
_uniffi_out_err
:
RustCallStatus
_uniffi_out_err
:
RustCallStatus
):
Pointer
):
Pointer
fun
NativeSocket_
2c48
_NativeSocketBuilder_clean_start
(
`ptr`
:
Pointer
,
`cleanStart`
:
Byte
,
fun
NativeSocket_
8561
_NativeSocketBuilder_clean_start
(
`ptr`
:
Pointer
,
`cleanStart`
:
Byte
,
_uniffi_out_err
:
RustCallStatus
_uniffi_out_err
:
RustCallStatus
):
Pointer
):
Pointer
fun
NativeSocket_
2c48
_NativeSocketBuilder_cache_dir
(
`ptr`
:
Pointer
,
`cacheDir`
:
RustBuffer
.
ByValue
,
fun
NativeSocket_
8561
_NativeSocketBuilder_cache_dir
(
`ptr`
:
Pointer
,
`cacheDir`
:
RustBuffer
.
ByValue
,
_uniffi_out_err
:
RustCallStatus
_uniffi_out_err
:
RustCallStatus
):
Pointer
):
Pointer
fun
NativeSocket_
2c48
_NativeSocketBuilder_log_level
(
`ptr`
:
Pointer
,
`logLevel`
:
RustBuffer
.
ByValue
,
fun
NativeSocket_
8561
_NativeSocketBuilder_log_level
(
`ptr`
:
Pointer
,
`logLevel`
:
RustBuffer
.
ByValue
,
_uniffi_out_err
:
RustCallStatus
_uniffi_out_err
:
RustCallStatus
):
Pointer
):
Pointer
fun
NativeSocket_
2c48
_NativeSocketBuilder_version
(
`ptr`
:
Pointer
,
`version`
:
RustBuffer
.
ByValue
,
fun
NativeSocket_
8561
_NativeSocketBuilder_version
(
`ptr`
:
Pointer
,
`version`
:
RustBuffer
.
ByValue
,
_uniffi_out_err
:
RustCallStatus
_uniffi_out_err
:
RustCallStatus
):
Pointer
):
Pointer
fun
NativeSocket_
2c48
_NativeSocketBuilder_build
(
`ptr`
:
Pointer
,
fun
NativeSocket_
8561
_NativeSocketBuilder_build
(
`ptr`
:
Pointer
,
_uniffi_out_err
:
RustCallStatus
_uniffi_out_err
:
RustCallStatus
):
RustBuffer
.
ByValue
):
RustBuffer
.
ByValue
fun
ffi_NativeSocket_
2c48
_NativeSocket_object_free
(
`ptr`
:
Pointer
,
fun
ffi_NativeSocket_
8561
_NativeSocket_object_free
(
`ptr`
:
Pointer
,
_uniffi_out_err
:
RustCallStatus
_uniffi_out_err
:
RustCallStatus
):
Unit
):
Unit
fun
NativeSocket_
2c48
_NativeSocket_poll
(
`ptr`
:
Pointer
,
fun
NativeSocket_
8561
_NativeSocket_poll
(
`ptr`
:
Pointer
,
_uniffi_out_err
:
RustCallStatus
_uniffi_out_err
:
RustCallStatus
):
RustBuffer
.
ByValue
):
RustBuffer
.
ByValue
fun
NativeSocket_
2c48
_NativeSocket_try_poll
(
`ptr`
:
Pointer
,
fun
NativeSocket_
8561
_NativeSocket_try_poll
(
`ptr`
:
Pointer
,
_uniffi_out_err
:
RustCallStatus
_uniffi_out_err
:
RustCallStatus
):
RustBuffer
.
ByValue
):
RustBuffer
.
ByValue
fun
NativeSocket_
2c48
_NativeSocket_poll_timeout
(
`ptr`
:
Pointer
,
`timeout`
:
RustBuffer
.
ByValue
,
fun
NativeSocket_
8561
_NativeSocket_poll_timeout
(
`ptr`
:
Pointer
,
`timeout`
:
RustBuffer
.
ByValue
,
_uniffi_out_err
:
RustCallStatus
_uniffi_out_err
:
RustCallStatus
):
RustBuffer
.
ByValue
):
RustBuffer
.
ByValue
fun
NativeSocket_
2c48
_NativeSocket_invoke
(
`ptr`
:
Pointer
,
`input`
:
RustBuffer
.
ByValue
,
fun
NativeSocket_
8561
_NativeSocket_invoke
(
`ptr`
:
Pointer
,
`input`
:
RustBuffer
.
ByValue
,
_uniffi_out_err
:
RustCallStatus
_uniffi_out_err
:
RustCallStatus
):
RustBuffer
.
ByValue
):
RustBuffer
.
ByValue
fun
ffi_NativeSocket_
2c48
_rustbuffer_alloc
(
`size`
:
Int
,
fun
ffi_NativeSocket_
8561
_rustbuffer_alloc
(
`size`
:
Int
,
_uniffi_out_err
:
RustCallStatus
_uniffi_out_err
:
RustCallStatus
):
RustBuffer
.
ByValue
):
RustBuffer
.
ByValue
fun
ffi_NativeSocket_
2c48
_rustbuffer_from_bytes
(
`bytes`
:
ForeignBytes
.
ByValue
,
fun
ffi_NativeSocket_
8561
_rustbuffer_from_bytes
(
`bytes`
:
ForeignBytes
.
ByValue
,
_uniffi_out_err
:
RustCallStatus
_uniffi_out_err
:
RustCallStatus
):
RustBuffer
.
ByValue
):
RustBuffer
.
ByValue
fun
ffi_NativeSocket_
2c48
_rustbuffer_free
(
`buf`
:
RustBuffer
.
ByValue
,
fun
ffi_NativeSocket_
8561
_rustbuffer_free
(
`buf`
:
RustBuffer
.
ByValue
,
_uniffi_out_err
:
RustCallStatus
_uniffi_out_err
:
RustCallStatus
):
Unit
):
Unit
fun
ffi_NativeSocket_
2c48
_rustbuffer_reserve
(
`buf`
:
RustBuffer
.
ByValue
,
`additional`
:
Int
,
fun
ffi_NativeSocket_
8561
_rustbuffer_reserve
(
`buf`
:
RustBuffer
.
ByValue
,
`additional`
:
Int
,
_uniffi_out_err
:
RustCallStatus
_uniffi_out_err
:
RustCallStatus
):
RustBuffer
.
ByValue
):
RustBuffer
.
ByValue
...
@@ -706,14 +706,14 @@ class NativeSocket(
...
@@ -706,14 +706,14 @@ class NativeSocket(
*/
*/
override
protected
fun
freeRustArcPtr
()
{
override
protected
fun
freeRustArcPtr
()
{
rustCall
()
{
status
->
rustCall
()
{
status
->
_UniFFILib
.
INSTANCE
.
ffi_NativeSocket_
2c48
_NativeSocket_object_free
(
this
.
pointer
,
status
)
_UniFFILib
.
INSTANCE
.
ffi_NativeSocket_
8561
_NativeSocket_object_free
(
this
.
pointer
,
status
)
}
}
}
}
override
fun
`poll`
():
Message
?
=
override
fun
`poll`
():
Message
?
=
callWithPointer
{
callWithPointer
{
rustCall
()
{
_status
->
rustCall
()
{
_status
->
_UniFFILib
.
INSTANCE
.
NativeSocket_
2c48
_NativeSocket_poll
(
it
,
_status
)
_UniFFILib
.
INSTANCE
.
NativeSocket_
8561
_NativeSocket_poll
(
it
,
_status
)
}
}
}.
let
{
}.
let
{
FfiConverterOptionalTypeMessage
.
lift
(
it
)
FfiConverterOptionalTypeMessage
.
lift
(
it
)
...
@@ -721,7 +721,7 @@ class NativeSocket(
...
@@ -721,7 +721,7 @@ class NativeSocket(
override
fun
`tryPoll`
():
Message
?
=
override
fun
`tryPoll`
():
Message
?
=
callWithPointer
{
callWithPointer
{
rustCall
()
{
_status
->
rustCall
()
{
_status
->
_UniFFILib
.
INSTANCE
.
NativeSocket_
2c48
_NativeSocket_try_poll
(
it
,
_status
)
_UniFFILib
.
INSTANCE
.
NativeSocket_
8561
_NativeSocket_try_poll
(
it
,
_status
)
}
}
}.
let
{
}.
let
{
FfiConverterOptionalTypeMessage
.
lift
(
it
)
FfiConverterOptionalTypeMessage
.
lift
(
it
)
...
@@ -729,7 +729,7 @@ class NativeSocket(
...
@@ -729,7 +729,7 @@ class NativeSocket(
override
fun
`pollTimeout`
(
`timeout`
:
java
.
time
.
Duration
):
Message
?
=
override
fun
`pollTimeout`
(
`timeout`
:
java
.
time
.
Duration
):
Message
?
=
callWithPointer
{
callWithPointer
{
rustCall
()
{
_status
->
rustCall
()
{
_status
->
_UniFFILib
.
INSTANCE
.
NativeSocket_
2c48
_NativeSocket_poll_timeout
(
it
,
FfiConverterDuration
.
lower
(
`timeout`
),
_status
)
_UniFFILib
.
INSTANCE
.
NativeSocket_
8561
_NativeSocket_poll_timeout
(
it
,
FfiConverterDuration
.
lower
(
`timeout`
),
_status
)
}
}
}.
let
{
}.
let
{
FfiConverterOptionalTypeMessage
.
lift
(
it
)
FfiConverterOptionalTypeMessage
.
lift
(
it
)
...
@@ -737,7 +737,7 @@ class NativeSocket(
...
@@ -737,7 +737,7 @@ class NativeSocket(
override
fun
`invoke`
(
`input`
:
InvokeInput
):
InvokeOutput
=
override
fun
`invoke`
(
`input`
:
InvokeInput
):
InvokeOutput
=
callWithPointer
{
callWithPointer
{
rustCall
()
{
_status
->
rustCall
()
{
_status
->
_UniFFILib
.
INSTANCE
.
NativeSocket_
2c48
_NativeSocket_invoke
(
it
,
FfiConverterTypeInvokeInput
.
lower
(
`input`
),
_status
)
_UniFFILib
.
INSTANCE
.
NativeSocket_
8561
_NativeSocket_invoke
(
it
,
FfiConverterTypeInvokeInput
.
lower
(
`input`
),
_status
)
}
}
}.
let
{
}.
let
{
FfiConverterTypeInvokeOutput
.
lift
(
it
)
FfiConverterTypeInvokeOutput
.
lift
(
it
)
...
@@ -804,7 +804,7 @@ class NativeSocketBuilder(
...
@@ -804,7 +804,7 @@ class NativeSocketBuilder(
constructor
()
:
constructor
()
:
this
(
this
(
rustCall
()
{
_status
->
rustCall
()
{
_status
->
_UniFFILib
.
INSTANCE
.
NativeSocket_
2c48
_NativeSocketBuilder_new
(
_status
)
_UniFFILib
.
INSTANCE
.
NativeSocket_
8561
_NativeSocketBuilder_new
(
_status
)
})
})
/**
/**
...
@@ -817,14 +817,14 @@ class NativeSocketBuilder(
...
@@ -817,14 +817,14 @@ class NativeSocketBuilder(
*/
*/
override
protected
fun
freeRustArcPtr
()
{
override
protected
fun
freeRustArcPtr
()
{
rustCall
()
{
status
->
rustCall
()
{
status
->
_UniFFILib
.
INSTANCE
.
ffi_NativeSocket_
2c48
_NativeSocketBuilder_object_free
(
this
.
pointer
,
status
)
_UniFFILib
.
INSTANCE
.
ffi_NativeSocket_
8561
_NativeSocketBuilder_object_free
(
this
.
pointer
,
status
)
}
}
}
}
override
fun
`host`
(
`host`
:
String
):
NativeSocketBuilder
=
override
fun
`host`
(
`host`
:
String
):
NativeSocketBuilder
=
callWithPointer
{
callWithPointer
{
rustCall
()
{
_status
->
rustCall
()
{
_status
->
_UniFFILib
.
INSTANCE
.
NativeSocket_
2c48
_NativeSocketBuilder_host
(
it
,
FfiConverterString
.
lower
(
`host`
),
_status
)
_UniFFILib
.
INSTANCE
.
NativeSocket_
8561
_NativeSocketBuilder_host
(
it
,
FfiConverterString
.
lower
(
`host`
),
_status
)
}
}
}.
let
{
}.
let
{
FfiConverterTypeNativeSocketBuilder
.
lift
(
it
)
FfiConverterTypeNativeSocketBuilder
.
lift
(
it
)
...
@@ -832,7 +832,7 @@ class NativeSocketBuilder(
...
@@ -832,7 +832,7 @@ class NativeSocketBuilder(
override
fun
`token`
(
`token`
:
String
):
NativeSocketBuilder
=
override
fun
`token`
(
`token`
:
String
):
NativeSocketBuilder
=
callWithPointer
{
callWithPointer
{
rustCall
()
{
_status
->
rustCall
()
{
_status
->
_UniFFILib
.
INSTANCE
.
NativeSocket_
2c48
_NativeSocketBuilder_token
(
it
,
FfiConverterString
.
lower
(
`token`
),
_status
)
_UniFFILib
.
INSTANCE
.
NativeSocket_
8561
_NativeSocketBuilder_token
(
it
,
FfiConverterString
.
lower
(
`token`
),
_status
)
}
}
}.
let
{
}.
let
{
FfiConverterTypeNativeSocketBuilder
.
lift
(
it
)
FfiConverterTypeNativeSocketBuilder
.
lift
(
it
)
...
@@ -840,7 +840,7 @@ class NativeSocketBuilder(
...
@@ -840,7 +840,7 @@ class NativeSocketBuilder(
override
fun
`brand`
(
`brand`
:
Int
):
NativeSocketBuilder
=
override
fun
`brand`
(
`brand`
:
Int
):
NativeSocketBuilder
=
callWithPointer
{
callWithPointer
{
rustCall
()
{
_status
->
rustCall
()
{
_status
->
_UniFFILib
.
INSTANCE
.
NativeSocket_
2c48
_NativeSocketBuilder_brand
(
it
,
FfiConverterInt
.
lower
(
`brand`
),
_status
)
_UniFFILib
.
INSTANCE
.
NativeSocket_
8561
_NativeSocketBuilder_brand
(
it
,
FfiConverterInt
.
lower
(
`brand`
),
_status
)
}
}
}.
let
{
}.
let
{
FfiConverterTypeNativeSocketBuilder
.
lift
(
it
)
FfiConverterTypeNativeSocketBuilder
.
lift
(
it
)
...
@@ -848,7 +848,7 @@ class NativeSocketBuilder(
...
@@ -848,7 +848,7 @@ class NativeSocketBuilder(
override
fun
`store`
(
`store`
:
Int
):
NativeSocketBuilder
=
override
fun
`store`
(
`store`
:
Int
):
NativeSocketBuilder
=
callWithPointer
{
callWithPointer
{
rustCall
()
{
_status
->
rustCall
()
{
_status
->
_UniFFILib
.
INSTANCE
.
NativeSocket_
2c48
_NativeSocketBuilder_store
(
it
,
FfiConverterInt
.
lower
(
`store`
),
_status
)
_UniFFILib
.
INSTANCE
.
NativeSocket_
8561
_NativeSocketBuilder_store
(
it
,
FfiConverterInt
.
lower
(
`store`
),
_status
)
}
}
}.
let
{
}.
let
{
FfiConverterTypeNativeSocketBuilder
.
lift
(
it
)
FfiConverterTypeNativeSocketBuilder
.
lift
(
it
)
...
@@ -856,7 +856,7 @@ class NativeSocketBuilder(
...
@@ -856,7 +856,7 @@ class NativeSocketBuilder(
override
fun
`device`
(
`device`
:
String
):
NativeSocketBuilder
=
override
fun
`device`
(
`device`
:
String
):
NativeSocketBuilder
=
callWithPointer
{
callWithPointer
{
rustCall
()
{
_status
->
rustCall
()
{
_status
->
_UniFFILib
.
INSTANCE
.
NativeSocket_
2c48
_NativeSocketBuilder_device
(
it
,
FfiConverterString
.
lower
(
`device`
),
_status
)
_UniFFILib
.
INSTANCE
.
NativeSocket_
8561
_NativeSocketBuilder_device
(
it
,
FfiConverterString
.
lower
(
`device`
),
_status
)
}
}
}.
let
{
}.
let
{
FfiConverterTypeNativeSocketBuilder
.
lift
(
it
)
FfiConverterTypeNativeSocketBuilder
.
lift
(
it
)
...
@@ -864,7 +864,7 @@ class NativeSocketBuilder(
...
@@ -864,7 +864,7 @@ class NativeSocketBuilder(
override
fun
`ty`
(
`type`
:
Int
):
NativeSocketBuilder
=
override
fun
`ty`
(
`type`
:
Int
):
NativeSocketBuilder
=
callWithPointer
{
callWithPointer
{
rustCall
()
{
_status
->
rustCall
()
{
_status
->
_UniFFILib
.
INSTANCE
.
NativeSocket_
2c48
_NativeSocketBuilder_ty
(
it
,
FfiConverterInt
.
lower
(
`type`
),
_status
)
_UniFFILib
.
INSTANCE
.
NativeSocket_
8561
_NativeSocketBuilder_ty
(
it
,
FfiConverterInt
.
lower
(
`type`
),
_status
)
}
}
}.
let
{
}.
let
{
FfiConverterTypeNativeSocketBuilder
.
lift
(
it
)
FfiConverterTypeNativeSocketBuilder
.
lift
(
it
)
...
@@ -872,7 +872,7 @@ class NativeSocketBuilder(
...
@@ -872,7 +872,7 @@ class NativeSocketBuilder(
override
fun
`cleanStart`
(
`cleanStart`
:
Boolean
):
NativeSocketBuilder
=
override
fun
`cleanStart`
(
`cleanStart`
:
Boolean
):
NativeSocketBuilder
=
callWithPointer
{
callWithPointer
{
rustCall
()
{
_status
->
rustCall
()
{
_status
->
_UniFFILib
.
INSTANCE
.
NativeSocket_
2c48
_NativeSocketBuilder_clean_start
(
it
,
FfiConverterBoolean
.
lower
(
`cleanStart`
),
_status
)
_UniFFILib
.
INSTANCE
.
NativeSocket_
8561
_NativeSocketBuilder_clean_start
(
it
,
FfiConverterBoolean
.
lower
(
`cleanStart`
),
_status
)
}
}
}.
let
{
}.
let
{
FfiConverterTypeNativeSocketBuilder
.
lift
(
it
)
FfiConverterTypeNativeSocketBuilder
.
lift
(
it
)
...
@@ -880,7 +880,7 @@ class NativeSocketBuilder(
...
@@ -880,7 +880,7 @@ class NativeSocketBuilder(
override
fun
`cacheDir`
(
`cacheDir`
:
String
):
NativeSocketBuilder
=
override
fun
`cacheDir`
(
`cacheDir`
:
String
):
NativeSocketBuilder
=
callWithPointer
{
callWithPointer
{
rustCall
()
{
_status
->
rustCall
()
{
_status
->
_UniFFILib
.
INSTANCE
.
NativeSocket_
2c48
_NativeSocketBuilder_cache_dir
(
it
,
FfiConverterString
.
lower
(
`cacheDir`
),
_status
)
_UniFFILib
.
INSTANCE
.
NativeSocket_
8561
_NativeSocketBuilder_cache_dir
(
it
,
FfiConverterString
.
lower
(
`cacheDir`
),
_status
)
}
}
}.
let
{
}.
let
{
FfiConverterTypeNativeSocketBuilder
.
lift
(
it
)
FfiConverterTypeNativeSocketBuilder
.
lift
(
it
)
...
@@ -888,7 +888,7 @@ class NativeSocketBuilder(
...
@@ -888,7 +888,7 @@ class NativeSocketBuilder(
override
fun
`logLevel`
(
`logLevel`
:
LogLevel
):
NativeSocketBuilder
=
override
fun
`logLevel`
(
`logLevel`
:
LogLevel
):
NativeSocketBuilder
=
callWithPointer
{
callWithPointer
{
rustCall
()
{
_status
->
rustCall
()
{
_status
->
_UniFFILib
.
INSTANCE
.
NativeSocket_
2c48
_NativeSocketBuilder_log_level
(
it
,
FfiConverterTypeLogLevel
.
lower
(
`logLevel`
),
_status
)
_UniFFILib
.
INSTANCE
.
NativeSocket_
8561
_NativeSocketBuilder_log_level
(
it
,
FfiConverterTypeLogLevel
.
lower
(
`logLevel`
),
_status
)
}
}
}.
let
{
}.
let
{
FfiConverterTypeNativeSocketBuilder
.
lift
(
it
)
FfiConverterTypeNativeSocketBuilder
.
lift
(
it
)
...
@@ -896,7 +896,7 @@ class NativeSocketBuilder(
...
@@ -896,7 +896,7 @@ class NativeSocketBuilder(
override
fun
`version`
(
`version`
:
String
):
NativeSocketBuilder
=
override
fun
`version`
(
`version`
:
String
):
NativeSocketBuilder
=
callWithPointer
{
callWithPointer
{
rustCall
()
{
_status
->
rustCall
()
{
_status
->
_UniFFILib
.
INSTANCE
.
NativeSocket_
2c48
_NativeSocketBuilder_version
(
it
,
FfiConverterString
.
lower
(
`version`
),
_status
)
_UniFFILib
.
INSTANCE
.
NativeSocket_
8561
_NativeSocketBuilder_version
(
it
,
FfiConverterString
.
lower
(
`version`
),
_status
)
}
}
}.
let
{
}.
let
{
FfiConverterTypeNativeSocketBuilder
.
lift
(
it
)
FfiConverterTypeNativeSocketBuilder
.
lift
(
it
)
...
@@ -904,7 +904,7 @@ class NativeSocketBuilder(
...
@@ -904,7 +904,7 @@ class NativeSocketBuilder(
override
fun
`build`
():
NativeSocket
?
=
override
fun
`build`
():
NativeSocket
?
=
callWithPointer
{
callWithPointer
{
rustCall
()
{
_status
->
rustCall
()
{
_status
->
_UniFFILib
.
INSTANCE
.
NativeSocket_
2c48
_NativeSocketBuilder_build
(
it
,
_status
)
_UniFFILib
.
INSTANCE
.
NativeSocket_
8561
_NativeSocketBuilder_build
(
it
,
_status
)
}
}
}.
let
{
}.
let
{
FfiConverterOptionalTypeNativeSocket
.
lift
(
it
)
FfiConverterOptionalTypeNativeSocket
.
lift
(
it
)
...
@@ -977,6 +977,9 @@ public object FfiConverterTypeMessage: FfiConverterRustBuffer<Message> {
...
@@ -977,6 +977,9 @@ public object FfiConverterTypeMessage: FfiConverterRustBuffer<Message> {
sealed
class
InvokeInput
{
sealed
class
InvokeInput
{
data class
Start
(
val
`cleanStart`
:
Boolean
)
:
InvokeInput
()
object
Stop
:
InvokeInput
()
object
Stop
:
InvokeInput
()
data class
Ack
(
data class
Ack
(
...
@@ -987,6 +990,8 @@ sealed class InvokeInput {
...
@@ -987,6 +990,8 @@ sealed class InvokeInput {
)
:
InvokeInput
()
)
:
InvokeInput
()
object
Online
:
InvokeInput
()
object
Online
:
InvokeInput
()
object
History
:
InvokeInput
()
...
@@ -995,19 +1000,30 @@ sealed class InvokeInput {
...
@@ -995,19 +1000,30 @@ sealed class InvokeInput {
public
object
FfiConverterTypeInvokeInput
:
FfiConverterRustBuffer
<
InvokeInput
>{
public
object
FfiConverterTypeInvokeInput
:
FfiConverterRustBuffer
<
InvokeInput
>{
override
fun
read
(
buf
:
ByteBuffer
):
InvokeInput
{
override
fun
read
(
buf
:
ByteBuffer
):
InvokeInput
{
return
when
(
buf
.
getInt
())
{
return
when
(
buf
.
getInt
())
{
1
->
InvokeInput
.
Stop
1
->
InvokeInput
.
Start
(
2
->
InvokeInput
.
Ack
(
FfiConverterBoolean
.
read
(
buf
),
)
2
->
InvokeInput
.
Stop
3
->
InvokeInput
.
Ack
(
FfiConverterLong
.
read
(
buf
),
FfiConverterLong
.
read
(
buf
),
)
)
3
->
InvokeInput
.
Cache
(
4
->
InvokeInput
.
Cache
(
FfiConverterLong
.
read
(
buf
),
FfiConverterLong
.
read
(
buf
),
)
)
4
->
InvokeInput
.
Online
5
->
InvokeInput
.
Online
6
->
InvokeInput
.
History
else
->
throw
RuntimeException
(
"invalid enum value, something is very wrong!!"
)
else
->
throw
RuntimeException
(
"invalid enum value, something is very wrong!!"
)
}
}
}
}
override
fun
allocationSize
(
value
:
InvokeInput
)
=
when
(
value
)
{
override
fun
allocationSize
(
value
:
InvokeInput
)
=
when
(
value
)
{
is
InvokeInput
.
Start
->
{
// Add the size for the Int that specifies the variant plus the size needed for all fields
(
4
+
FfiConverterBoolean
.
allocationSize
(
value
.
`cleanStart`
)
)
}
is
InvokeInput
.
Stop
->
{
is
InvokeInput
.
Stop
->
{
// Add the size for the Int that specifies the variant plus the size needed for all fields
// Add the size for the Int that specifies the variant plus the size needed for all fields
(
(
...
@@ -1034,26 +1050,41 @@ public object FfiConverterTypeInvokeInput : FfiConverterRustBuffer<InvokeInput>{
...
@@ -1034,26 +1050,41 @@ public object FfiConverterTypeInvokeInput : FfiConverterRustBuffer<InvokeInput>{
4
4
)
)
}
}
is
InvokeInput
.
History
->
{
// Add the size for the Int that specifies the variant plus the size needed for all fields
(
4
)
}
}
}
override
fun
write
(
value
:
InvokeInput
,
buf
:
ByteBuffer
)
{
override
fun
write
(
value
:
InvokeInput
,
buf
:
ByteBuffer
)
{
when
(
value
)
{
when
(
value
)
{
is
InvokeInput
.
St
op
->
{
is
InvokeInput
.
St
art
->
{
buf
.
putInt
(
1
)
buf
.
putInt
(
1
)
FfiConverterBoolean
.
write
(
value
.
`cleanStart`
,
buf
)
Unit
Unit
}
}
is
InvokeInput
.
Ack
->
{
is
InvokeInput
.
Stop
->
{
buf
.
putInt
(
2
)
buf
.
putInt
(
2
)
Unit
}
is
InvokeInput
.
Ack
->
{
buf
.
putInt
(
3
)
FfiConverterLong
.
write
(
value
.
`messageId`
,
buf
)
FfiConverterLong
.
write
(
value
.
`messageId`
,
buf
)
Unit
Unit
}
}
is
InvokeInput
.
Cache
->
{
is
InvokeInput
.
Cache
->
{
buf
.
putInt
(
3
)
buf
.
putInt
(
4
)
FfiConverterLong
.
write
(
value
.
`messageId`
,
buf
)
FfiConverterLong
.
write
(
value
.
`messageId`
,
buf
)
Unit
Unit
}
}
is
InvokeInput
.
Online
->
{
is
InvokeInput
.
Online
->
{
buf
.
putInt
(
4
)
buf
.
putInt
(
5
)
Unit
}
is
InvokeInput
.
History
->
{
buf
.
putInt
(
6
)
Unit
Unit
}
}
}.
let
{
/* this makes the `when` an expression, which ensures it is exhaustive */
}
}.
let
{
/* this makes the `when` an expression, which ensures it is exhaustive */
}
...
@@ -1074,6 +1105,9 @@ sealed class InvokeOutput {
...
@@ -1074,6 +1105,9 @@ sealed class InvokeOutput {
data class
Online
(
data class
Online
(
val
`status`
:
Boolean
val
`status`
:
Boolean
)
:
InvokeOutput
()
)
:
InvokeOutput
()
data class
History
(
val
`count`
:
Int
)
:
InvokeOutput
()
...
@@ -1089,6 +1123,9 @@ public object FfiConverterTypeInvokeOutput : FfiConverterRustBuffer<InvokeOutput
...
@@ -1089,6 +1123,9 @@ public object FfiConverterTypeInvokeOutput : FfiConverterRustBuffer<InvokeOutput
3
->
InvokeOutput
.
Online
(
3
->
InvokeOutput
.
Online
(
FfiConverterBoolean
.
read
(
buf
),
FfiConverterBoolean
.
read
(
buf
),
)
)
4
->
InvokeOutput
.
History
(
FfiConverterInt
.
read
(
buf
),
)
else
->
throw
RuntimeException
(
"invalid enum value, something is very wrong!!"
)
else
->
throw
RuntimeException
(
"invalid enum value, something is very wrong!!"
)
}
}
}
}
...
@@ -1114,6 +1151,13 @@ public object FfiConverterTypeInvokeOutput : FfiConverterRustBuffer<InvokeOutput
...
@@ -1114,6 +1151,13 @@ public object FfiConverterTypeInvokeOutput : FfiConverterRustBuffer<InvokeOutput
+
FfiConverterBoolean
.
allocationSize
(
value
.
`status`
)
+
FfiConverterBoolean
.
allocationSize
(
value
.
`status`
)
)
)
}
}
is
InvokeOutput
.
History
->
{
// Add the size for the Int that specifies the variant plus the size needed for all fields
(
4
+
FfiConverterInt
.
allocationSize
(
value
.
`count`
)
)
}
}
}
override
fun
write
(
value
:
InvokeOutput
,
buf
:
ByteBuffer
)
{
override
fun
write
(
value
:
InvokeOutput
,
buf
:
ByteBuffer
)
{
...
@@ -1132,6 +1176,11 @@ public object FfiConverterTypeInvokeOutput : FfiConverterRustBuffer<InvokeOutput
...
@@ -1132,6 +1176,11 @@ public object FfiConverterTypeInvokeOutput : FfiConverterRustBuffer<InvokeOutput
FfiConverterBoolean
.
write
(
value
.
`status`
,
buf
)
FfiConverterBoolean
.
write
(
value
.
`status`
,
buf
)
Unit
Unit
}
}
is
InvokeOutput
.
History
->
{
buf
.
putInt
(
4
)
FfiConverterInt
.
write
(
value
.
`count`
,
buf
)
Unit
}
}.
let
{
/* this makes the `when` an expression, which ensures it is exhaustive */
}
}.
let
{
/* this makes the `when` an expression, which ensures it is exhaustive */
}
}
}
}
}
...
...
socket/src/main/jniLibs/arm64-v8a/libsocket.so
View file @
a3ef8fd4
No preview for this file type
socket/src/main/jniLibs/armeabi-v7a/libsocket.so
View file @
a3ef8fd4
No preview for this file type
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