-
Notifications
You must be signed in to change notification settings - Fork 100
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
RSocket and transport out of sync #140
Labels
Comments
chacent
changed the title
RSocket is not equal transport
RSocket and transport out of sync
Jun 2, 2021
thanks for answer,i used v0.0.25 const { RSocketServer , BufferEncoders,RSocketClient } = require('rsocket-core');
const RSocketTCPServer = require('rsocket-tcp-server').default;
const RSocketTCPClient = require('rsocket-tcp-client').default;
const {Flowable} = require('rsocket-flowable');
new RSocketServer({
transport:new RSocketTCPServer({port: 80}, BufferEncoders),
getRequestHandler(rsocket, payload){
let subscriber;
rsocket.requestChannel(new Flowable(subscriber=>{
subscriber.onSubscribe({
request: (n) => {
console.log('request occured');
// @bug if i don't call onNext, client will not receive request channel
// subscriber.onNext({data:Buffer.alloc(0)});
debugger
},
cancel(){
debugger
}
});
})).subscribe({
onComplete: () => console.log('complete'),
onError: err => console.log(err),
onNext:x=>{
console.log(x.data);
subscriber.request(1);
},
onSubscribe: x =>{
subscriber = x;
subscriber.request(1);
}
});
}
}).start();
(async(options)=>{
const client = await new RSocketClient({
setup: {
dataMimeType: 'text/plain',
keepAlive: 10000,
lifetime: 86400000,
metadataMimeType: 'text/plain'
},
transport: new RSocketTCPClient({
host: options.host,
port: options.port,
}, BufferEncoders ),
responder:{
requestChannel(flowable) {
console.log('got request');
debugger// forget return value,just for sample
}
}
}).connect();
})({
port: 80,
}); |
and i want to know how i can get current state of rsocket , except for subscribe connectStatus,there is no event style mechanism? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
i have a rsocket instance
when i call requestChannel without any data send, actually request(on the other side) won't be occured.
similar when transport of the rsocket has been gone,and call requestChannel , the subscribe (on the local side) occured where i just want some error been raised
The text was updated successfully, but these errors were encountered: