NetSim 1.0.0
An educational network simulation software for students
Loading...
Searching...
No Matches
Public Member Functions | List of all members
NetSim::TCPClientConnectionCloseStrategy Class Reference

Implements the client-side TCP connection close strategy. More...

#include <tcpclientconnectionclosestrategy.h>

Inheritance diagram for NetSim::TCPClientConnectionCloseStrategy:
Inheritance graph
[legend]
Collaboration diagram for NetSim::TCPClientConnectionCloseStrategy:
Collaboration graph
[legend]

Public Member Functions

 TCPClientConnectionCloseStrategy ()=default
 Default constructor.
 
virtual ~TCPClientConnectionCloseStrategy ()=default
 Default destructor.
 
void handle (Package package, Host *host) const override
 Handles the package to close the connection.
 
- Public Member Functions inherited from NetSim::IPackageStrategy
 IPackageStrategy ()=default
 Default constructor.
 
virtual ~IPackageStrategy ()=default
 Virtual destructor to ensure correct cleanup for derived classes.
 
virtual void handle (Package package, Host *host) const =0
 Abstract method for handling packages.
 

Detailed Description

Implements the client-side TCP connection close strategy.

This strategy handles the client-side behavior when attempting to close a TCP connection. It defines how a package should be processed by a client when closing a connection to the server.

Constructor & Destructor Documentation

◆ TCPClientConnectionCloseStrategy()

NetSim::TCPClientConnectionCloseStrategy::TCPClientConnectionCloseStrategy ( )
default

Default constructor.

◆ ~TCPClientConnectionCloseStrategy()

virtual NetSim::TCPClientConnectionCloseStrategy::~TCPClientConnectionCloseStrategy ( )
virtualdefault

Default destructor.

Member Function Documentation

◆ handle()

void NetSim::TCPClientConnectionCloseStrategy::handle ( Package  package,
Host host 
) const
overridevirtual

Handles the package to close the connection.

Parameters
packagePackage to be processed.
hostClient host.

This method is responsible for processing the package intended to close the connection. It looks up the router associated with the connection, retrieves the HTTP process from the client's host, and forwards the closing handshake package to the router.

Implements NetSim::IPackageStrategy.

Here is the call graph for this function:

The documentation for this class was generated from the following files: