File tree Expand file tree Collapse file tree 4 files changed +9
-27
lines changed
example_server_binary/bin Expand file tree Collapse file tree 4 files changed +9
-27
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -55,7 +55,12 @@ namespace ofxLibwebsockets {
5555
5656 // send anything that has pixels
5757 template <class T >
58- void sendBinary ( T& image );
58+ void sendBinary ( T& image ){
59+ if ( connection != NULL ){
60+ int size = image.getWidth () * image.getHeight () * image.getPixels ().getNumChannels ();
61+ connection->sendBinary ( (char *) image.getPixels ().getData (), size );
62+ }
63+ }
5964
6065 // send any binary data
6166 void sendBinary ( ofBuffer buffer );
Original file line number Diff line number Diff line change @@ -69,10 +69,12 @@ namespace ofxLibwebsockets {
6969 // send anything that has pixels to all connections
7070 template <class T >
7171 void sendBinary ( T& image ){
72+ int size = image.getWidth () * image.getHeight () * image.getPixels ().getNumChannels ();
73+
7274 lock ();
7375 for (int i=0 ; i<connections.size (); i++){
7476 if ( connections[i] != NULL ){
75- connections[i]->sendBinary ( image );
77+ connections[i]->sendBinary ( ( char *) image. getPixels (). getData (), size );
7678 }
7779 }
7880 unlock ();
Original file line number Diff line number Diff line change @@ -209,14 +209,6 @@ namespace ofxLibwebsockets {
209209 connection->send ( message );
210210 }
211211 }
212-
213- // --------------------------------------------------------------
214- template <class T >
215- void Client::sendBinary ( T& image ){
216- if ( connection != NULL ){
217- connection->sendBinary (image);
218- }
219- }
220212
221213 // --------------------------------------------------------------
222214 void Client::sendBinary ( ofBuffer buffer ){
You can’t perform that action at this time.
0 commit comments