Test app UDPSocket Broadcast
Posted
#1
(In Topic #1030)
Trainee
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
Posted
Regular

In Gambas some Objects, especially graphic ones, possess the ".Delete()" Method in order to be destroyed.axisdj said
1. From what I can tell once I create an object I cannot destroy it (vb6 set object = nothing)?
In order to destroy, however, those Objects which do not have the .Delete() Method, it is sufficient to assign the value <COLOR color="#BF0000">Null</COLOR> to the variable of the specific Object type.
Code (gambas)
- object_variable = Null
Europaeus sum !
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
Posted
Trainee
Any help on why my test app is not broadcasting the data, would be greatly appreciated when you have time
Posted
Regular

My suggestion doesn't work?
Europaeus sum !
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
Posted
Regular

I :? don't know if these pages can help you:axisdj said
3. What is the easiest way to get localIP of machine
/comp/gb/system/host - Gambas Documentation
/comp/gb.net/dnsclient - Gambas Documentation
/doc/network - Gambas Documentation
k24:k24.1:k24.1.3:k24.1.3.1:start [GAMBAS BOOK 3.19.5]
k24:k24.1:k24.1.4:start [GAMBAS BOOK 3.19.5]
Ottenere gli indirizzi IP di ogni interfaccia presente sulla medesima macchina - Gambas-it.org - Wikipedia
By using "Shell" function with one of the commands indicated on this page:
How to find your IP address in Linux | Opensource.com
Europaeus sum !
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
Posted
Trainee
vuott said
Sorry, I didn't understand.![]()
My suggestion doesn't work?
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
Posted
Trainee
vuott said
I :? don't know if these pages can help you:axisdj said
3. What is the easiest way to get localIP of machine
/comp/gb/system/host - Gambas Documentation
/comp/gb.net/dnsclient - Gambas Documentation
/doc/network - Gambas Documentation
k24:k24.1:k24.1.3:k24.1.3.1:start [GAMBAS BOOK 3.19.5]
k24:k24.1:k24.1.4:start [GAMBAS BOOK 3.19.5]
Ottenere gli indirizzi IP di ogni interfaccia presente sulla medesima macchina - Gambas-it.org - Wikipedia
By using "Shell" function with one of the commands indicated on this page:
How to find your IP address in Linux | Opensource.com
thanks!, very simple
Posted
Guru

axisdj said
vuott said
Sorry, I didn't understand.![]()
My suggestion doesn't work?
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
the attached project contains no source code.
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
Posted
Guru

Posted
Regular

Infact. <EMOJI seq="1f44d" tseq="1f44d">👍</EMOJI>BruceSteers said
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 !
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
Posted
Trainee
BruceSteers said
axisdj said
vuott said
Sorry, I didn't understand.![]()
My suggestion doesn't work?
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
the attached project contains no source code.
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
yes I set the instantiated object = null and I called close on object. Problem is the _free event never occurred
I just noticed that option late yesterday.. here it is attached
Posted
Regular

I :? would make these changes:
1)
2) In "clsArtNet" I'ld add this sub-procedure:
3) In "clsArtNet" I'ld erase the whole SUB: "Public Sub _free() ".
<COLOR color="#FFFFFF">.</COLOR>
Europaeus sum !
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
Posted
Trainee
vuott said
I noticed that, if "Timer" and the variable "ws" are both active, they will not allow the hidden Method "_free()" to be raised.
I :? would make these changes:
1).
2) In "clsArtNet" I'ld add this sub-procedure:
3) In "clsArtNet" I'ld erase the whole SUB: "Public Sub _free() ".
<COLOR color="#FFFFFF">.</COLOR>
Thank you and I do understand, but my MAIN question is am I using the udpSocket correctly for broadcasting data. I cannot see the packets on my network.
Posted
Regular

I currently have no experience with this Class.
I :? don't know if this page can help you:
UDP-Socket - Der Gambas Club
Europaeus sum !
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
Posted
Trainee
I was able to make it work, the biggest obstacle was the fact that the linux sbc network card had a special setting that needed to be set (detect method I think)
My code did not follow the udpSocket example in the Gambas book, but I got it working so I am well on my way.
1 guest and 0 members have just viewed this.


