JoaoESmoreira RC-Project

Communication Networks Project

The main objective of the project is to build a socket transaction system for the Networking and Communication subject.

The full repository and documentation can be found here: RC-Project Repository.

Tools and Technologies

In order to run this project, it is required to have some tools. A C compiler such as gcc (or others) and an operating system such as GNU/Linux are necessary. In this case, we are using a Lubuntu distribution.

We assume that netcat is installed by default in the OS. Otherwise, you will have to install it manually.

Obtain the Main Code

To obtain the source code, open your terminal and clone this project:

git clone https://github.com/JoaoESmoreira/RC-Project

Compile

Once you have access to the repository, you can compile the code. There are two options: compile without print debug or compile with print debug.

make
make debug

After that, two executables will be created: stock_server and operations_terminal.

Run

To run the server, execute:

./stock_server {STOCK PORT} {CONFIG PORT} {config file}

In another terminal, use netcat to simulate the admin usage:

nc -u localhost 9876

Finally, for user usage:

./operations_terminal {IP ADDRESS of server} {STOCK PORT}

Running Server

First of all, the admin must log in with their credentials. To do this, just press Enter and the server will send you messages with the respective instructions.

After you run the server and netcat, it is time for the admin to send some instructions to the server.

Admin Interaction

Operations

  • Add a New User
    ADD_USER {username} {password} {the sockets we have access} {budget}
    
  • List All Users
    LIST
    
  • Delete a User
    DEL {username}
    
  • Refresh the Time
    REFRESH {new time}
    
  • To Log Out
    QUIT
    
  • To Turn Off the Server
    QUIT_SERVER
    

User Interaction

When you log in as a user, the server will ask for your credentials. It’s only possible to log in if the admin has previously added you.

The operations are selected by a number, and the server will send all the information you need.

You can:

  • Subscribe to a market to receive all information via multicast
  • Buy auctions
  • Sell auctions
  • Turn on/off the market feed
  • Check your wallet
  • Log out

Footer

Copyright © 2025 Joao ES Moreira

The contents of this website are licensed under the Creative Commons Attribution-NoDerivatives 4.0 International License (CC-BY-ND 4.0).

The source code of this website is licensed under the MIT license, and available in GitHub repositor. User-submitted contributions to the site are welcome, as long as the contributor agrees to license their submission with the CC-BY-ND 4.0 license.