Giter VIP home page Giter VIP logo

Comments (8)

yvbeek avatar yvbeek commented on May 25, 2024 2

Fixed in 0.17

from telegraph.

yvbeek avatar yvbeek commented on May 25, 2024 1

The WebSocket implementation in Telegraph is kinda bare bones, but it should be functional. Do you perhaps have a test project for me to illustrate the problem? A project with Telegraph and Starscream would be great, then I can see how Telegraph responds. I've tested Telegraph with the WebSocket client in Chrome and that worked fine.

from telegraph.

chajuss avatar chajuss commented on May 25, 2024

Thanks for the reply :)

I've created a test application that simulates some of my actual app flow, however the issue currently doesn't reproduce. I'll investigate the matter and post again once I found a reason and/or solution.

I did notice that the rate of sending data over the server's websocket drops from the expected 1MB/s to about 0.3MB/s (the data I'm sending is H.264 encoded video @ 1080p, 8Mb/s using VideoToolbox on the server device end). In addition the client's return messages don't seem to be received by the server.

This might be a bug on my end, but the test application also has an implementation with PocketSocket WebSocket Server, which seems to keep a steady transmission rate, and receives the messages sent from client without an issue.

from telegraph.

Joebayld avatar Joebayld commented on May 25, 2024

I have the same issue, but only when sending many packets to clients very quickly. I'll try and get a test app made..

from telegraph.

joshavant avatar joshavant commented on May 25, 2024

I am also having this issue.

The setup is basic:

  • A macOS WebSocket server and an iOS WebSocket client
  • iOS app generates 3MB of random Data and sends it to server via WebSocketClient.send(data:)

Result is occasionally getting this:

[CLIENT] WebSocket disconnected, error: Error Domain=NSPOSIXErrorDomain Code=32 "Broken pipe" UserInfo={NSLocalizedDescription=Broken pipe, NSLocalizedFailureReason=Error in write() function}

...or, if not, a quiet and gracefully closed connection. No matter what, the connection always gracefully closes, instead of sending the data, as expected.


Test applications are here:
macOS (Server) - https://github.com/joshavant/BrokenPipeDemoDesktop
iOS (Client) - https://github.com/joshavant/BrokenPipeDemo

Repro Instructions:

  1. Run macOS WebSockets server application
  2. Run iOS WebSockets client application
  3. Observe in macOS console that iOS client has connected to WebSockets server
  4. Wait 2 seconds for iOS to automatically send 3MB of random data via WebSockets connection

Expected Behavior: Data is successfully received by macOS application
Actual Behavior: Data is not successfully received by macOS application and WebSockets connection closes

from telegraph.

yvbeek avatar yvbeek commented on May 25, 2024

@joshavant Thank you so much for the demo applications.

This problem was caused by an issue in the WebSocket parser. I've fixed that issue in commit ed55f1a

Your demo applications now work as they should. You can try it out yourself by replacing the Telegraph line in your podfiles with:

pod 'Telegraph', :git => 'https://github.com/Building42/Telegraph.git'

If you run into any errors about Swift versions, please set a Swift language version on your project:

image

I'll probably release a new version of Telegraph tomorrow. There are a few threading improvements that I'm finishing up that I want to add to the new release.

from telegraph.

yvbeek avatar yvbeek commented on May 25, 2024

@chajuss @Joebayld Can you please try the new commit of Telegraph? It will probably fix your websocket issues. Use this in your podfile to try it out:

pod 'Telegraph', :git => 'https://github.com/Building42/Telegraph.git'

from telegraph.

chajuss avatar chajuss commented on May 25, 2024

Sorry, I used PocketSocket for now, however I will give Telegraph an extra shot once I'll get the time to do the switch.

from telegraph.

Related Issues (20)

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.