[Mono-list] Building a cross-platform networked client on Mono...

Jonathan Pryor jonpryor at vt.edu
Tue Jun 21 07:28:23 EDT 2005

On Mon, 2005-06-20 at 17:50 -0700, Kirk Marple wrote:
> i have a need to build a new client application, which does basically
> four things... talks via Windows Sockets (async i/o)


>  to a remote server over both TCP and UDP, 


> does file I/O, 


> exposes UI for picking files on the client and showing log/status
> messages, 


> and it does interop to a native 3rd party DLL for some custom data
> processing.   

Maybe.  Mono supports P/Invoke to libraries with "C" exports, not C++,
not COM, not anything else.  Just "C" exports.

Furthermore, the "native 3rd party DLL" is probably only available on
Windows.  You can't use a native DLL cross-platform -- it can't be used
on Linux (different file formats) or Mac OS X (different processor).

The portability of your app will be dependent upon how portable this DLL
is, or how easily you can avoid the DLL.
> Today, i'm looking at using .NET 2.0/C#/WinForms for this on Windows,
> but i want to make it cross-platform for Linux and Mac OS X.

Mono's support for .NET 2.0 APIs is in-flux (though we can always use
the extra test cases. :-)

WinForms is currently incomplete, but is scheduled for completion around
September, to be released with Mono 1.2.  There will likely still be
some limitations, though, such as restrictions from P/Invoking into
KERNEL32.DLL, USER32.DLL, and other non-portable libraries.  (There may
be a way around this, but I haven't heard of it.)
> Can anyone please confirm the state of Mono today w.r.t. these
> features?   Should it be doable to have a (rather simple) networked
> client, using async socket i/o, and doing interop, and have the same
> code base work x-platform?   Also, I'm not wedded to WinForms, and
> would be fine with something else (Gtk#) if it's similar and easy to
> use.

If you can live with the above restrictions, this should be possible.

You might also look into Cocoa# for the Mac OS X UI.
> Should I be using Mono 1.1.8 to start with?


> What's the easiest development approach (given that we're a Windows
> dev house today)?   Dev on Windows, test on Mac/Linux?   Dev on Linux
> or Mac?

Dev on Windows under Mono, test on Mac/Linux.  Mono/Windows tends to get
less testing than Mono/Linux, so if it runs on Mono/Windows, it's more
likely to run under Linux. :-)

 - Jon

More information about the Mono-list mailing list