Git Product home page Git Product logo

diocp-v5's People

Contributors

suiyunonghen avatar ymofen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

diocp-v5's Issues

WebSocket client

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 ?

waiting for completion / synchroniuos call

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
  ================================

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.