473,396 Members | 2,050 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 ConnectionManager 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?
Oct 10 '07 #1
2 2163
RedSon
5,000 Expert 4TB
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 ConnectionManager 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.
Oct 10 '07 #2
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.
Oct 11 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: kieran | last post by:
Hi, I have a form which is submitting into a sql server db. i have one of the fields set to ntext which says length of 16. when i insert info, it only sumbits about a paragraph and when i pull...
1
by: tim cummings via .NET 247 | last post by:
I am writing a program that interfaces with a cars pcm via theserial port and recieves data (such as rpm) at an interval, oflets say 1 second, and then formats it. The problem is, I wouldlike to...
14
by: James Wong | last post by:
Hi! everybody, I'm facing a quite strange download problem. I use the following code to download an XML file to client side: With Response ' clear buffer Call .Clear() ' specify the...
3
by: Harry Whitehouse | last post by:
Hi! Today I coded a small ASPNET page which accepts a 5 digit ZIP code and will return all the street names in that ZIP code. You can try it out here: ...
5
by: Tim_Mac | last post by:
hi, i read that by adding the following code to by aspx pages, it would not store temporary internet files: Response.Cache.SetCacheability(HttpCacheability.NoCache); it didn't actually work...
2
by: Tim | last post by:
I have developed a web based file manager application. It has a simple interface that allows users to upload and download files. Everything works great except for one new download problem. I am...
5
by: Steven Blair | last post by:
I need to write an ASP.NET application which can do the following: 1. Create a socket which will stay alive and continously read data. 2. The data read needs to be displayed on the webpage. 3....
3
by: Joe Salmeri | last post by:
I have found a data corruption problem with pyodbc. OS = Windows XP SP2 DB = Microsoft Access XP PROBLEM: When selecting columns from a table that are of type Memo the value returned is...
0
by: Niks | last post by:
I am facing a very strange problem in my websevice which is working on socket communication. While i am publishing my webservice to the IIS and invoking a method, a data loss problem in occuring....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.