Update:
I am still not able to connect to a socket.io server, and I'm beginning to wonder if the changes between the <Ethernet.h> and the <Ethernet2.h> libraries introduced something. Sample codes from various libraries cannot connect to either remote or local servers.
Here is what I can see with a packet sniffer when connecting to a local machine running a node server with a simple socket.io script looking for JSON data. The Arduino is using Bill Roy's SocketIOClient library.
I see the Arduino try to open the communication, which the PC acknowledges, then 84 TCP messages going back and forth between the Arduino and the PC. The PC is just sending an acknowledgement and the Arduino sending mostly just linefeeds and the occasional carriage return.
Then a message from the PC:
HTTP/1.1 400 Bad Request
Content-Type: application/json
Hypertext Transfer Protocol
HTTP/1.1 400 Bad Request
Content-Type: application/json
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: Arduino
Date: Thu, 29 Dec 2016 16:52:01 GMT
Connection: keep-alive
Transfer-Encoding: chunked
{"code": 0,"message":"Transport unknown"}
And then both signal to disconnect.
This raises two questions about the failure to communicate.
Is the server terminating the connection because the Arduino is not sending anything? (failure on the Arduino side)
Is the Arduino waiting for something from the server? (failure on the server side)
Anyone have an ideas?
BTW, I did find the SocketIOClient library calls the standard Ethernet library, and I changed that to Ethernet2 (which gave the compiler a fit before I changed that).
EDIT: I found an older shield and tried it again with the older Ethernet.h library, and no change.
However, I did accidently try talking with the wrong port number and got this response:
Not connected.
Drop HTTP/1.1 400 Bad Request
Drop Content-Type: text/html; charset=us-ascii
Drop Server: Microsoft-HTTPAPI/2.0
Drop Date: Thu, 29 Dec 2016 21:51:24 GMT
Drop Connection: close
Drop Content-Length: 326
Drop
Drop
Drop Bad Request
Drop
Drop
Bad Request - Invalid Verb
Drop
HTTP Error 400. The request verb is invalid.
Drop
Basically, it connects and the Arduino offers a handshake, but gets this as a reply.