Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #12 from codebendercc/master

Multiple connection issue.
  • Loading branch information...
commit 77828808906b69a9ac3b9ae25195c9dc61b78c01 2 parents 89f9b1d + 1c2d5db
@ejeklint authored
View
0  Base64.cpp 100644 → 100755
File mode changed
View
0  Base64.h 100644 → 100755
File mode changed
View
2  README.md 100644 → 100755
@@ -8,7 +8,7 @@ The implementation in this library has restrictions as the Arduino platform reso
* The server **only** handles **single byte** chars. The Arduino just can't handle UTF-8 to it's full.
* The server **only** accepts **final** frames with maximum payload length of 64 bytes. No fragmented data, in other words.
* For now, the server silently ignores all frames except TXT and CLOSE.
-* The server **only** handles one client at a time. Trying to connect two at the same time will ruin your day.
+* The server **only** handles one client at a time. Trying to connect two at the same time will force the old client to disconnect.
* There's no keep-alive logic implemented.
_Required headers (example):_
View
9 WebSocket.cpp 100644 → 100755
@@ -4,6 +4,8 @@
//#define DEBUG
+
+
struct Frame {
bool isMasked;
bool isFinal;
@@ -32,9 +34,11 @@ void WebSocket::begin() {
void WebSocket::listen() {
- if (client = server.available()) {
- if (client == true) {
+ EthernetClient cli;
+ if (cli = server.available()) {
+ if (cli == true) {
if (state == DISCONNECTED ) {
+ client = cli;
if (doHandshake() == true) {
state = CONNECTED;
if (onConnect) {
@@ -220,6 +224,7 @@ bool WebSocket::getFrame() {
#ifdef DEBUG
Serial.println("Unhandled frame ignored.");
#endif
+ return false;
break;
}
return true;
View
4 WebSocket.h 100644 → 100755
@@ -33,6 +33,10 @@ THE SOFTWARE.
-------------
Now based off version 13
http://datatracker.ietf.org/doc/rfc6455/?include_text=1
+
+Modified by Alexandros Baltas, 2013
+www.codebender.cc
+
*/
#include <Arduino.h> // Arduino 1.0 or greater is required
View
0  examples/Websocket_Demo/Websocket_Demo.ino 100644 → 100755
File mode changed
View
0  sha1.cpp 100644 → 100755
File mode changed
View
0  sha1.h 100644 → 100755
File mode changed
View
0  websocket.html 100644 → 100755
File mode changed
Please sign in to comment.
Something went wrong with that request. Please try again.