v4.0.0-alpha4
Pre-release
Pre-release
tik4net 4.0.0-alpha4
Full release notes and version history: Wiki → History
What's new in 4.0
9 new connection types — all implement the same ITikConnection / LoadAll<T>() / Save<T>() interface:
| Type | Transport | Port | Notes |
|---|---|---|---|
Rest / RestSsl |
HTTP/HTTPS | 80/443 | RouterOS 7.1+, CRUD only |
Telnet |
TCP | 23 | plain-text terminal |
MacTelnet |
UDP broadcast | 20561 | Layer-2, no IP needed |
WinboxCli |
TCP | 8291 | WinBox terminal over TCP |
WinboxCliMac |
UDP | 20561 | WinBox terminal over MAC |
WinboxNative |
TCP | 8291 | native M2 binary protocol, full CRUD + streaming |
WinboxNativeMac |
UDP | 20561 | native M2 over MAC |
Ssh (satellite) |
TCP | 22 | requires tik4net.ssh NuGet |
Other additions:
- Multi-targeting
netstandard2.0;net8.0— netstandard2.0 keeps the Unity / Xamarin / .NET Framework reach; the net8.0 leg carries the modern surface - Async everywhere — async CRUD on the O/R mapper, an async surface on every transport, and a cancel that actually cancels
- Streaming reads as
IAsyncEnumerable<ITikReSentence>(net8.0) —await foreachover a live monitor - Change tracking — the O/R mapper tracks which properties changed;
Save<T>()sends only the diff - Safe Mode —
SafeModeTake()/SafeModeRelease()/SafeModeUnroll()across all transports; auto-rollback on disconnect TikConnectionSetup— the single entry point; every option is applied in one place, and a transport declares what it can honour by implementingITikTlsConnection/ITikMacLayerConnection/ITikCancellationModeConnection- Connection capability model —
connection.Supports(TikConnectionCapability.Listen)etc. - Raw command pass-through —
connection.CreateRawCommand(raw)for commands outside the O/R mapper - WinBox GUI-name addressing — address entities by their WinBox display name on
WinboxNative tik4net.mcp— drive any command over any transport from an AI assistant
Breaking changes (from 3.6)
Full guide, with before/after code: Upgrading from 3.x to 4.0
These change what a working 3.x program does without stopping the compiler — read them first:
- An invalid TLS certificate is now rejected —
AllowInvalidCertificatedefaults tofalse(wastrue). RouterOS normally presents a self-signed certificate, so an API-SSL / REST-SSL connection that opened in 3.x can now fail. Ask for it explicitly, or pin the certificate withCertificateValidationCallback - Synchronous commands are tagged —
SendTagWithSyncCommanddefaults totrue(wasfalse). This is what makes one connection usable from several threads. If you script a fake RouterOS in your tests, echo the tag back ExecuteScalaron a command that returns nothing throws the newTikCommandEmptyResponseException, notTikNoSuchItemException— after a write, an empty answer means successSavediffs against the local snapshot instead of aLoadByIdround-trip.TikDefaults.SaveMode = TikSaveMode.FullUpdaterestores the 3.x behaviour
And these stop the compiler:
- The O/R mapper is now inside the
tik4netpackage — it used to ship astik4net.objects(3.x), thentik4net.entities(4.0.0-alpha). Remove anyPackageReferenceto those or you get an assembly conflict. No source changes: namespaces and assembly names are unchanged ITikConnectionis lifecycle and command factory only —CallCommandSyncmoved toITikRawSentenceConnection, Safe Mode toITikSafeModeConnection,SendTagWithSyncCommandtoITikTaggedConnection(extension methods keep the call sites compiling). TheThread-returningCallCommandAsyncis removed- Nullable reference types are on — every mapped reference-typed entity property is
string?; every writableboolisbool?, as are numeric and enum properties carrying a router default, becausenullmeans "the router decides" - Exception hierarchy unified —
TikCommandExceptionsubtypes restructured; reviewcatchblocks on specific subtypes - SSH is a satellite package — add
tik4net.sshand callTik4NetSsh.Register()at startup TikConnectionType.Api_v2/ApiSsl_v2are gone — they were[Obsolete(error)]in 3.6- Three
Interfaceproperties are read-only (Type,MacAddress,FastPath) —/interface setdoes not accept them;L2Mtuwas added, which it does
NuGet packages
| Package | Install |
|---|---|
tik4net (core + O/R mapper) |
dotnet add package tik4net --version 4.0.0-alpha4 |
tik4net.ssh (satellite, opt-in) |
dotnet add package tik4net.ssh --version 4.0.0-alpha4 |
tik4net.testing |
dotnet add package tik4net.testing --version 4.0.0-alpha4 |
tik4net.mcp (dev/debug helper tool) |
dotnet tool install -g tik4net.mcp --version 4.0.0-alpha4 |
Full Changelog: v4.0.0-alpha3...v4.0.0-alpha4