A drop-in replacement for O2Net32.dll.
Rewritten from scratch in modern C# and compiled to a native Windows DLL via .NET 10 Native AOT.
The replacement preserves the exact same export table and on-the-wire framing as the original DLL,
but relies on System.Net.Sockets.Socket rather than raw Winsock overlapped I/O.
The rebuilt O2Net32.dll exports four symbols by ordinal, matching the original:
| Ordinal | Signature |
|---|---|
| 1 | void O2Net_ShutDown() |
| 2 | int O2Net_StartUp(HWND hwnd, const char* host, uint16_t port, void (*cb)(uint32_t code, void* arg)) |
| 3 | int Recv(uint8_t* outBuf, uint32_t* outLen) |
| 4 | int Send(const uint8_t* data, uint32_t len) |
Callback code values:
| Code | Meaning | arg |
|---|---|---|
1 |
Connected | hwnd from StartUp |
2 |
Packet received | hwnd. Drain with Recv until it returns 0 |
3 |
Fatal Winsock error | WSAError cast to void* (do not dereference) |
5 |
Disconnected | hwnd |
Protocol framing: little-endian uint16 length prefix inclusive of the header ([lo][hi][payload...]). Same as the original.
dotnet publish Source\O2Net32\O2Net32.csproj -c Release -r win-x86Output: Build\Publish\O2Net32.dll (x86).
Warning
Plain dotnet build will generate .NET binary which is incompatible with any O2Jam executables.