Esempio n. 1
0
 private static void SocketWrittenTo(C4Socket *socket, C4SliceResult allocatedData)
 {
     try {
         _externalWrite?.Invoke(socket, ((C4Slice)allocatedData).ToArrayFast());
     } catch (Exception) {
         // Log
     } finally {
         allocatedData.Dispose();
     }
 }
 private static void SocketWrittenTo(C4Socket *socket, C4SliceResult allocatedData)
 {
     try {
         _externalWrite?.Invoke(socket, ((C4Slice)allocatedData).ToArrayFast());
     } catch (Exception e) {
         _error?.Invoke(socket, new Exception("Error writing to socket", e));
         Native.c4socket_closed(socket, new C4Error(C4ErrorCode.UnexpectedError));
     } finally {
         allocatedData.Dispose();
     }
 }
 public static extern void c4slice_free(C4SliceResult slice);
 public void c4slice_free(C4SliceResult slice) => Native.c4slice_free(slice);