Sign in to follow this  

OCaml + cross-platform networking?

This topic is 4107 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'd like to try out OCaml. It seems nice and all, but it seems that only through the Unix-module (which is only moderately implemented on Windows platforms if I understood the docs correctly) can you initiate a network connection. Does anybody have experience with "cross-platform" networking in OCaml and can confirm that this is correct? It just doesn't seem right to rely on a module named <<Unix>> when programming in Windows and I thought there must be some other way, but all I could find was something called CGI (which I think is only for webservers or something) and things that I couldn't understand.

Share this post


Link to post
Share on other sites
Quote:
Original post by ToohrVyk
You are correct. However, the networking part of the Unix module is fairly well implemented on Windows as well, so you shouldn't have much trouble using it.


In the docs it says:
Quote:
The Cygwin port of Objective Caml fully implements all functions from the Unix module. The native Win32 ports implement a subset of them. Below is a list of the functions that are not implemented, or only partially implemented, by the Win32 ports. Functions not mentioned are fully implemented and behave as described previously in this chapter.

I don't fully understand what cygwin and what a cygwin port is but the mingw-compiler must qualify as that, right? So as long as I use mingw to compile my programs I will be able to use ALL the functions listed in the unix module?

Also, when I have compiled my program(using mingw), will it be dependant on a DLL for those functions to work? Thank you for your time

Share this post


Link to post
Share on other sites
There are three versions of caml:
  • The unix version.
  • The cygwin version. Cygwin is an Unix emulator for windows. Cygwin programs require the cygwin DLL. The Cygwin-bundled version of mingw is not the same as the windows-compatible version of mingw.
  • The windows version.


The Cygwin version is just an unix emulator, so all unix functions also work when compiling in a cygwin environment. However, you need the cygwin environment to run it.

The Windows version only contains a limted amount of functionality. This is because Windows does not support links, signals and other similar details. It does, however, support sockets, so the socket part of the library is usable even on a pure Win32 port.

Share this post


Link to post
Share on other sites

This topic is 4107 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this