Q:

Is socket server "hit" when socket client checks for data?

I have set up a PHP server writing to a socket every second.
while(1) {
  $message = "Hello, World!";
  socket_write($socket, $message, strlen($message));
  sleep(1);
}

Then I have a Lua client (Corona SDK) which checks the socket every 1/10 second for data:
timer.performWithDelay(100, function() sock:receive() end, 0) end

My question is: Is the server "hit" every time sock:receive() is run? Or does sock:receive() only check local buffers?
To rephrase the question: Will the server receive more load the more often I run sock:receive()? Or is it totally unaffected by this?

A:

No, socket receive does not 'hit' the server.  If possible, you can run Wireshark on the server side to prove to yourself that nothing is sent when a client calls something like receive or read.  A small amount of data is exchanged with a client to setup a socket, but, once the socket is setup, nothing is sent from the client when reading.
Some background info is available in Beej's Guide

