How to check connectivity between raspberry pi (which act as a client) and server using web-socket
Use nmap with the -p option to have it "ping" the specific port you'd like to test. You can cron this, or script it in any number of ways.
The nice thing about this is you can test the TCP connectivity without creating logs on the server or take it a step further and get the version information from the server which will confirm that the server itself is responding to requests.
You can do this with lots of other tools like curl or wget and each have different advantages and disadvantages. Alternatively there are lots of small-footprint network monitoring tools which would also do the job.
If you are also looking to log this data setting up something like MRTG or RRD may also be useful to spot patterns in downtime.