Here is my first test app.
Trying to broadcast udp packets.
few questions.
1. From what I can tell once I create an object I cannot destroy it (vb6 set object = nothing)?
2. I could not find an example of udpsocket, so I took hints from socket example, please be gentle it is my first try
3. What is the easiest way to get localIP of machine
to clarify the udpsock status returns 1 but i cannot see any packets being sent on my network
thank you
Test app UDPSocket Broadcast
Test app UDPSocket Broadcast
- Attachments
-
- test.zip
- (12.55 KiB) Downloaded 69 times
Re: Test app UDPSocket Broadcast
In Gambas some Objects, especially graphic ones, possess the ".Delete()" Method in order to be destroyed.
In order to destroy, however, those Objects which do not have the .Delete() Method, it is sufficient to assign the value Null to the variable of the specific Object type.
object_variable = Null
Europaeus sum !
Amare memorentes atque deflentes ad mortem silenter labimur.
Amare memorentes atque deflentes ad mortem silenter labimur.
Re: Test app UDPSocket Broadcast
Ok thanks, I tried that and the class that had the timer and udpsocket was not getting destroyed and the _free event was not occuring
Any help on why my test app is not broadcasting the data, would be greatly appreciated when you have time
Any help on why my test app is not broadcasting the data, would be greatly appreciated when you have time
Re: Test app UDPSocket Broadcast
Sorry, I didn't understand.
My suggestion doesn't work?
My suggestion doesn't work?
Europaeus sum !
Amare memorentes atque deflentes ad mortem silenter labimur.
Amare memorentes atque deflentes ad mortem silenter labimur.
Re: Test app UDPSocket Broadcast
I don't know if these pages can help you:
https://gambaswiki.org/wiki/comp/gb/system/host
https://gambaswiki.org/wiki/comp/gb.net/dnsclient
https://gambaswiki.org/wiki/doc/network
https://gambas-buch.de/dwen/doku.php?id ... .3.1:start
https://gambas-buch.de/dwen/doku.php?id ... .1.4:start
https://www.gambas-it.org/wiki/index.ph ... a_macchina
By using "Shell" function with one of the commands indicated on this page:
https://opensource.com/article/18/5/how ... ress-linux
Europaeus sum !
Amare memorentes atque deflentes ad mortem silenter labimur.
Amare memorentes atque deflentes ad mortem silenter labimur.
Re: Test app UDPSocket Broadcast
when I set the instance of the class = nothing it did not destroy instance, and the _free event did not occur
so it was continuing to attempt to send udp packets
I worked around it ...
Please see the project attached and let me know if I am using UDPsocket correctly for broadcasting
Re: Test app UDPSocket Broadcast
thanks!, very simplevuott wrote: ↑Tuesday 18th April 2023 7:44amI don't know if these pages can help you:
https://gambaswiki.org/wiki/comp/gb/system/host
https://gambaswiki.org/wiki/comp/gb.net/dnsclient
https://gambaswiki.org/wiki/doc/network
https://gambas-buch.de/dwen/doku.php?id ... .3.1:start
https://gambas-buch.de/dwen/doku.php?id ... .1.4:start
https://www.gambas-it.org/wiki/index.ph ... a_macchina
By using "Shell" function with one of the commands indicated on this page:
https://opensource.com/article/18/5/how ... ress-linux
- BruceSteers
- Posts: 1565
- Joined: Thursday 23rd July 2020 5:20pm
- Location: Isle of Wight
- Contact:
Re: Test app UDPSocket Broadcast
the attached project contains no source code.axisdj wrote: ↑Tuesday 18th April 2023 2:12pmwhen I set the instance of the class = nothing it did not destroy instance, and the _free event did not occur
so it was continuing to attempt to send udp packets
I worked around it ...
Please see the project attached and let me know if I am using UDPsocket correctly for broadcasting
How did you pack it?
It's best to make an archive using the IDE , select "Project/Make source archive" this will include what is needed and omit what's not needed.
and you should not set "class" = nothing you should set "object" = nothing.
Do you understand the difference? you create an object from the class like this..
Dim hObject = New UDPSocket
then you must do
hObject = Null
not UDPSocket = Null
If at first you don't succeed , try doing something differently.
BruceS
BruceS
- BruceSteers
- Posts: 1565
- Joined: Thursday 23rd July 2020 5:20pm
- Location: Isle of Wight
- Contact:
Re: Test app UDPSocket Broadcast
Are you closing the socket first?
http://gambaswiki.org/wiki/comp/gb/stream/close
http://gambaswiki.org/wiki/comp/gb/stream/close
If at first you don't succeed , try doing something differently.
BruceS
BruceS
Re: Test app UDPSocket Broadcast
Infact.BruceSteers wrote: ↑Tuesday 18th April 2023 2:48pm and you should not set "class" = nothing you should set "object" = nothing.
Do you understand the difference? you create an object from the class like this..
Dim hObject = New UDPSocket
then you must do
hObject = Null
not UDPSocket = Null
BruceSteers offers you an important clarification.
Europaeus sum !
Amare memorentes atque deflentes ad mortem silenter labimur.
Amare memorentes atque deflentes ad mortem silenter labimur.