Problem with Casyncsocket in pocket pc 2003 - Programmer

This is a discussion on Problem with Casyncsocket in pocket pc 2003 - Programmer ; Hello all, I have made a simple socket test program for Pocket PC 2003 (Windows embedded visual c++ 4.0). My client and server socket classes are derived from CAsyncSocket. Connect function returns success status. But OnConnect and OnAccept function is ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Problem with Casyncsocket in pocket pc 2003

  1. Problem with Casyncsocket in pocket pc 2003

    Hello all,

    I have made a simple socket test program for Pocket PC 2003 (Windows
    embedded visual c++ 4.0).
    My client and server socket classes are derived from CAsyncSocket.
    Connect function returns success status.
    But OnConnect and OnAccept function is not called.

    The code snippet is given below

    // create client socket
    m_clientSocket = new CClientSocket();
    m_clientSocket->Create();

    // connect to the server
    LPCTSTR lpszHostAddress = L"127.0.0.1"; bool error = false;
    error = m_clientSocket->Connect(lpszHostAddress, 8003);

    // server socket create
    pConcatenator->m_serverSocket = new CServerSocket();
    stat = pConcatenator->m_serverSocket->Create(8003);
    stat = pConcatenator->m_serverSocket->Listen( );


    Can some body help me in resolving this issue.

    Thanks
    Rajani


  2. Re: Problem with Casyncsocket in pocket pc 2003

    rajani wrote:
    > Hello all,
    >
    > I have made a simple socket test program for Pocket PC 2003 (Windows
    > embedded visual c++ 4.0).
    > My client and server socket classes are derived from CAsyncSocket.
    > Connect function returns success status.
    > But OnConnect and OnAccept function is not called.
    >
    > The code snippet is given below
    >
    > // create client socket
    > m_clientSocket = new CClientSocket();
    > m_clientSocket->Create();
    >
    > // connect to the server
    > LPCTSTR lpszHostAddress = L"127.0.0.1"; bool error = false;
    > error = m_clientSocket->Connect(lpszHostAddress, 8003);
    >
    > // server socket create
    > pConcatenator->m_serverSocket = new CServerSocket();
    > stat = pConcatenator->m_serverSocket->Create(8003);
    > stat = pConcatenator->m_serverSocket->Listen( );
    >
    >
    > Can some body help me in resolving this issue.
    >
    > Thanks
    > Rajani
    >


    The thread that created the socket must pump Windows messages. If your
    code is executing some loop instead of pumping messages then no messages
    will be processed: OnConnect and OnAccept are message handlers. If you
    create the socket in a worker thread nothing will happen, because a
    worker thread does not pump messages.

    --
    Scott McPhillips [VC++ MVP]


+ Reply to Thread