Comments (8)
Fixed in 0.17
from telegraph.
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.
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.
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.
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 viaWebSocketClient.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:
- Run macOS WebSockets server application
- Run iOS WebSockets client application
- Observe in macOS console that iOS client has connected to WebSockets server
- 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.
@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:
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.
@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.
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)
- How to proxy requests? HOT 1
- How to upload file to server ? HOT 1
- Assistance with route formatting
- Xcode 14 beta 6 - Redefinition of enumerator error HOT 3
- MacOS Example Needed Modifications HOT 2
- IOS Test App provided does not allow connection from outside device HOT 1
- SecPKCS12Import should not be called on the main thread HOT 3
- Using with command line tool HOT 1
- Expose WebSocketConnections HOT 1
- Xcode 14.1/2 - Redefinition of enumerator error HOT 8
- HEAD method doesn't seem to work HOT 2
- Deprecated SecureTransport dependency HOT 1
- serverHTTP.serveDirectory(Bundle.main.url(forResource: "Demo", withExtension: nil)!) can not runing HOT 1
- How to make a stream response? HOT 1
- Unable to load caCertificate
- How to change HTTPConfig.readTimeout dynamically? HOT 1
- VisionOS support HOT 1
- Privacy Manifest HOT 6
- Different levels of concurrency for post and get routes.
- How to tell when server is up and running after backgrounded or startup
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from telegraph.