Skip to content
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

org.epics.pvaccess.server.impl.remote.handlers.CreateChannelHandler #32

Open
ralphlange opened this issue Oct 8, 2018 · 0 comments
Open

Comments

@ralphlange
Copy link
Contributor

@mrkraimer opened this issue on Jun 29, 2016:

ChannelRequesterImpl does not implement channelStateChange

...
public void channelStateChange(Channel c, ConnectionState isConnected) {
// noop
}
...

This should send the channelStateChange to the client.

@msekoranja commented on Aug 17, 2016:

Message should not be send directly to the client. When DISCONNECTED/CLOSED state is received it should destroy the channel and send message. See C++ code:

void ServerChannelRequesterImpl::channelStateChange(Channel::shared_pointer const & /*channel*/, const Channel::ConnectionState isConnected)
{
    if(isConnected==Channel::CONNECTED || isConnected==Channel::NEVER_CONNECTED)
        return;

    if(Transport::shared_pointer transport = _transport.lock())
    {
        ChannelHostingTransport::shared_pointer casTransport = dynamic_pointer_cast<ChannelHostingTransport>(transport);
        if (!casTransport)
            return;

        ServerChannelImpl::shared_pointer channel;
        {
            Lock guard(_mutex);
            channel= dynamic_pointer_cast<ServerChannelImpl>(_serverChannel.lock());
        }

        if (!channel)
            return;

        // destroy
        channel->destroy();

        // .. and unregister
        casTransport->unregisterChannel(channel->getSID());

        // send response back
        TransportSender::shared_pointer sr(new ServerDestroyChannelHandlerTransportSender(channel->getCID(), channel->getSID()));
        transport->enqueueSendRequest(sr);
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant