New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bidirectional message sending #14
Comments
This needs to wait for SCTP data channels because send only works with strings right now (because of #5). |
Um... I don't understand. There is no problem if RTP Data Channels don't support duplex channels, i'll open 2 channels, this is not an issue. If content may be only strings its not a issue too, base64 save me. Just wrap DataChannel::Send(const DataBuffer& buffer) call (set up buffer.data from const Arguments& args) into your binding and i hope i'll can make bidirectional data transfer. |
Ok, this is my quick fix before you guys make it normally. Handle DataChannel::Send( const Arguments& args ) { DataChannel* self = ObjectWrap::Unwrap( args.This() ); if(args.Length() == 0) v8::Localv8::String payload = v8::Localv8::String::Cast(args[0]); std::string message = (std::string) v8::String::AsciiValue(payload); self->_internalDataChannel->Send(*buffer); TRACE_END; *** src/peerconnection.js: replace stup DataChannel.prototype.send to this one. DataChannel.prototype.send = function send(data) { And for tests: *** test/bridge.js replace doComplete() function doComplete() *** test/peer.js replace doCreateDataChannels() function doCreateDataChannels() And here is the result, let's look and browser log: signaling state change: have-local-offer peer.js:82 Thats all we need to make real WebRTC peer-to-peer between browser and node.js. |
OK, I did a quick implementation for you to play with, however it will be deprecated for SCTP data channels, which will accept arraybuffers instead. |
Handle DataChannel::Send( const Arguments& args ) {
TRACE_CALL;
HandleScope scope;
DataChannel* self = ObjectWrap::Unwrap( args.This() );
TRACE_END;
return scope.Close(Undefined());
}
Add some code pls. :)
The text was updated successfully, but these errors were encountered: