Forum

You must be logged in to post Login


Lost Your Password?

Search Forums:


 






Wildcard Usage:
*    matches any number of characters
%    matches exactly one character

Udp Send Problem

No Tags
UserPost

5:08 pm
August 20, 2010


Paul

Admin

posts 49

This reply is from a topic posted under the OSC comments page from renasis: http://www.bespokesoftware.org…..9#comments

 

Ren,

Off-hand, nothing about your code jumps out at me as incorrect. Can you get the OscDemo project running? Meaning, does the OscDemo successfully send and receive packets?

Paul

 

10:28 pm
August 20, 2010


renasis

Guest

Post edited 6:21 pm – August 21, 2010 by renasis


Paul,

Send yes, receive no. Device is sending packets to correct pc port, 1000. I can tell via Wireshark. However, it does have a note that port is unreachable. I created a new solution with the source code and was able to see a message that indicates that the port is already in use when I try to send and receive. I think there is a conflict with the new udp client that I am creating on the send, because it is on the same port that I want to receive on. This is the full code that I have tried so far.

Private ReadOnly DestinationAddress As IPAddress = IPAddress.Parse("192.168.0.105")

    Private ReadOnly DestinationPort As Integer = 12344

    Private ReadOnly Destination As IPEndPoint = New IPEndPoint(DestinationAddress, DestinationPort)

    Private ReadOnly LocalAddress As IPAddress = IPAddress.Parse("192.168.0.100")

    Private ReadOnly LocalPort As Integer = 1000

    Private ReadOnly Local As IPEndPoint =

New IPEndPoint(LocalAddress, LocalPort)

    Private ReadOnly TransportType As TransportType = TransportType.Udp

    Private ReadOnly ServerAddress As IPAddress = IPAddress.Parse("192.168.0.100")

    Private ReadOnly ServerPort As Integer = 1000

    Private WithEvents sOscServer As OscServer

    Private ReadOnly AliveMethod As String = "/pwm/6"

Private Sub cmdstarttest_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdstarttest.Click

        Dim x As Integer

        For x = 0 To 255 Step 5

            Dim i As Integer = 255

            Dim port As Integer = 1000

            Dim

smessage As New OscMessage(New IPEndPoint(IPAddress.Loopback, port), "/pwm/6", x)

            smessage.Send(Local, Destination)

        Next

End Sub

Problems receiving

Private Sub cmdstartserver_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdstartserver.Click

        sOscServer = New OscServer(TransportType, ServerAddress, ServerPort)

        sOscServer.RegisterMethod(AliveMethod)

        sOscServer.Start()

    End Sub

 

Sub sOscServer_MessageReceived(ByVal sender As Object, ByVal e As

OscMessageReceivedEventArgs) Handles sOscServer.MessageReceived

        Debug.WriteLine(String.Format("Message Received [{0}]:

{1}", e.Message.SourceEndPoint.Address, e.Message.Address))

    End Sub

 

8:40 pm
August 22, 2010


renasis

Guest

Paul,

I got it working. I think my problem was mostly with the registermethod of the oscserver. I wasn't quite sure how that worked, you may want to add some notes in the docs explaining that. Thanks again for your help. Nice job on the library.

Thanks,

-ren

9:17 am
August 23, 2010


Paul

Admin

posts 49

Glad it's working for you ren.

 

Paul

No Tags

About the Bespoke Software forum



No Comment

Comments are closed.