473,587 Members | 2,316 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.

Jul 19 '05 #1
0 1685

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
277
by: Frustrated | last post by:
I have an application that we are porting from Unmanaged C++ to VB.NET that involves sockets. There are two pieces to the code. One piece is a one to one TCP call to a server which is working fine. The second piece receives streaming data from the server on a regular basis via UDP. My problem is that I can not make the ReceiveFrom call...
3
2403
by: Fred Palmer | last post by:
I am trying to get reponses from multiple devices on my network by sending the following message via UDP: // Create the message Byte bytesSent = new Byte {0x00, 0x00, 0x00, 0xF6}; Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); // Send the message to be broadcast s.SendTo(bytesSent,...
1
2105
by: Chang | last post by:
why Socket.ReceiveFrom(byte, ref EndPoint) and SendTo(byte, ref EndPoint) uses ref ? I know what ref means but why it has to use ref is the question. Thanks a lot, Chang
0
770
by: Dan Rice | last post by:
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(IPAddress.Any, 0) Dim s As New Socket(AddressFamily.InterNetwork,
1
4399
by: Nuno Magalhaes | last post by:
Does the function below returns an UDP packet, for example, from the local machine? Why does it give me an error: "The best overloaded method match for ReceiveFrom... has some invalid arguments". Why this error? How can I receive a packet from a specific adapter, for example, my local machine? Is there a better way? This way won't work. The...
0
1614
by: Nuno Magalhaes | last post by:
The MSDN says that I have to bind the socket on a local address to use ReceiveFrom function. How can I bind the socket on a multicast address in order to get the multicast data. Say that I want to receive data that is sent from 10.154.0.104:554 to 224.1.2.3:554. How can I get the data at 224.1.2.3:554 since this is a multicast address, and...
0
1508
by: Nuno Magalhaes | last post by:
The MSDN says that I have to bind the socket on a local address to use ReceiveFrom function. How can I bind the socket on a multicast address in order to get the multicast data. Say that I want to receive data that is sent from 10.154.0.104:554 to 224.1.2.3:554. How can I get the data at 224.1.2.3:554 since this is a multicast address, and...
1
2695
by: ssherm01 | last post by:
I'm using MS VS C++ .NET. I've written a multicast test utility that can send IGMP packets for a user specified group address. As well, it can send and receive UDP packets for a specified multicast group. I'm using the Sockets Class methods for sending and receiving packets. One area I'm having problems with is recieving IGMP packets on the...
0
1503
by: Johan | last post by:
Why is the parameter remoteEP of the function Socket.ReceiveFrom() a ref parameter and not an out parameter? http://msdn2.microsoft.com/en-us/library/wdfskwcy.aspx public int ReceiveFrom ( byte buffer, ref EndPoint remoteEP )
0
7843
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7967
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6619
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5392
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3840
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3872
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2347
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1452
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1185
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.