Click here to Skip to main content
15,899,475 members

Comments by Faultyboy (Top 4 by date)

Faultyboy 18-Mar-12 8:42am View    
The error is: The requested address is not valid in its context
Faultyboy 18-Mar-12 8:23am View    
Ive gone a little bit further, could anybody please tell me if this is on the right track to sending and receiving multicast udp pings...


Public LocalHost As String = System.Net.Dns.GetHostName
Public MyIP As IPAddress = (System.Net.Dns.Resolve(LocalHost).AddressList(0))
Public MyIP2 As String = Convert.ToString(MyIP)
Public GroupIP As IPAddress = IPAddress.Parse("239.255.255.255")
Public Bytes(2000) As Byte
Public GroupEP As New IPEndPoint(GroupIP, 1001)
Public Send As New UdpClient(GroupEP)
Public Receive As New UdpClient(GroupEP)
Delegate Sub Delegate1(ByVal SntPulseVar As String)
Delegate Sub Delegate2(ByVal RePulseVar As String)
Delegate Sub Delegate3(ByVal DelNodeVar As String)
Public PulsePacket As String = (NodeNumber & " " & LocalHost & " " & MyIP2)
Public PulseFrequency As Int32
Public InPulseStr As String
Public InPulseByt As Object
Public KillThread As Boolean
Public T As Int32
Public NodeNumber As Int32

''Frm Load''

Public Sub FrmMain_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

Send.JoinMulticastGroup(GroupIP, 1001)
BtnDis.Enabled = False

End Sub

next is how i can sending and receiving..


Send.Send(Bytes, Bytes.Length, GroupEP)

InPulseByt = Receive.Receive(GroupEP)



Thanks again.
Faultyboy 18-Mar-12 7:55am View    
I found the sample I originally used to create the app. Is this sample correct?

http://www.java2s.com/Tutorial/VB/0400__Socket-Network/UdpBroadcast.htm

How would I edit this to send and receive on the same multicast group.

P.s. There where no network issues. Problems are in the code.
Faultyboy 17-Mar-12 13:02pm View    
Thank you for the reply, I will do exactly as you say and I will get back to you with the results, so as to eliminate any network related issues. It shouldn't be changing ports, there should be a port for the incoming traffic and one for the outgoing. As far as i can tell this line..

Public MyIP3 As IPAddress = IPAddress.Parse("192.168.1.255")

I don't think it is getting saved properly as an IP address. It displays "Ipaddress.system" if i remember correctly where the ip variable should be.

Anyways I will get back to you in a day or 2.. :) Ta

Peace.