Comments (4)
So right now it sends a maximum of 32767 bytes in one call. This would be
fine, except that in the second call which would send the remaining bit of
data, there are bytes missing as described here:
http://stackoverflow.com/questions/5857406/bytes-missing-between-websocket-calls
Original comment by [email protected]
on 2 May 2011 at 2:14
from phpwebsocket.
Related issue, when onmessage is being called multiple times, every call except
the first has its first byte missing. No idea how to fix. Also don't know
what the purpose of the following line of code is the unwrap():
return substr($msg,1,strlen($msg)-2);
Why is it shaving off two characters at the end? Shouldn't it just shave off
the the chr(255)?
Original comment by [email protected]
on 3 May 2011 at 4:26
from phpwebsocket.
[deleted comment]
from phpwebsocket.
Hi, I encounter the same issue and simply solve it by change the unwrap
function to this :
function unwrap($msg=""){
$firstChar = substr($msg,0,1);
$lastChar = substr($msg,-1);
if ($firstChar==chr(0) && $lastChar==chr(255))
return substr($msg,1,strlen($msg)-2);
elseif ($firstChar==chr(0))
return substr($msg,1);
else
return substr($msg,0,strlen($msg)-1);
}
this function should delete the chr(0) in the head and the chr(255) in the
tail, but when a message is divided into several pieces, chr(0) and chr(255) in
fact are not exist in each fragment
Original comment by [email protected]
on 9 May 2011 at 10:47
from phpwebsocket.
Related Issues (20)
- Patch for /trunk/ phpwebsocket/websocket.class.php
- Decode broken when multiple calls same time
- Use on own Webspace on Strato
- what is" function $ (id)" is exactly doing in client code?
- update new version
- can't run the app
- Running on windows HOT 1
- Several Clients
- Patch for /trunk/ phpwebsocket/server.php
- Space ' ' in directory name
- on send button click getting InvalidStateError HOT 1
- Getting weird characters at the server side. HOT 1
- Patch for /trunk/ phpwebsocket/server.php
- Error during WebSocket handshake: 'Sec-WebSocket-Accept' header is missing HOT 1
- Patch for /trunk/ phpwebsocket/client.html
- Patch for /trunk/ phpwebsocket/websocket.class.php
- Patch for /trunk/ phpwebsocket/server.php
- Patch for /trunk/ phpwebsocket/client.html
- Patch for /trunk/ phpwebsocket/chatbot.demo.php
- socket_tcp_bind: tcp_socket: Can't assign requested address
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 phpwebsocket.