ymofen / diocp-v5 Goto Github PK
View Code? Open in Web Editor NEWdelphi iocp, http, websocket, ntrip
License: BSD 2-Clause "Simplified" License
delphi iocp, http, websocket, ntrip
License: BSD 2-Clause "Simplified" License
怎么没有https的webserver
Please use English in docs!
TDiocpWebSocketTcpClient
doesn't seem to be compatible with non DIOCP servers. For example while trying to connect to ws://echo.websocket.org
, the server will return error 400 (bad request). This happens due to missing headers like Sec-WebSocket-Key
and Sec-WebSocket-Version
. I've tried to update the class by adding those headers in TDiocpWebSocketContext.PostWebSocketRequest
, then server returned a valid handshake (101) but right after that closed the connection with close code 1002 (protocol error). I guess your implementation of WebSocket is based on first versions of this "protocol".
Are you planning to update this class ?
diocp 能支持datasnap吗
create wsClient:
DoInitializeWebSocketClient;
var FWsClient: TDiocpWebSocketContext;
FWsClient := NewWsClient();
FWsClient.OnRecv := OnRecv;
FWsClient.OnDisconnectedEvent := OnDisconnected;
//FWsClient.OnShakeHand := OnShakeHand;
FWsClient.Masked := True;
send data:
var S: string;
var lvBytes:TBytes;
if not FWsClient.Active
then FWsClient.Open('ws://localhost:3000/echo')
else ? how CHECK FWsClient is in processed
? if FWsClient.Processed then exit
===========================================
S := '{"method":"PingDevice","step":0}';
lvBytes := StringToUtf8Bytes(S);
FWsClient.SendBuffer(@lvBytes[0], Length(lvBytes), OPT_TEXT);
? how WAIT finally received data
? FWsClient.WaitingCompletion
================================
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.