Fortran

Guide To Learn

1. Interoperability with C: Exposing your app to the web

Checking IP address values

Testing is recommended. Having made our call to ipaddr_local, we have no clue whether it worked or not. All that we know is that the program didn’t crash with any error message. After we initialize ipaddr, we can use libdill functions to explicitly check for the IP address and port number values stored. First, let’s take a look […]

Initializing the IP address structure

Now that we have a derived type to interface with the ipaddr struct, let’s create an instance of it. libdill provides two functions to instantiate the ipaddr struct: ipaddr _local and ipaddr_remote. The former is used on the server side, where you want to open up a socket to listen to incoming connections. The latter is used on the client side, where you want […]

TCP server program: Receiving network connections

Perhaps the best advice is just to be careful. Don’t type things in you don’t understand. Debugging takes too much time. Have a mental picture (or a real drawing) of how your C code is using memory. That’s good advice in any language, but in C it’s critical.  –Nick Parlante, Essential C Although this quote […]

Installing libdill

Before we write any Fortran code, we’ll first download and compile the C library that we’ll work with: libdill. You can download the code from http://libdill.org/download .html. This page also includes brief installation instructions. For our work, we won’t need to install libdill systemwide. Instead, we’ll compile it and take a copy of the compiled library […]

Introducing networking to Fortran

The C programming model is that the programmer knows exactly what they want to do and how to use the language constructs to achieve that goal. The language lets the expert programmer express what they want in the minimum time by staying out of their way.  –Nick Parlante, Essential C While there are easier ways […]

Interfacing C: Writing a minimal TCP client and server

Some languages are forgiving. The programmer needs only a basic sense of how things work. Errors in the code are flagged by the compile-time or run-time system, and the programmer can muddle through and eventually fix things up to work correctly. The C language is not like that.   –Nick Parlante, Essential C C is a […]

Scroll to top