当前位置: 首页>>代码示例>>C++>>正文


C++ StreamSocket::impl方法代码示例

本文整理汇总了C++中StreamSocket::impl方法的典型用法代码示例。如果您正苦于以下问题:C++ StreamSocket::impl方法的具体用法?C++ StreamSocket::impl怎么用?C++ StreamSocket::impl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在StreamSocket的用法示例。


在下文中一共展示了StreamSocket::impl方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: acceptConnection

SocketImpl* SecureSocketImpl::acceptConnection(SocketAddress& clientAddr)
{
	poco_assert (!_pSSL);

	StreamSocket ss = _pSocket->acceptConnection(clientAddr);
	Poco::AutoPtr<SecureStreamSocketImpl> pSecureStreamSocketImpl = new SecureStreamSocketImpl(static_cast<StreamSocketImpl*>(ss.impl()), _pContext);
	pSecureStreamSocketImpl->acceptSSL();
	pSecureStreamSocketImpl->duplicate();
	return pSecureStreamSocketImpl;
}
开发者ID:JerkWisdom,项目名称:zpublic,代码行数:10,代码来源:SecureSocketImpl.cpp

示例2: attach

SecureStreamSocket SecureStreamSocket::attach(const StreamSocket& streamSocket, const std::string& peerHostName, Context::Ptr pContext, Session::Ptr pSession)
{
	SecureStreamSocketImpl* pImpl = new SecureStreamSocketImpl(static_cast<StreamSocketImpl*>(streamSocket.impl()), pContext);
	SecureStreamSocket result(pImpl);
	result.setPeerHostName(peerHostName);
	result.useSession(pSession);
	pImpl->connectSSL();
	return result;
}
开发者ID:Denisss025,项目名称:poco,代码行数:9,代码来源:SecureStreamSocket.cpp

示例3: run

void HTTPSTestServer::run()
{
    _ready.set();
    Poco::Timespan span(250000);
    while (!_stop)
    {
        if (_socket.poll(span, Socket::SELECT_READ))
        {
            StreamSocket ss = _socket.acceptConnection();
            try
            {
                _lastRequest.clear();
                char buffer[256];
                int n = ss.receiveBytes(buffer, sizeof(buffer));
                while (n > 0 && !_stop)
                {
                    _lastRequest.append(buffer, n);
                    if (!requestComplete())
                        n = ss.receiveBytes(buffer, sizeof(buffer));
                    else
                        n = 0;
                }
                std::string response = handleRequest();
                ss.sendBytes(response.data(), (int) response.size());
                if(_lastRequest.find("/connection/abort")!=std::string::npos) {
                    SecureStreamSocketImpl* sss = dynamic_cast<SecureStreamSocketImpl*>(ss.impl());
                    if(sss!=NULL) sss->abort();
                }
                Poco::Thread::sleep(1000);
            }
            catch (Poco::Exception& exc)
            {
                std::cerr << "HTTPSTestServer: " << exc.displayText() << std::endl;
            }
        }
    }
}
开发者ID:ConfusedReality,项目名称:pkg_network_poco,代码行数:37,代码来源:HTTPSTestServer.cpp


注:本文中的StreamSocket::impl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。