user1844030
user1844030

Reputation: 11

Linux TCP/IP Socket Programming

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

Answers (2)

Martin R
Martin R

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

Carlos Landeras
Carlos Landeras

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:

Linux Background Job

Upvotes: 2

Related Questions