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
aa8ae76c
Commit
aa8ae76c
authored
Jul 07, 2023
by
李朝发
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
58fb0b43
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
59 additions
and
59 deletions
+59
-59
build.gradle
socket/build.gradle
+1
-1
NativeSocket.kt
socket/src/main/java/cn/qmai/socket/NativeSocket.kt
+58
-58
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 @
aa8ae76c
...
...
@@ -43,7 +43,7 @@ def USERNAME = "lizhaofa"
def
PASSWORD
=
"0oh7bcnZtweAo7EX"
// 非 grpc 版本号 1.0.12
def
VERSION
=
"1.1.1
4
"
def
VERSION
=
"1.1.1
5
"
def
RELEASE_REPOSITORY_URL
=
"https://hub.zmcms.cn/repository/maven-releases"
afterEvaluate
{
...
...
socket/src/main/java/cn/qmai/socket/NativeSocket.kt
View file @
aa8ae76c
...
...
@@ -42,7 +42,7 @@ open class RustBuffer : Structure() {
companion
object
{
internal
fun
alloc
(
size
:
Int
=
0
)
=
rustCall
()
{
status
->
_UniFFILib
.
INSTANCE
.
ffi_NativeSocket_
fc72
_rustbuffer_alloc
(
size
,
status
).
also
{
_UniFFILib
.
INSTANCE
.
ffi_NativeSocket_
31d7
_rustbuffer_alloc
(
size
,
status
).
also
{
if
(
it
.
data
==
null
)
{
throw
RuntimeException
(
"RustBuffer.alloc() returned null data pointer (size=${size})"
)
}
...
...
@@ -50,7 +50,7 @@ open class RustBuffer : Structure() {
}
internal
fun
free
(
buf
:
RustBuffer
.
ByValue
)
=
rustCall
()
{
status
->
_UniFFILib
.
INSTANCE
.
ffi_NativeSocket_
fc72
_rustbuffer_free
(
buf
,
status
)
_UniFFILib
.
INSTANCE
.
ffi_NativeSocket_
31d7
_rustbuffer_free
(
buf
,
status
)
}
}
...
...
@@ -259,95 +259,95 @@ internal interface _UniFFILib : Library {
}
}
fun
ffi_NativeSocket_
fc72
_NativeSocketBuilder_object_free
(
`ptr`
:
Pointer
,
fun
ffi_NativeSocket_
31d7
_NativeSocketBuilder_object_free
(
`ptr`
:
Pointer
,
_uniffi_out_err
:
RustCallStatus
):
Unit
fun
NativeSocket_
fc72
_NativeSocketBuilder_new
(
fun
NativeSocket_
31d7
_NativeSocketBuilder_new
(
_uniffi_out_err
:
RustCallStatus
):
Pointer
fun
NativeSocket_
fc72
_NativeSocketBuilder_host
(
`ptr`
:
Pointer
,
`host`
:
RustBuffer
.
ByValue
,
fun
NativeSocket_
31d7
_NativeSocketBuilder_host
(
`ptr`
:
Pointer
,
`host`
:
RustBuffer
.
ByValue
,
_uniffi_out_err
:
RustCallStatus
):
Pointer
fun
NativeSocket_
fc72
_NativeSocketBuilder_token
(
`ptr`
:
Pointer
,
`token`
:
RustBuffer
.
ByValue
,
fun
NativeSocket_
31d7
_NativeSocketBuilder_token
(
`ptr`
:
Pointer
,
`token`
:
RustBuffer
.
ByValue
,
_uniffi_out_err
:
RustCallStatus
):
Pointer
fun
NativeSocket_
fc72
_NativeSocketBuilder_brand
(
`ptr`
:
Pointer
,
`brand`
:
Int
,
fun
NativeSocket_
31d7
_NativeSocketBuilder_brand
(
`ptr`
:
Pointer
,
`brand`
:
Int
,
_uniffi_out_err
:
RustCallStatus
):
Pointer
fun
NativeSocket_
fc72
_NativeSocketBuilder_store
(
`ptr`
:
Pointer
,
`store`
:
Int
,
fun
NativeSocket_
31d7
_NativeSocketBuilder_store
(
`ptr`
:
Pointer
,
`store`
:
Int
,
_uniffi_out_err
:
RustCallStatus
):
Pointer
fun
NativeSocket_
fc72
_NativeSocketBuilder_device
(
`ptr`
:
Pointer
,
`device`
:
RustBuffer
.
ByValue
,
fun
NativeSocket_
31d7
_NativeSocketBuilder_device
(
`ptr`
:
Pointer
,
`device`
:
RustBuffer
.
ByValue
,
_uniffi_out_err
:
RustCallStatus
):
Pointer
fun
NativeSocket_
fc72
_NativeSocketBuilder_ty
(
`ptr`
:
Pointer
,
`type`
:
Int
,
fun
NativeSocket_
31d7
_NativeSocketBuilder_ty
(
`ptr`
:
Pointer
,
`type`
:
Int
,
_uniffi_out_err
:
RustCallStatus
):
Pointer
fun
NativeSocket_
fc72
_NativeSocketBuilder_clean_start
(
`ptr`
:
Pointer
,
`cleanStart`
:
Byte
,
fun
NativeSocket_
31d7
_NativeSocketBuilder_clean_start
(
`ptr`
:
Pointer
,
`cleanStart`
:
Byte
,
_uniffi_out_err
:
RustCallStatus
):
Pointer
fun
NativeSocket_
fc72
_NativeSocketBuilder_cache_dir
(
`ptr`
:
Pointer
,
`cacheDir`
:
RustBuffer
.
ByValue
,
fun
NativeSocket_
31d7
_NativeSocketBuilder_cache_dir
(
`ptr`
:
Pointer
,
`cacheDir`
:
RustBuffer
.
ByValue
,
_uniffi_out_err
:
RustCallStatus
):
Pointer
fun
NativeSocket_
fc72
_NativeSocketBuilder_log_level
(
`ptr`
:
Pointer
,
`logLevel`
:
RustBuffer
.
ByValue
,
fun
NativeSocket_
31d7
_NativeSocketBuilder_log_level
(
`ptr`
:
Pointer
,
`logLevel`
:
RustBuffer
.
ByValue
,
_uniffi_out_err
:
RustCallStatus
):
Pointer
fun
NativeSocket_
fc72
_NativeSocketBuilder_grpc
(
`ptr`
:
Pointer
,
`enable`
:
Byte
,
fun
NativeSocket_
31d7
_NativeSocketBuilder_grpc
(
`ptr`
:
Pointer
,
`enable`
:
Byte
,
_uniffi_out_err
:
RustCallStatus
):
Pointer
fun
NativeSocket_
fc72
_NativeSocketBuilder_version
(
`ptr`
:
Pointer
,
`version`
:
RustBuffer
.
ByValue
,
fun
NativeSocket_
31d7
_NativeSocketBuilder_version
(
`ptr`
:
Pointer
,
`version`
:
RustBuffer
.
ByValue
,
_uniffi_out_err
:
RustCallStatus
):
Pointer
fun
NativeSocket_
fc72
_NativeSocketBuilder_build
(
`ptr`
:
Pointer
,
fun
NativeSocket_
31d7
_NativeSocketBuilder_build
(
`ptr`
:
Pointer
,
_uniffi_out_err
:
RustCallStatus
):
RustBuffer
.
ByValue
fun
ffi_NativeSocket_
fc72
_NativeSocket_object_free
(
`ptr`
:
Pointer
,
fun
ffi_NativeSocket_
31d7
_NativeSocket_object_free
(
`ptr`
:
Pointer
,
_uniffi_out_err
:
RustCallStatus
):
Unit
fun
NativeSocket_
fc72
_NativeSocket_poll
(
`ptr`
:
Pointer
,
fun
NativeSocket_
31d7
_NativeSocket_poll
(
`ptr`
:
Pointer
,
_uniffi_out_err
:
RustCallStatus
):
RustBuffer
.
ByValue
fun
NativeSocket_
fc72
_NativeSocket_try_poll
(
`ptr`
:
Pointer
,
fun
NativeSocket_
31d7
_NativeSocket_try_poll
(
`ptr`
:
Pointer
,
_uniffi_out_err
:
RustCallStatus
):
RustBuffer
.
ByValue
fun
NativeSocket_
fc72
_NativeSocket_poll_timeout
(
`ptr`
:
Pointer
,
`timeout`
:
RustBuffer
.
ByValue
,
fun
NativeSocket_
31d7
_NativeSocket_poll_timeout
(
`ptr`
:
Pointer
,
`timeout`
:
RustBuffer
.
ByValue
,
_uniffi_out_err
:
RustCallStatus
):
RustBuffer
.
ByValue
fun
NativeSocket_
fc72
_NativeSocket_invoke
(
`ptr`
:
Pointer
,
`input`
:
RustBuffer
.
ByValue
,
fun
NativeSocket_
31d7
_NativeSocket_invoke
(
`ptr`
:
Pointer
,
`input`
:
RustBuffer
.
ByValue
,
_uniffi_out_err
:
RustCallStatus
):
RustBuffer
.
ByValue
fun
ffi_NativeSocket_
fc72
_rustbuffer_alloc
(
`size`
:
Int
,
fun
ffi_NativeSocket_
31d7
_rustbuffer_alloc
(
`size`
:
Int
,
_uniffi_out_err
:
RustCallStatus
):
RustBuffer
.
ByValue
fun
ffi_NativeSocket_
fc72
_rustbuffer_from_bytes
(
`bytes`
:
ForeignBytes
.
ByValue
,
fun
ffi_NativeSocket_
31d7
_rustbuffer_from_bytes
(
`bytes`
:
ForeignBytes
.
ByValue
,
_uniffi_out_err
:
RustCallStatus
):
RustBuffer
.
ByValue
fun
ffi_NativeSocket_
fc72
_rustbuffer_free
(
`buf`
:
RustBuffer
.
ByValue
,
fun
ffi_NativeSocket_
31d7
_rustbuffer_free
(
`buf`
:
RustBuffer
.
ByValue
,
_uniffi_out_err
:
RustCallStatus
):
Unit
fun
ffi_NativeSocket_
fc72
_rustbuffer_reserve
(
`buf`
:
RustBuffer
.
ByValue
,
`additional`
:
Int
,
fun
ffi_NativeSocket_
31d7
_rustbuffer_reserve
(
`buf`
:
RustBuffer
.
ByValue
,
`additional`
:
Int
,
_uniffi_out_err
:
RustCallStatus
):
RustBuffer
.
ByValue
...
...
@@ -710,14 +710,14 @@ class NativeSocket(
*/
override
protected
fun
freeRustArcPtr
()
{
rustCall
()
{
status
->
_UniFFILib
.
INSTANCE
.
ffi_NativeSocket_
fc72
_NativeSocket_object_free
(
this
.
pointer
,
status
)
_UniFFILib
.
INSTANCE
.
ffi_NativeSocket_
31d7
_NativeSocket_object_free
(
this
.
pointer
,
status
)
}
}
override
fun
`poll`
():
Message
?
=
callWithPointer
{
rustCall
()
{
_status
->
_UniFFILib
.
INSTANCE
.
NativeSocket_
fc72
_NativeSocket_poll
(
it
,
_status
)
_UniFFILib
.
INSTANCE
.
NativeSocket_
31d7
_NativeSocket_poll
(
it
,
_status
)
}
}.
let
{
FfiConverterOptionalTypeMessage
.
lift
(
it
)
...
...
@@ -725,7 +725,7 @@ class NativeSocket(
override
fun
`tryPoll`
():
Message
?
=
callWithPointer
{
rustCall
()
{
_status
->
_UniFFILib
.
INSTANCE
.
NativeSocket_
fc72
_NativeSocket_try_poll
(
it
,
_status
)
_UniFFILib
.
INSTANCE
.
NativeSocket_
31d7
_NativeSocket_try_poll
(
it
,
_status
)
}
}.
let
{
FfiConverterOptionalTypeMessage
.
lift
(
it
)
...
...
@@ -733,7 +733,7 @@ class NativeSocket(
override
fun
`pollTimeout`
(
`timeout`
:
java
.
time
.
Duration
):
Message
?
=
callWithPointer
{
rustCall
()
{
_status
->
_UniFFILib
.
INSTANCE
.
NativeSocket_
fc72
_NativeSocket_poll_timeout
(
it
,
FfiConverterDuration
.
lower
(
`timeout`
),
_status
)
_UniFFILib
.
INSTANCE
.
NativeSocket_
31d7
_NativeSocket_poll_timeout
(
it
,
FfiConverterDuration
.
lower
(
`timeout`
),
_status
)
}
}.
let
{
FfiConverterOptionalTypeMessage
.
lift
(
it
)
...
...
@@ -741,7 +741,7 @@ class NativeSocket(
override
fun
`invoke`
(
`input`
:
InvokeInput
):
InvokeOutput
=
callWithPointer
{
rustCall
()
{
_status
->
_UniFFILib
.
INSTANCE
.
NativeSocket_
fc72
_NativeSocket_invoke
(
it
,
FfiConverterTypeInvokeInput
.
lower
(
`input`
),
_status
)
_UniFFILib
.
INSTANCE
.
NativeSocket_
31d7
_NativeSocket_invoke
(
it
,
FfiConverterTypeInvokeInput
.
lower
(
`input`
),
_status
)
}
}.
let
{
FfiConverterTypeInvokeOutput
.
lift
(
it
)
...
...
@@ -794,7 +794,7 @@ public interface NativeSocketBuilderInterface {
fun
`cacheDir`
(
`cacheDir`
:
String
):
NativeSocketBuilder
fun
`logLevel`
(
`logLevel`
:
Socket
LogLevel
):
NativeSocketBuilder
fun
`logLevel`
(
`logLevel`
:
LogLevel
):
NativeSocketBuilder
fun
`grpc`
(
`enable`
:
Boolean
):
NativeSocketBuilder
...
...
@@ -810,7 +810,7 @@ class NativeSocketBuilder(
constructor
()
:
this
(
rustCall
()
{
_status
->
_UniFFILib
.
INSTANCE
.
NativeSocket_
fc72
_NativeSocketBuilder_new
(
_status
)
_UniFFILib
.
INSTANCE
.
NativeSocket_
31d7
_NativeSocketBuilder_new
(
_status
)
})
/**
...
...
@@ -823,14 +823,14 @@ class NativeSocketBuilder(
*/
override
protected
fun
freeRustArcPtr
()
{
rustCall
()
{
status
->
_UniFFILib
.
INSTANCE
.
ffi_NativeSocket_
fc72
_NativeSocketBuilder_object_free
(
this
.
pointer
,
status
)
_UniFFILib
.
INSTANCE
.
ffi_NativeSocket_
31d7
_NativeSocketBuilder_object_free
(
this
.
pointer
,
status
)
}
}
override
fun
`host`
(
`host`
:
String
):
NativeSocketBuilder
=
callWithPointer
{
rustCall
()
{
_status
->
_UniFFILib
.
INSTANCE
.
NativeSocket_
fc72
_NativeSocketBuilder_host
(
it
,
FfiConverterString
.
lower
(
`host`
),
_status
)
_UniFFILib
.
INSTANCE
.
NativeSocket_
31d7
_NativeSocketBuilder_host
(
it
,
FfiConverterString
.
lower
(
`host`
),
_status
)
}
}.
let
{
FfiConverterTypeNativeSocketBuilder
.
lift
(
it
)
...
...
@@ -838,7 +838,7 @@ class NativeSocketBuilder(
override
fun
`token`
(
`token`
:
String
):
NativeSocketBuilder
=
callWithPointer
{
rustCall
()
{
_status
->
_UniFFILib
.
INSTANCE
.
NativeSocket_
fc72
_NativeSocketBuilder_token
(
it
,
FfiConverterString
.
lower
(
`token`
),
_status
)
_UniFFILib
.
INSTANCE
.
NativeSocket_
31d7
_NativeSocketBuilder_token
(
it
,
FfiConverterString
.
lower
(
`token`
),
_status
)
}
}.
let
{
FfiConverterTypeNativeSocketBuilder
.
lift
(
it
)
...
...
@@ -846,7 +846,7 @@ class NativeSocketBuilder(
override
fun
`brand`
(
`brand`
:
Int
):
NativeSocketBuilder
=
callWithPointer
{
rustCall
()
{
_status
->
_UniFFILib
.
INSTANCE
.
NativeSocket_
fc72
_NativeSocketBuilder_brand
(
it
,
FfiConverterInt
.
lower
(
`brand`
),
_status
)
_UniFFILib
.
INSTANCE
.
NativeSocket_
31d7
_NativeSocketBuilder_brand
(
it
,
FfiConverterInt
.
lower
(
`brand`
),
_status
)
}
}.
let
{
FfiConverterTypeNativeSocketBuilder
.
lift
(
it
)
...
...
@@ -854,7 +854,7 @@ class NativeSocketBuilder(
override
fun
`store`
(
`store`
:
Int
):
NativeSocketBuilder
=
callWithPointer
{
rustCall
()
{
_status
->
_UniFFILib
.
INSTANCE
.
NativeSocket_
fc72
_NativeSocketBuilder_store
(
it
,
FfiConverterInt
.
lower
(
`store`
),
_status
)
_UniFFILib
.
INSTANCE
.
NativeSocket_
31d7
_NativeSocketBuilder_store
(
it
,
FfiConverterInt
.
lower
(
`store`
),
_status
)
}
}.
let
{
FfiConverterTypeNativeSocketBuilder
.
lift
(
it
)
...
...
@@ -862,7 +862,7 @@ class NativeSocketBuilder(
override
fun
`device`
(
`device`
:
String
):
NativeSocketBuilder
=
callWithPointer
{
rustCall
()
{
_status
->
_UniFFILib
.
INSTANCE
.
NativeSocket_
fc72
_NativeSocketBuilder_device
(
it
,
FfiConverterString
.
lower
(
`device`
),
_status
)
_UniFFILib
.
INSTANCE
.
NativeSocket_
31d7
_NativeSocketBuilder_device
(
it
,
FfiConverterString
.
lower
(
`device`
),
_status
)
}
}.
let
{
FfiConverterTypeNativeSocketBuilder
.
lift
(
it
)
...
...
@@ -870,7 +870,7 @@ class NativeSocketBuilder(
override
fun
`ty`
(
`type`
:
Int
):
NativeSocketBuilder
=
callWithPointer
{
rustCall
()
{
_status
->
_UniFFILib
.
INSTANCE
.
NativeSocket_
fc72
_NativeSocketBuilder_ty
(
it
,
FfiConverterInt
.
lower
(
`type`
),
_status
)
_UniFFILib
.
INSTANCE
.
NativeSocket_
31d7
_NativeSocketBuilder_ty
(
it
,
FfiConverterInt
.
lower
(
`type`
),
_status
)
}
}.
let
{
FfiConverterTypeNativeSocketBuilder
.
lift
(
it
)
...
...
@@ -878,7 +878,7 @@ class NativeSocketBuilder(
override
fun
`cleanStart`
(
`cleanStart`
:
Boolean
):
NativeSocketBuilder
=
callWithPointer
{
rustCall
()
{
_status
->
_UniFFILib
.
INSTANCE
.
NativeSocket_
fc72
_NativeSocketBuilder_clean_start
(
it
,
FfiConverterBoolean
.
lower
(
`cleanStart`
),
_status
)
_UniFFILib
.
INSTANCE
.
NativeSocket_
31d7
_NativeSocketBuilder_clean_start
(
it
,
FfiConverterBoolean
.
lower
(
`cleanStart`
),
_status
)
}
}.
let
{
FfiConverterTypeNativeSocketBuilder
.
lift
(
it
)
...
...
@@ -886,15 +886,15 @@ class NativeSocketBuilder(
override
fun
`cacheDir`
(
`cacheDir`
:
String
):
NativeSocketBuilder
=
callWithPointer
{
rustCall
()
{
_status
->
_UniFFILib
.
INSTANCE
.
NativeSocket_
fc72
_NativeSocketBuilder_cache_dir
(
it
,
FfiConverterString
.
lower
(
`cacheDir`
),
_status
)
_UniFFILib
.
INSTANCE
.
NativeSocket_
31d7
_NativeSocketBuilder_cache_dir
(
it
,
FfiConverterString
.
lower
(
`cacheDir`
),
_status
)
}
}.
let
{
FfiConverterTypeNativeSocketBuilder
.
lift
(
it
)
}
override
fun
`logLevel`
(
`logLevel`
:
Socket
LogLevel
):
NativeSocketBuilder
=
override
fun
`logLevel`
(
`logLevel`
:
LogLevel
):
NativeSocketBuilder
=
callWithPointer
{
rustCall
()
{
_status
->
_UniFFILib
.
INSTANCE
.
NativeSocket_
fc72_NativeSocketBuilder_log_level
(
it
,
FfiConverterTypeSocket
LogLevel
.
lower
(
`logLevel`
),
_status
)
_UniFFILib
.
INSTANCE
.
NativeSocket_
31d7_NativeSocketBuilder_log_level
(
it
,
FfiConverterType
LogLevel
.
lower
(
`logLevel`
),
_status
)
}
}.
let
{
FfiConverterTypeNativeSocketBuilder
.
lift
(
it
)
...
...
@@ -902,7 +902,7 @@ class NativeSocketBuilder(
override
fun
`grpc`
(
`enable`
:
Boolean
):
NativeSocketBuilder
=
callWithPointer
{
rustCall
()
{
_status
->
_UniFFILib
.
INSTANCE
.
NativeSocket_
fc72
_NativeSocketBuilder_grpc
(
it
,
FfiConverterBoolean
.
lower
(
`enable`
),
_status
)
_UniFFILib
.
INSTANCE
.
NativeSocket_
31d7
_NativeSocketBuilder_grpc
(
it
,
FfiConverterBoolean
.
lower
(
`enable`
),
_status
)
}
}.
let
{
FfiConverterTypeNativeSocketBuilder
.
lift
(
it
)
...
...
@@ -910,7 +910,7 @@ class NativeSocketBuilder(
override
fun
`version`
(
`version`
:
String
):
NativeSocketBuilder
=
callWithPointer
{
rustCall
()
{
_status
->
_UniFFILib
.
INSTANCE
.
NativeSocket_
fc72
_NativeSocketBuilder_version
(
it
,
FfiConverterString
.
lower
(
`version`
),
_status
)
_UniFFILib
.
INSTANCE
.
NativeSocket_
31d7
_NativeSocketBuilder_version
(
it
,
FfiConverterString
.
lower
(
`version`
),
_status
)
}
}.
let
{
FfiConverterTypeNativeSocketBuilder
.
lift
(
it
)
...
...
@@ -918,7 +918,7 @@ class NativeSocketBuilder(
override
fun
`build`
():
NativeSocket
?
=
callWithPointer
{
rustCall
()
{
_status
->
_UniFFILib
.
INSTANCE
.
NativeSocket_
fc72
_NativeSocketBuilder_build
(
it
,
_status
)
_UniFFILib
.
INSTANCE
.
NativeSocket_
31d7
_NativeSocketBuilder_build
(
it
,
_status
)
}
}.
let
{
FfiConverterOptionalTypeNativeSocket
.
lift
(
it
)
...
...
@@ -1253,20 +1253,20 @@ public object FfiConverterTypeInvokeOutput : FfiConverterRustBuffer<InvokeOutput
enum
class
Qos
{
AT_MOST_ONCE
,
AT_LEAST_ON
CE
;
enum
class
LogLevel
{
ERROR
,
WARN
,
INFO
,
DEBUG
,
TRA
CE
;
}
public
object
FfiConverterType
Qos
:
FfiConverterRustBuffer
<
Qos
>
{
public
object
FfiConverterType
LogLevel
:
FfiConverterRustBuffer
<
LogLevel
>
{
override
fun
read
(
buf
:
ByteBuffer
)
=
try
{
Qos
.
values
()[
buf
.
getInt
()
-
1
]
LogLevel
.
values
()[
buf
.
getInt
()
-
1
]
}
catch
(
e
:
IndexOutOfBoundsException
)
{
throw
RuntimeException
(
"invalid enum value, something is very wrong!!"
,
e
)
}
override
fun
allocationSize
(
value
:
Qos
)
=
4
override
fun
allocationSize
(
value
:
LogLevel
)
=
4
override
fun
write
(
value
:
Qos
,
buf
:
ByteBuffer
)
{
override
fun
write
(
value
:
LogLevel
,
buf
:
ByteBuffer
)
{
buf
.
putInt
(
value
.
ordinal
+
1
)
}
}
...
...
@@ -1276,20 +1276,20 @@ public object FfiConverterTypeQos: FfiConverterRustBuffer<Qos> {
enum
class
SocketLogLevel
{
ERROR
,
WARN
,
INFO
,
DEBUG
,
TRA
CE
;
enum
class
Qos
{
AT_MOST_ONCE
,
AT_LEAST_ON
CE
;
}
public
object
FfiConverterType
SocketLogLevel
:
FfiConverterRustBuffer
<
SocketLogLevel
>
{
public
object
FfiConverterType
Qos
:
FfiConverterRustBuffer
<
Qos
>
{
override
fun
read
(
buf
:
ByteBuffer
)
=
try
{
SocketLogLevel
.
values
()[
buf
.
getInt
()
-
1
]
Qos
.
values
()[
buf
.
getInt
()
-
1
]
}
catch
(
e
:
IndexOutOfBoundsException
)
{
throw
RuntimeException
(
"invalid enum value, something is very wrong!!"
,
e
)
}
override
fun
allocationSize
(
value
:
SocketLogLevel
)
=
4
override
fun
allocationSize
(
value
:
Qos
)
=
4
override
fun
write
(
value
:
SocketLogLevel
,
buf
:
ByteBuffer
)
{
override
fun
write
(
value
:
Qos
,
buf
:
ByteBuffer
)
{
buf
.
putInt
(
value
.
ordinal
+
1
)
}
}
...
...
socket/src/main/jniLibs/arm64-v8a/libsocket.so
View file @
aa8ae76c
No preview for this file type
socket/src/main/jniLibs/armeabi-v7a/libsocket.so
View file @
aa8ae76c
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