J
Jordi Rico
Hi,
I'm developing a new app.
I'm using threads, I have used it before, but I'm not sure of some
issues when threading as I'm not an expert with this.
I'll go with a direct example of what I'm doing, I know that is not
very correct, but it's the only way I know, so if someone knows how to
do it better, please tell me.
When I click some button i create a new thread:
private sub button1_click(.....)
t=new thread(addressof listenevents) ' t is a global variable
end sub
public sub listenevents
while true
' here is code of a socket listening to a port and processing all
received data
end while
end sub
When I want to stop the socket listener, in other button I have this:
private sub button2_click(.....)
t.suspend()
end sub
The problem is that I know that this method is deprecated, so I suppose
it's not the correct way of doing this code, can anybody help??
Thanks
I'm developing a new app.
I'm using threads, I have used it before, but I'm not sure of some
issues when threading as I'm not an expert with this.
I'll go with a direct example of what I'm doing, I know that is not
very correct, but it's the only way I know, so if someone knows how to
do it better, please tell me.
When I click some button i create a new thread:
private sub button1_click(.....)
t=new thread(addressof listenevents) ' t is a global variable
end sub
public sub listenevents
while true
' here is code of a socket listening to a port and processing all
received data
end while
end sub
When I want to stop the socket listener, in other button I have this:
private sub button2_click(.....)
t.suspend()
end sub
The problem is that I know that this method is deprecated, so I suppose
it's not the correct way of doing this code, can anybody help??
Thanks