Skip to content

Tag: linux

Detect client is disconnected

I have a simple program that listens to a socket. Everything goes fine except when the connection is lost in while(1) cycle. In this case the program falls into read from socket for many times without result. How can I detect a disconnected client in while(1) cycle? Answer Change: To: Also, your code mishandl…

How to run Ionic serve permanently?

I am using Ionic framework for one application. The code is on a linux server. I am running the application using ionic serve command through putty. But, the problem is if I close the putty the application is stopped. Is there any way to run the ionic serve permanently as a daemon process? Answer I’m su…

Linux Mint: Bitnami Xampp access issue

I have installed Bitnami Xampp on linux mint, it is installed inside /opt/ The application is unable to access(Write/Read) files and hence not able to work on it. Any Solution Please…….. Thank You Answer After the previous setting –$ sudo chmod -R 777 opt Xampp is not working with following …

Time spends in CPU faster than in reality

I am wondering why my entire application runs in less than 8 seconds while the time obtained from clock_gettime is 19.3468 seconds which is more than two times as much as what happens in reality. Where is the problem from? Update: I am not using any OpenMP explicitly. Answer CLOCK_MONOTONIC should be used if …

Docker compose build error

If I use command docker-compose build, I’ll get error that looks like: I use the last version docker and docker-compose. My docker-compose.yml has the next code: I use an ubuntu 14.04 Could you tell me how is fix it? Answer You need to put the port definitions in quotes for short ports (2 digits). This …