I need a program that demonstrates how to use some WebSocket functions from the Microsoft API for teaching purposes.
The program(s) should be in C and in PowerBasic. They should be console programs.
The C program should compile using Visual Studio 17.
The Powerbasic program should compile using Powerbasic 10 for Windows.
There is no need for user input / output as the programs will mostly be run in debug mode.
Variables can be hard coded into the C Main and PBMain functions.
You can test your program at
http://websocket.org/echo.html - there are instructions to use their echo server.
The program should accept a URL and port number - connect then establish a websocket session.
There should be a way to SEND and RECEIVE data. A callback function should signal when there is data in the receive buffer. You need to call WinHttpSetStatusCallback to set a callback for the WebSocketHandle returned in WinHttpWebSocketCompleteUpgrade.
The program (or 2 programs) should use the Windows WinHttpWebSocket functions for one sample and the Windows WebSocket Protocol Component API for the other.
We want to teach our students both the winhttp and web-socket-protocol-component-api.
About the recuiterMember since Nov 11, 2022 Dr.mohan
from Zurich, Switzerland