473,473 Members | 1,488 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Asynchronous CallBack

Hello;

I have a little problem here. I have 2 applications: A and B.

Application B listens to a network stream and uses a AsyncCallback:

Callback = New AsyncCallback(AddressOf OnDataReceived)

m_asynResult = objMySocket.BeginReceive(objMyBytes, 0, objMyBytes.Length,
SocketFlags.None, Callback, Nothing)

When Application B receives data on its network stream it raises an event.

Application A receives the event raised in Application B and starts a
System.Windows.Forms.Timer. This timer should raise a tick event after 10
seconds... But the "Tick" is never triggers ?¿?

It looks like the Timer "tick"-event is absorbed by the Callback in
Application B?

Any idea what the problem is ?


Regards;

MVK
Nov 20 '05 #1
3 1007
Cor
Hi Marten,

The most problems with timers is because standard is used the forms.timer.
There are minimal 3 timers.

Have a look at system.timers.timer

I think that will help you because it mostly does.

Cor
When Application B receives data on its network stream it raises an event.
Application A receives the event raised in Application B and starts a
System.Windows.Forms.Timer. This timer should raise a tick event after 10
seconds... But the "Tick" is never triggers ?¿?

Nov 20 '05 #2
Hi Cor thanks for the information. The event triggers fine now. Thanks!

I have one last question:

Application A can be refreshed manualy and automatic.

Manually by pressing F5

Automatic: When the Timer Tick is raised.

Now the strange thing is that the Manual refresh goes fast and the automatic
refresh goes very slow (repainting screen goes very slow it takes a lot of
time.)
Any idea why the automatic refresh goes slower than the manual refresh ?
(the refresh function is the same in both cases).

Greetz
M.
"Cor" <no*@non.com> wrote in message
news:OY**************@TK2MSFTNGP10.phx.gbl...
Hi Marten,

The most problems with timers is because standard is used the forms.timer.
There are minimal 3 timers.

Have a look at system.timers.timer

I think that will help you because it mostly does.

Cor
When Application B receives data on its network stream it raises an event. Application A receives the event raised in Application B and starts a
System.Windows.Forms.Timer. This timer should raise a tick event after 10 seconds... But the "Tick" is never triggers ?¿?


Nov 20 '05 #3
Cor
Hi Marten,

Sorry I don't know, but maybe because that timer, I don't like them.

When I can avoid them by using

Do until somethingHappens
threading.thread.sleep(50)
applications.doevents
loop

I do that.

But the timer is in system, so that would be better I think

Success

Cor
Hi Cor thanks for the information. The event triggers fine now. Thanks!
I have one last question:
Application A can be refreshed manualy and automatic.
Manually by pressing F5
Automatic: When the Timer Tick is raised. Now the strange thing is that the Manual refresh goes fast and the automatic refresh goes very slow (repainting screen goes very slow it takes a lot of
time.)
Any idea why the automatic refresh goes slower than the manual refresh ?
(the refresh function is the same in both cases).

Nov 20 '05 #4

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

Similar topics

1
by: John | last post by:
I will be setting up an asynchronous receive routine for a TCP Socket. If the receive callback method is not called within some time interval, I want to cancel the use of the callback method. ...
1
by: Sai Kit Tong | last post by:
I have to interface managed application with my legacy dll. I have employed the wrapper approach but I have to deal with the asynchronous callback from the legacy dll, which likely goes through a...
4
by: Chris | last post by:
Hello, With asynchronous programming : Why does the callback-function (running in a worker thread) may not update the state of a control on the main-form ? The docs say that you must use a...
1
by: Natalia DeBow | last post by:
Hi, I am working on a Windows-based client-server application. I am involved in the development of the remote client modules. I am using asynchronous delegates to obtain information from...
1
by: MSDN | last post by:
Does anyone know how to do this with a readline statement or equivalent method? Thanks in advance. Chris
7
by: Siv | last post by:
Hi, I have a stored procedure that I want to execute and then wait in a loop showing a timer whilst it completes and then carry on once I get notification that it has completed. The main reason...
2
by: archana | last post by:
Hi all, I am processing asynchronous web request with setting timeout using RegisterWaitForSingleObject. On beginwebrequest i am sending address of one callback which i want to execute when...
0
by: Bishoy George | last post by:
Hi, I have a asp.net 2.0 web application. I want to implement the asynchronous model through http handler in web.config ...
3
by: =?Utf-8?B?bWs=?= | last post by:
Hi everyone, I need to refactor some of our processes using the asynchronous programming model. I have defined a couple of arrays of delegates to pipline the asynchronous invocations through...
2
by: Morgan Cheng | last post by:
In asynchronous model, BeginXXX method returns a IAsnycResult-derived object. IAsyncResult.AsyncWaitHandle will be signaled when the asynchronous job is complete; and BeginXXX method has a argument...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.