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 #7

Closed
mrkraimer opened this issue Jun 29, 2016 · 2 comments
Closed

Comments

@mrkraimer
Copy link
Contributor

ChannelRequesterImpl does not implement channelStateChange
...
public void channelStateChange(Channel c, ConnectionState isConnected) {
// noop
}
...

This should send the channelStateChange to the client.

@msekoranja
Copy link
Contributor

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);
    }
}

@ralphlange
Copy link
Contributor

Copied to its new home.
Closing.

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

3 participants