Skip to content

modern-fortran/tcp-client-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tcp-client-server

A minimal TCP client and server in Fortran, used to teach interoperability with C. Companion code for Chapter 11 of Modern Fortran: Building Efficient Parallel Applications.

It uses libdill as a sockets library.

The documentation for libdill is located on GitHub Pages here.

If you are using macOS, you can avoid building the library from source and simply install the Homebrew formula:

brew install libdill

Please note that the install instructions from the book (downloading libdill-2.14) do not work with gfortran v9.x or later. The download and install procedure for libdill has been updated in this repo to allow building with the latest versions of gfortran.

Getting started

Download and build the code:

git clone https://github.com/modern-fortran/tcp-client-server
cd tcp-client-server
make

Running the server

In one terminal window, run the server:

./server 
 Listening on socket:
   IP address: 127.0.0.1                                    
   Port:         5555

Running the client

In another terminal window, run the client:

./client 
                    5 Hello 

On client connection, the server will report:

 New connection from 127.0.0.1

About

A minimal Fortran TCP client and server

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published