Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update BSGSD.md #245

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

DaCryptoRaccoon
Copy link

The logging module is imported and configured with a basic logging format and level.
The host, port, message, and num_iterations values are moved to uppercase constants at the beginning of the script for easier modification.
A timeout of 5 seconds is set on the socket using the settimeout() method.
Specific exception handling is added for socket.timeout to handle cases when the socket connection times out.
A generic exception handling block is added to log any other unexpected exceptions that may occur.
The finally block is used to ensure that the socket is closed, regardless of whether an exception occurs or not.
Logging statements are used instead of print statements to provide more informative error messages and results.
The argparse module is used to parse command-line arguments for the client. The script expects arguments like -k, -t, -n, -i,and -p to specify the BSGSD parameters.
The -v option is added to enable verbose output when specified by the user.
The main() function is defined as the entry point for the client. It calls the parse_arguments() function to retrieve the command-line arguments and constructs the message to send to the server.
The client response is parsed and handled based on different scenarios, including "404 Not Found" and "400 Bad Request" responses.
The main() function is called when the script is run, ensuring that the client logic is executed.
Logging statements are added throughout the code to provide informative messages and facilitate debugging.
The client script can be run from the command line with the specified arguments.

@DaCryptoRaccoon DaCryptoRaccoon marked this pull request as draft July 19, 2023 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant