Click here to Skip to main content
15,891,473 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I am using GsmComm.GsmCommunication library and I have a problem while sending messages.

I am sending more than one message at a time in a loop. There are about 150 messages to send in my database. When I am sending the messages, sometimes it sends 25 and sometimes 30 messages, then it shows the error "unable to open port" meaning it doesn't send all messages at a time. When I run my application again, it sends 20 or 30 messages then I get the same error.

I am using a Nokia e50 device.

Can anyone please tell me the solution?

Thanks in Advance.

Regards
Posted
Updated 29-Jun-10 23:47pm
v2
Comments
Kristian Sixhøj 30-Jun-10 6:00am    
Hi, please update your question so it includes the relevant source code - it's easier for people to help you then.
Ankur\m/ 1-Jul-10 2:14am    
I have moved your reply to the comment. This is the correctly way of replying to the user.

1 solution

I guess the port is becoming too busy to send/receive any data.

I would suggest you to wait for few seconds after sending some messages (say 10 or 15). So do something like this:
C#
for (int i = 0; i < messageCount; i++)
{
    if (i % 15 == 0)
    {
        System.Threading.Thread.Sleep(10000);
    }
    //code for sending message
}


Here after every 15 messages I am stopping the processing for 10 seconds.

I hope you got the idea. Try this and let me know if it helps. :thumbsup:
 
Share this answer
 
Comments
Ankur\m/ 1-Jul-10 2:12am    
[Moved from answer]:
ManishPinjani wrote: "thanks dear for reply. but i delay for 2 seconds after each message.."
Ankur\m/ 1-Jul-10 2:16am    
Glad to help you!
I would also like to suggest you to do some testing with various time delay to determine the best interval.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900