Hey gang,
So I am working on honing my C skills in FreeBSD. My main issue is that I have a use case to look for input on an open socket, while still seeming "interactive" to the user.
My first thought was to mimic something like a text editor, that can accept input while simultaneously performing other tasks and populating the screen accordingly.
Right now, my application runs in series so the only way I can get an updated response from the server, is by sending a message out.
My gut is telling me multithreading, but that seems messy. I know I have seen this type of application in FreeBSD for years. So I would imagine there are probably some good libraries, or working examples?
Can anyone suggest a good FreeBSD lib or port that might be helpful?
I really would like to use an existing lib (if one is available) for FreeBSD.
So I am working on honing my C skills in FreeBSD. My main issue is that I have a use case to look for input on an open socket, while still seeming "interactive" to the user.
My first thought was to mimic something like a text editor, that can accept input while simultaneously performing other tasks and populating the screen accordingly.
Right now, my application runs in series so the only way I can get an updated response from the server, is by sending a message out.
Code:
while(1){
//Look for input from user scanf()
//Echo response from open socket to stdout
}
My gut is telling me multithreading, but that seems messy. I know I have seen this type of application in FreeBSD for years. So I would imagine there are probably some good libraries, or working examples?
Can anyone suggest a good FreeBSD lib or port that might be helpful?
I really would like to use an existing lib (if one is available) for FreeBSD.