From 3414e2ca2e3fcc59f2de71f5dce40582e16aab9c Mon Sep 17 00:00:00 2001 From: "Alexander \"PapaTutuWawa" Date: Tue, 8 Nov 2022 12:27:10 +0100 Subject: [PATCH] fix: Make sock private --- moxxmpp_socket/lib/src/ssl.dart | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/moxxmpp_socket/lib/src/ssl.dart b/moxxmpp_socket/lib/src/ssl.dart index 4a2425b..b4bcd9e 100644 --- a/moxxmpp_socket/lib/src/ssl.dart +++ b/moxxmpp_socket/lib/src/ssl.dart @@ -26,12 +26,12 @@ class MbedSockCtx { } class MbedSock { - late Pointer sock; + late Pointer _sock; late Pointer _readBuf; late Pointer _writeBuf; MbedSock(MbedSockCtx ctx) { - sock = lib.mbedsock_new_ex(ctx.ctx); + _sock = lib.mbedsock_new_ex(ctx.ctx); _readBuf = malloc.call(2048); _writeBuf = malloc.call(2048); } @@ -39,7 +39,7 @@ class MbedSock { bool connect(String host, int port) { final nativeHost = host.toNativeUtf8(); final nativePort = port.toString().toNativeUtf8(); - final ret = lib.mbedsock_connect(sock, nativeHost.cast(), nativePort.cast()); + final ret = lib.mbedsock_connect(_sock, nativeHost.cast(), nativePort.cast()); malloc ..free(nativeHost) @@ -55,7 +55,7 @@ class MbedSock { final nativeHostname = hostname != null ? hostname.toNativeUtf8() : nullptr; final ret = lib.mbedsock_connect_secure( - sock, + _sock, nativeHost.cast(), nativePort.cast(), nativeAlpn.cast(), @@ -78,7 +78,7 @@ class MbedSock { } bool isSecure() { - return lib.mbedsock_is_secure(sock) == 1; + return lib.mbedsock_is_secure(_sock) == 1; } int write(String data) { @@ -89,7 +89,7 @@ class MbedSock { _writeBuf.asTypedList(2048).setAll(0, rawData); return lib.mbedsock_write( - sock, + _sock, _writeBuf, rawData.length, ); @@ -97,7 +97,7 @@ class MbedSock { Uint8List? read() { final result = lib.mbedsock_read( - sock, + _sock, _readBuf, 2048, ); @@ -117,7 +117,7 @@ class MbedSock { } void free() { - lib.mbedsock_free_ex(sock); + lib.mbedsock_free_ex(_sock); malloc.free(_readBuf); malloc.free(_writeBuf); }