×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Dec 2003
    Location
    Munich, Germany
    Posts
    30

    Bidirectional communication via GPRS Sockets

    Hello everyone!

    I would like to implement a class, that is able to connect to a server in the internet, send data to it, and receive data from it.

    The class derives from CActive, and therefore I encountered some control problems.

    When the socket is connected, and when data is sent to the server, everytime the SetActive() method is called.

    When the socket is connected and when some login info is sent to the server, I want the application to wait for incoming data from the server calling the RSocket::RecvOneOrMore(...) method. Right after SetActive() is called. Now however, If I want to send data to the server now, I want to cancel the outstanding receiving request by calling Cancel() before RSocket::Write(...).

    But then, the application gets stuck (the program does not close, it gets stuck, the screen freezes).

    Can anyone please tell me how to handle sending and receiving requests in one class with the CActive architecture?

    Thanks in advance,

    Maniac

  2. #2
    Regular Contributor
    Join Date
    Oct 2003
    Location
    Spain
    Posts
    329
    Hi Maniac,

    Have you tried RSocket::CancelRecv() instead of cancelling the CActive object?

    I hope it helps,
    Bye.

  3. #3
    Registered User
    Join Date
    Dec 2003
    Location
    Munich, Germany
    Posts
    30

    No better :-(

    I just tried it,

    the String is sent to the server (and received by the server), but right after the application crashes (I believe it's right when the SetActive() method is called. Probably because the active request (receive) has not have been cancelled yet (?)...

    Maniac

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×