TCP Server and Client Example Socket Programs "D7-ON" please

I feel your pain @sam_desd . I do not like the USB serial port communication, I prefer turning on and off D7 as proof of concept (I also think it screws up some programs). It is a pain to get going on windows someone needs to make a youtube video showing how to do this. I tend to brute force program, (try lots of things and see what works) and I was trying to get DFU mode working and got the windows drivers for serial installed. Still not sure what I did. The starting link is at

http://docs.particle.io/core/connect/#connecting-your-device-using-windows

and a thread is here

.
.

I tried to get a batch file working to install it on windows but got frustrated with it, but the github site has lots of information.

That is part of why I wrote my youtube IOT Rant

Anyway if you do get USB-serial working, a few extra steps are needed when using it. First connect your core by usb to your computer, on windows, it takes about 30 seconds for the computer to recognize that the driver is connected, the computer should beep. I load "device manager" so I can see which COM port it works on. Then load PUTTY.exe and enter your COM port and 9600.
Then hit the enter key. You should see "Hello Computer"

Many CRobot programs use some way to switch back and forth from this mode.

#define DEBUG = 1  // debug mode on

I find that confusing so I use

bool myUsbSerialDebugOn = true;      // set to false when not hooked up to USB

Then if using windows the Particle Core needs to wait for you to push the enter key so it uses the code

if (myUsbSerialDebugOn){
   Serial.begin(9600);             // Initalize the USB Serial port
   while(!Serial.available()) SPARK_WLAN_Loop();
   Serial.println("Hello Computer");
}

Which continually repeats until you hit that key. Not sure what it does if you are not connected to the computer.

After that in my program I show the code you asked about by the following code

   char myIncoming = client.read();

  if (myUsbSerialDebugOn){  
      Serial.print(myIncoming);
    // delay(2);
  }

Note the commented out //delay(2); This is why I do not like serial, I never know if the serial delay needed to print the information to the screen is messing up the program. Once I had to just get rid of the serial and try it and the darn D7 lite, suggesting the serial was messing with the microcontroller.

I only used the serial in this program to find out what the heck was being sent back and forth to the node js server.

Good luck. I may make videos about DFU and Serial but it is low on my list of things to get ready for September 2015.