473,385 Members | 1,821 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,385 software developers and data experts.

Request for Assistance

Hi there, I have a program that I am trying to deploy that checks a DB for
messages to a client every 15 seconds or so. If it finds one, it does some
stuff, then updates it in the DB as 'ACK.' I can't make it work for the
life of me and was wondering if someone would be so kind as to take a peak
at my code to offer some suggestions on 'best practice' for this type of
thing.

I am not averse to dumping the DB idea and going with some kind of port
listening, but just in general I need to be able to put a message somewhere
for a client that is then read in a sleeper process (without interupting the
rest of the program) and do stuff with that message.

Would someone be so kind? I don't want to attach the full source code of
the project here (30,000 ish lines), so if you could assist, just message
me.

Thanks!

Derek Martin
Nov 20 '05 #1
8 908
I'm afraid you aren't giving enough info here :/

w DB, how do you access it ...
Im not promesing much but if you send it over (w db if it's sql server or
some file ) i'll try to have a look at it tonight

just remove the rem stuff from my e-mail

eric

"Derek Martin" <dm*****@DONTSPAMMEokstate.edu> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hi there, I have a program that I am trying to deploy that checks a DB for
messages to a client every 15 seconds or so. If it finds one, it does some stuff, then updates it in the DB as 'ACK.' I can't make it work for the
life of me and was wondering if someone would be so kind as to take a peak
at my code to offer some suggestions on 'best practice' for this type of
thing.

I am not averse to dumping the DB idea and going with some kind of port
listening, but just in general I need to be able to put a message somewhere for a client that is then read in a sleeper process (without interupting the rest of the program) and do stuff with that message.

Would someone be so kind? I don't want to attach the full source code of
the project here (30,000 ish lines), so if you could assist, just message
me.

Thanks!

Derek Martin

Nov 20 '05 #2
Hi EricJ,

Please keep in normal situations the conversations in the newsgroup?

Cor
Nov 20 '05 #3
Hi Derek,

Describing your problem as you do, is I think more important than let us
look at your code in my opinion.

What you describe does sounds for me very much as multithreading process and
also a process that uses a timer, are you doing that?

Cor
Nov 20 '05 #4
Hi, Derek

first glimpse says me you are using one connection object between threads.
That's most likely reason for erratic behavior - whatever you have. I did
not look much further, though. You should have separate connection for each
thread - including UI.

HTH
Alex

"Derek Martin" <dm*****@DONTSPAMMEokstate.edu> wrote in message
news:uo**************@TK2MSFTNGP09.phx.gbl...
Hi Cor, thanks for your message. I didn't include my source code originally because of security concerns and was just looking for someone who would
volunteer off list to take a peak. However, after rethinking that, I
abstracted all the relevant stuff out as its own project and attached the
ZIP file of it here.

I don't use a timer in this example, perhaps I should! Could you and/or
anyone else take a peak and offer a way for this to work in a more logical
and functional manner?

Forgive the code organization - it was a quick abstraction!

Derek
"Cor Ligthert" <no**********@planet.nl> wrote in message
news:OZ**************@tk2msftngp13.phx.gbl...
Hi Derek,

Describing your problem as you do, is I think more important than let us
look at your code in my opinion.

What you describe does sounds for me very much as multithreading process

and
also a process that uses a timer, are you doing that?

Cor


Nov 20 '05 #5
Hi Derek,

Today I am not anymore in the opurtunity to look deeply at your code.

However it seems to me that you create an extra thread only to let it wait.
That is not necessary, to let the main thread wait without a timer is

threading.thread.sleep(15000) '

I think with knowing this a lot of things are easier, however that was the
part I did stop with checking your program.

When you want help, and not someone else did it already, message it than
again OK?
The day after tomorrow I have more time.

Cor

Nov 20 '05 #6
Thank you both for your posts! I don't understand what you are suggesting,
however.

Perhaps I should use a timer instead of a seperate thread? Also, I see that
I should use a seperate connection for each thread, that is easy enough to
do.

Which would yield better and more efficient results?

"Derek Martin" <dm*****@DONTSPAMMEokstate.edu> wrote in message
news:uo**************@TK2MSFTNGP09.phx.gbl...
Hi Cor, thanks for your message. I didn't include my source code originally because of security concerns and was just looking for someone who would
volunteer off list to take a peak. However, after rethinking that, I
abstracted all the relevant stuff out as its own project and attached the
ZIP file of it here.

I don't use a timer in this example, perhaps I should! Could you and/or
anyone else take a peak and offer a way for this to work in a more logical
and functional manner?

Forgive the code organization - it was a quick abstraction!

Derek
"Cor Ligthert" <no**********@planet.nl> wrote in message
news:OZ**************@tk2msftngp13.phx.gbl...
Hi Derek,

Describing your problem as you do, is I think more important than let us
look at your code in my opinion.

What you describe does sounds for me very much as multithreading process

and
also a process that uses a timer, are you doing that?

Cor


Nov 20 '05 #7
i know but didn't have the time yesterday and it seemed like a lot so ... :p
(+i don't have the newsgroup at home, thats all on my pc at work)

summary of w i said in mail
the nature of the problem lies more in the logical flow of the problem.
i fear it can never work like this becouse you will never know how long a
user keeps one of those messages open.
--> pick up on the event handlers of the messageprocessorclass (add a new
one on a timer/sleep if needed) and only show the next message when the
current one is dealth w

i think derek can try this and if he has more problems he can ask specific
questions now. (time will tell ;p)

eric
"Cor Ligthert" <no**********@planet.nl> wrote in message
news:u0**************@TK2MSFTNGP11.phx.gbl...
Hi EricJ,

Please keep in normal situations the conversations in the newsgroup?

Cor

Nov 20 '05 #8
Hi Derek,

What I would do when I was you was trying to simplify some parts first to
create a good program flow.

I cannot test your program, however I thought I could a 4 or 5 deep
procedure call including thread, bring back to this, while that would in my
opinion should give no problems.

Private Sub main_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Do While True
process_client_messages()
Thread.CurrentThread.Sleep(15000)
Loop
End Sub

Cor
Nov 20 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: norton | last post by:
Hi all. I have a question in using Request and Request.Form when the asp page is Request("txtName") i can use "testpage.aspx?txtName=User1" to post the value but when i use...
0
by: Johnson Dunga Apati | last post by:
Hello=2C I was the military assistance to the Minister of Defence of the Federal Republic of Liberia in charge of International Affairs and Logistics=2E The entire cabinet under the President...
5
by: Dani | last post by:
Hello everybody, I have some code that disables form elements on body load, but I notice when I hit the "back" button, I need to re-enable the form elements (that is done by clicking on a radial...
3
by: Matthew Thompson | last post by:
I am developing an application which allows users to choose multiple text sections from a list, displayed as a CheckBoxList, for printing. The sections are being passed to a page using the...
7
by: moondaddy | last post by:
I have a products catalogue that I'm putting online and there will be between 20 to 50 different pages of products. Each page contains a datagrid of products for a given category. However, the...
1
by: ppatel | last post by:
I'm using Request.ServerVariables ("HTTP_REFERER") When i move from normal server eg. http:// to secure server eg https:// in VB Script then I've a problem in getting value of Request.ServerVariables...
3
by: Sydney | last post by:
Hi, I am trying to construct a WSE 2.0 security SOAP request in VBScript on an HTML page to send off to a webservice. I think I've almost got it but I'm having an issue generating the nonce...
8
by: abcd | last post by:
I can get the value on the form at the server side by using Request.form("max") when max field is disabled I dont get value. For GUI and business logic purpose I have disabled some fields with...
3
by: nms | last post by:
I've an ASP.net web site, Since last some days, Users are experiencing problem when they try to generate reports (for a large date range) it says, Request timed out. Description: An unhandled...
3
by: JimH | last post by:
I know it's not ethical to advertise your business on the newsgroup. Fortunately I am not even close to do that! But is it acceptable to request help with a database and offer to pay? I have...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?

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.