1
Vote

list iterator not dereferencable (PushFramework3.0)

description

.\3.0\ProtocolFramework\src\Connection.cpp (line 57)
ProtocolContext& Connection::getProtocolContext( Protocol* pProtocol )
    {
        protocolContextMapT::iterator it  = internal->protocolContextMap.find(pProtocol);
        return *(it->second);
    }
when internal->protocolContextMap.size() = 0, error

comments

smiletiger wrote Oct 13, 2014 at 8:50 AM

stack info:
>   ProtocolFramework.dll!ProtocolFramework::Connection::getProtocolContext(ProtocolFramework::Protocol * pProtocol) 行 56   C++
    ProtocolFramework.dll!ProtocolFramework::Connection::AdvanceInitialization(ProtocolFramework::Buffer & outgoingBytes) 行 66  C++
    TCPSocket.dll!TCPSocketImpl::OnConnect() 行 202  C++
    TCPSocket.dll!TCPSocketImpl::doNetworkJobs() 行 507  C++
    TCPSocket.dll!TCPSocketImpl::networkJobsThreadProc(void * lParam) 行 191 C++
    msvcr110d.dll!_callthreadstartex() 行 354    C
    msvcr110d.dll!_threadstartex(void * ptd) 行 337  C
    kernel32.dll!77c81154() 未知
    [下面的框架可能不正确和/或缺失,没有为 kernel32.dll 加载符号] 
    ntdll.dll!77b3b299()    未知
    ntdll.dll!77b3b26c()    未知

charfeddineahmed wrote Oct 14, 2014 at 1:28 AM

This is an indication that in your own implementation of Protocol::createNewProtocolContext, you returned
NULL.

Note that even if you do not supply a custom protocol context, leave the default implementation:
ProtocolContext* Protocol::createNewProtocolContext()
{
    return new ProtocolContext();
}
a protocol context at least does the job of cumulating received bytes untill something decodable is at hand.
So it is a vital thing.
Push framework will crash without it.
The same goes for tcpsocket project which i gave as an example to reuse protocol implementations symetrically (both server code and client code).

smiletiger wrote Oct 14, 2014 at 2:03 PM

很抱歉我忘了告诉你,我是尝试运行3.0\WebsocketServer\Websocket.sln发现问题的.

I'm sorry I forgot to tell you, I am trying to run 3.0 \ WebsocketServer \ Websocket.sln found the problem detected.

我简单地修改了代码的两个地方以保证编译成功。然后尝试运行DemoServer.exe和DemoClient.exe,结果发现DemoClient.exe出错了。

I simply changed the two parts of the code to ensure successful compilation. Then try to run DemoServer. Exe and DemoClient. Exe,. The results showed that DemoClient exe wrong.

在WebsocketProtocol.cpp里面的createNewProtocolContext()设置了断点,但是没有运行到断点来。

In WebsocketProtocol.CPP, createNewProtocolContext () set the breakpoint,but did not run to the breakpoint

很抱歉我运用了机器翻译,因为我的英语很差
I am sorry that I use the machine translation, because my English is very poor