Reputation: 11
I have developed Linux socket server connection which is working fine.
When start from terminal it start from listening from client. but when I close terminal it stops listening.
I need to continue even though the terminal closed by user from started.
how can I run server socket application in Linux as background process?
am run using ./a.out 8888(portno)
again i will connect error will come (connection refused)
now what do i?
Thank You.
Upvotes: 1
Views: 1197
Reputation: 540055
You can use nohup
to keep the program running if the Terminal is closed:
nohup ./a.out 8888 &
(Standard output/error will be written to nohup.out instead of the Terminal.)
Upvotes: 0
Reputation: 11063
On terminal execute the script ending with &.
A task can usually be started and run as a background task by putting a '&' at the end of the command line.
Check this:
Upvotes: 2