Mobile socket data download problem!!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lokeshRsharma
    New Member
    • Oct 2007
    • 3

    Mobile socket data download problem!!

    Hi,
    i am using Win32 sockets in Windows mobile 5.0 smartphone. My data size is around 10k. I perform following actions to download data from server :

    1. Enable ConnectionManag er when application starts.
    2. Call WSAStartup() when application starts.
    3. Call socket().
    4. Connect to server.
    5. Send request.
    6. Receive response.
    7. Close socket.

    For the first time data downloaded properly. But if i try to download data again, socket() and connect() both gives exceptions. Can you pls suggest me what am i doing wrong?
  • RedSon
    Recognized Expert Expert
    • Jan 2007
    • 4980

    #2
    Originally posted by lokeshRsharma
    Hi,
    i am using Win32 sockets in Windows mobile 5.0 smartphone. My data size is around 10k. I perform following actions to download data from server :

    1. Enable ConnectionManag er when application starts.
    2. Call WSAStartup() when application starts.
    3. Call socket().
    4. Connect to server.
    5. Send request.
    6. Receive response.
    7. Close socket.

    For the first time data downloaded properly. But if i try to download data again, socket() and connect() both gives exceptions. Can you pls suggest me what am i doing wrong?
    I've never done this in WM but I have done some network programming in the past. Have you made sure that you are releasing all the socket resources on the client side? If your program opens the socket and then the program ends, the socket might still be open. You will need to make sure that you release all resources before your program terminates. If you have programmed the server, you will need to make sure that it is again reset to accept connections after you client has connected and disconnected. If you server gets a connection then your client terminates the sever will still think that the connection is open but just idle. You will need to wait for the connection to timeout or reset it somehow.

    Comment

    • lokeshRsharma
      New Member
      • Oct 2007
      • 3

      #3
      Originally posted by RedSon
      I've never done this in WM but I have done some network programming in the past. Have you made sure that you are releasing all the socket resources on the client side? If your program opens the socket and then the program ends, the socket might still be open. You will need to make sure that you release all resources before your program terminates. If you have programmed the server, you will need to make sure that it is again reset to accept connections after you client has connected and disconnected. If you server gets a connection then your client terminates the sever will still think that the connection is open but just idle. You will need to wait for the connection to timeout or reset it somehow.
      I am releasing connection manager and dll when i am exiting but closing socket each time after download finished. Server works fine because I tested it with console application.

      Comment

      Working...