The solution to this problem lies in the way you have implemented your client/server applications. It is important, when receiving input from a user through fgets, to also have an extra check for the signal that is being handled for SIGINT. As such, you will need to create an additional if statement where you can handle cases that involve pressing CTRL+C and other signal interactions.
This will allow your application to both receive user inputs while also giving them their desired output, even if they are only partially done with their input command or action. Additionally, it is important to consider using sigaction rather than SIGNAL in order to ensure higher signal handling reliability within your application.
Thank you for your response, could you please, very breafly, tell me how to do this (no code obviously, just the "theory" behind it) or point me towards some articles/videos you know of?
𝕷𝖔𝖗𝖊𝖓𝖟𝖔
Mohamed
Chat Boss
klimi
Notaxmar
#define CLEAR_BUFFER while ( getchar ( ) != ’ \n ’ )
Jose
mito
浩
MaaKa
Alik
Olivia