public Connection(string host, short port) { int result = NativeImports.tio_connect(host, port, out _nativeHandle); NativeImports.ThrowOnNativeApiError(result); _host = host; _port = port; }
public Container Open(string name) { IntPtr handle = new IntPtr(); int result = NativeImports.tio_open(_nativeHandle, name, "", out handle); NativeImports.ThrowOnNativeApiError(result); return(new Container(handle, name)); }
public string GetProperty(string key) { int result; using (NativeImports.TioDataConverter k = NativeImports.TioDataConverter.FromObject(key), v = new NativeImports.TioDataConverter()) { result = NativeImports.tio_container_propget( _nativeContainerHandle, ref k._tiodata, out v._tiodata); NativeImports.ThrowOnNativeApiError(result); return(v.ToString()); } }
public void Set(object key, object value, object metadata = null) { using (NativeImports.TioDataConverter k = NativeImports.TioDataConverter.FromObject(key), v = NativeImports.TioDataConverter.FromObject(value), m = NativeImports.TioDataConverter.FromObject(metadata)) { int result; result = NativeImports.tio_container_set( _nativeContainerHandle, ref k._tiodata, ref v._tiodata, ref m._tiodata); NativeImports.ThrowOnNativeApiError(result); } }
public void Ping(string host, short port) { int result = NativeImports.tio_ping(_nativeHandle, "tioclient"); NativeImports.ThrowOnNativeApiError(result); }