Best way to do interprocess communication on Mac OS X

I am currently looking into the same questions. For me the possibility of adding Windows clients later makes the situation more complicated; in your case the answer seems to be simpler. About the options you have considered: Control files: While it is possible to communicate via control files, you have to keep in mind that … Read more

When is IPPROTO_UDP required?

Some operating systems (eg. Linux kernel after 2.6.20) support a second protocol for SOCK_DGRAM, called UDP-Lite. If supported by your system, it would be enabled by providing IPPROTO_UDPLITE as the third argument to the socket() call. It is differentiated from normal UDP by allowing checksumming to be applied to only a portion of the datagram. … Read more

Epoll on regular files

Not really. epoll only makes sense for file descriptors which would normally exhibit blocking behavior on read/write, like pipes and sockets. Normal file descriptors will always either return a result or end-of-file more or less immediately, so epoll wouldn’t do anything useful for them.

Using node.js to listen on 2 different ports

Just create another instance of http and put it to listen to the port you are interested. Let me show you an example: var http = require(‘http’); http.createServer(onRequest_a).listen(9011); http.createServer(onRequest_b).listen(9012); function onRequest_a (req, res) { res.write(‘Response from 9011\n’); res.end(); } function onRequest_b (req, res) { res.write(‘Response from 9012\n’); res.end(); } Then, you can test it (with … Read more

What is the reason and how to avoid the [FIN, ACK] , [RST] and [RST, ACK]

Here is a rough explanation of the concepts. [ACK] is the acknowledgement that the previously sent data packet was received. [FIN] is sent by a host when it wants to terminate the connection; the TCP protocol requires both endpoints to send the termination request (i.e. FIN). So, suppose host A sends a data packet to … Read more

Creating a socket server which allows multiple connections via threads and Java

The problem is that currently you’re accepting the connection, but then immediately performing blocking reads on it until it’s closed: // After a few changes… Socket clientSocket = serverSocket.accept(); BufferedReader in = new BufferedReader(new InputStreamReader( clientSocket.getInputStream())); String nextLine; while ((nextLine = in.readLine()) != null) { System.out.println(nextline); } That means the same thread which accepts the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)