receivefrom socket class

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dan Rice

    receivefrom socket class

    Hello,

    Im trying to get the following working but it doesn't seem
    to receive anything. I have got the UdpClient class to
    receive data but unreliably and was told to use the Socket
    class directly. Here's the code:

    Dim lep As New IPEndPoint(IPAd dress.Any, 0)

    Dim s As New Socket(AddressF amily.InterNetw ork,
    SocketType.Dgra m, ProtocolType.Ud p)

    s.Bind(New IPEndPoint(IPAd dress.Any, 0))

    Dim buffer(1024) As Byte
    s.ReceiveFrom(b uffer, lep)


    It blocks on the ReceiveFrom call as expected but doesn't
    ever get past here so i guess it's not receiving anything.
    I've got the code in the form_load sub in a basic .NET
    windows app.

    Any ideas why this wouldn't work?

    Thanks.

Working...