f



how to receive udp multicasting packets with winsock control?

    Subject say it.  Ie I have a network adapter that has UDP 
multicasting packets coming in with destination addresses in the 
224.x.x.x range.  I'm trying to receive this data with the winsock 
control in either VB5 or VB6.  I set up the control as a UDP control, 
but no matter what I set for parameters, the dataarrival event never 
fires, even though I can see packets coming in using a freeware program 
I found. It seems like unless the packets have the IP address of my host 
computer, that winsock seems to ignore them, and windows won't let me 
change the IP# of the adapter to the 224.x.x.x range, so I am stuck.
     Someone told me that I have to "subscribe" to the multicast, but I 
have no idea of how to do this with VB.
     Can someone give me some hints on how to get started on this?
Thanks in advance.

2
wejones (9)
5/3/2004 5:04:38 PM
comp.lang.basic.visual.misc 10153 articles. 0 followers. Post Follow

4 Replies
2853 Views

Similar Articles

[PageSpeed] 14

It's no different than using them for TCP.

Here's some code I have in a couple of my programs where I'm having
one program "ping" the other one using a UDP broadcast. BTW, it's my
understanding that "broadcasts" are ONLY on IP address
255.255.255.255. You say you're using 224.x.x.x; could that be your
problem?


' set up the "Ping" server socket
PingServer.RemotePort = 7531
PingServer.Bind 7532

' broadcast this computer name to all computers on the network
PingClient.RemoteHost = "255.255.255.255"
PingClient.RemotePort = 7532

PingClient.SendData "SomeMessage"

--------------------------------------------
Private Sub PingServer_DataArrival(ByVal bytesTotal As Long)

Dim MsgIn$

PingServer.GetData MsgIn$

Do whatever needs to be done...

End Sub
--------------------------------------------

HTH

Martin
On Mon, 03 May 2004 13:04:38 -0400, Bill Jones <wejones@megalink.net>
wrote:

>    Subject say it.  Ie I have a network adapter that has UDP 
>multicasting packets coming in with destination addresses in the 
>224.x.x.x range.  I'm trying to receive this data with the winsock 
>control in either VB5 or VB6.  I set up the control as a UDP control, 
>but no matter what I set for parameters, the dataarrival event never 
>fires, even though I can see packets coming in using a freeware program 
>I found. It seems like unless the packets have the IP address of my host 
>computer, that winsock seems to ignore them, and windows won't let me 
>change the IP# of the adapter to the 224.x.x.x range, so I am stuck.
>     Someone told me that I have to "subscribe" to the multicast, but I 
>have no idea of how to do this with VB.
>     Can someone give me some hints on how to get started on this?
>Thanks in advance.

0
5/4/2004 2:22:12 AM
Martin wrote:
> It's no different than using them for TCP.
> 
> Here's some code I have in a couple of my programs where I'm having
> one program "ping" the other one using a UDP broadcast. BTW, it's my
> understanding that "broadcasts" are ONLY on IP address
> 255.255.255.255. You say you're using 224.x.x.x; could that be your
> problem?
>.......


Thanks for responding.
No, the 224.x.x.x is correct, and that is the standard "multicasting" 
address.  Ie it is "multicasting" data, NOT "broadcasting".
    I've been able to talk between computers on my network using UDP, 
but I can't get it to work with this multicasting thing.
    I have no control over the 224.x.x.x address, because that is the 
address that the data is coming in addressed to, from an external 
source.  It is actually NOAA weather data I'm trying to receive via a 
satellite signal.  I can read the data fine, using a freeware program 
called ethereal, but have been unable to read it using Visual Basic, 
using the winsock control. The data is sent out by NOAA using a 10.0.5.x 
  source address and the 224.0.x.x destination address. I've set up my 
receiving network adapter up on another 10.0.5.x address, in hopes that 
it would see the data as coming from a group computer, and in hopes that 
that would help specify the local adapter that is used to get the data, 
but that doesn't seem to help.  I think that I may have to switch to 
using winsock API, but I'm not at all familiar with doing that, which is 
why I started out trying the control.
    I have now run into an additional problem with the winsock control. 
  Ie it seems to have a mind of it's own re to what it thinks the "local 
host" is.  My computer has 3 network cards on it, and I can send out UDP 
packets out on any port, and receive them on another computer with only 
one network card, but I can't receive on the computer with 3 cards, 
since it has defaulted to the card that is only receiving multicasting 
data, and I can't change the localhost property because it is read-only.
    Is there a way to change the localhost property that the winsock 
control uses?  Anyway, I'm not having much luck with this winsock control.
Thanks.



0
wejones (9)
5/4/2004 3:24:53 PM
You're way over my head now. I told you everything I know in my first
reply. 

FWIW, a google search for "winsock multicast" yielded this link:
http://www.sockets.com/winsock2.htm  There is a sub-linked page that
talks about having to "join a group" to receive multicast messages.
Maybe this might shed some light on things for you.



On Tue, 04 May 2004 11:24:53 -0400, Bill Jones <wejones@megalink.net>
wrote:

>Martin wrote:
>> It's no different than using them for TCP.
>> 
>> Here's some code I have in a couple of my programs where I'm having
>> one program "ping" the other one using a UDP broadcast. BTW, it's my
>> understanding that "broadcasts" are ONLY on IP address
>> 255.255.255.255. You say you're using 224.x.x.x; could that be your
>> problem?
>>.......
>
>
>Thanks for responding.
>No, the 224.x.x.x is correct, and that is the standard "multicasting" 
>address.  Ie it is "multicasting" data, NOT "broadcasting".
>    I've been able to talk between computers on my network using UDP, 
>but I can't get it to work with this multicasting thing.
>    I have no control over the 224.x.x.x address, because that is the 
>address that the data is coming in addressed to, from an external 
>source.  It is actually NOAA weather data I'm trying to receive via a 
>satellite signal.  I can read the data fine, using a freeware program 
>called ethereal, but have been unable to read it using Visual Basic, 
>using the winsock control. The data is sent out by NOAA using a 10.0.5.x 
>  source address and the 224.0.x.x destination address. I've set up my 
>receiving network adapter up on another 10.0.5.x address, in hopes that 
>it would see the data as coming from a group computer, and in hopes that 
>that would help specify the local adapter that is used to get the data, 
>but that doesn't seem to help.  I think that I may have to switch to 
>using winsock API, but I'm not at all familiar with doing that, which is 
>why I started out trying the control.
>    I have now run into an additional problem with the winsock control. 
>  Ie it seems to have a mind of it's own re to what it thinks the "local 
>host" is.  My computer has 3 network cards on it, and I can send out UDP 
>packets out on any port, and receive them on another computer with only 
>one network card, but I can't receive on the computer with 3 cards, 
>since it has defaulted to the card that is only receiving multicasting 
>data, and I can't change the localhost property because it is read-only.
>    Is there a way to change the localhost property that the winsock 
>control uses?  Anyway, I'm not having much luck with this winsock control.
>Thanks.
>
>

0
5/4/2004 5:03:18 PM
Martin wrote:

> You're way over my head now. I told you everything I know in my first
> reply. 
> 
> FWIW, a google search for "winsock multicast" yielded this link:
> http://www.sockets.com/winsock2.htm  There is a sub-linked page that
> talks about having to "join a group" to receive multicast messages.
> Maybe this might shed some light on things for you.

Thanks again.  I'll look up the URL.  I found a routine for joining a 
multicast group, but it used the API, so I'll probably have to figure 
that out.
    I also found a couple VB wrappers for WinPcap, but haven't tried 
them yet.  They may be way over my head.   Thanks.



0
wejones (9)
5/4/2004 8:07:00 PM
Reply:

Similar Artilces:

How to receive UDP and ICMP packet using one UDP socket, (Path MTUD)
Dear All, Can we configure one socket to receive two different protocols packet. Like how can we made a UDP socket to receive udp as well as icmp messages. Actually I am implementing Path MTUD, so for that I sent some udp probs to destination host, now I want that the same socket at client side must be able to receive both udp response and icmp error messages(like host unreachable, port unreachable etc). Another approach is that, we will use two sockets for both source and destination, form source we will send udp probs(through udp socket) while at destination host, after receiving that pr...

Visual Basic-Winsock
If any of you want older visual basic (i have vb1,2,3 and 4 ) write to me: brayanadams111@hotmail.com also i have a lot of usefull programs ! for detailed information you can write and ask me! Thanks! ...

Cannot Receive UDP Packet
I am not been able to receive data from a xPC Target through UDP. I have a UDP send and receive blocks in the model running on xPC Target. I have been able to send data from PC to xPC Target but from the same connection it doesn't receive anything. Below is the code I am using to form the connection and send and receive data. ----------------------------------------------------------- #include "stdafx.h" #include "UDPvastaanotto.h" #include <iostream> #include <conio.h> using namespace std; int main(void) { UDPvastaanotto recvConnection; SOCKET recvSock...

RECEIVE-CONTROL and $RECEIVE
Hi everybody, I'm having a query about these things. A COBOL server we use uses the FILE_OPEN_ to open $RECEIVE. We are pasing the call a param value of 5 for sync-or-receive-depth. Whats this really mean, I can not get clear from the manuals what this means. Also the COBOL has no code in the INPUT-OUTPUT section and as so has no SELECT or: RECEIVE-CONTROL. TABLE OCCURS nn TIMES SYNCDEPTH LIMIT IS n REPLY CONTAINS n CHARACTERS. Should it have? The reason I investigate this is we getting errors calling it like this.. 1007* LINKMON L\ZTMINCA.$SXX2, CA...

UDP packets receiving techniques!
In my app i am triying to capture udp packets, but i realized that to be able to capture a a udp pack, u must know its size before u call recvfrom... or u must give a number as the size which is bigger than pcks size... so how a strategy can be followed to transfer variable lenght of packages via udp? ?always send a fixed size pck? i hate it.... ?use a large number as size? worse.... ? "xenonysf" <erdoganyusuf@gmail.com> writes: > In my app i am triying to capture udp packets, > but i realized that to be able to capture a a udp pack, > u must know i...

A question about UDP packet receive
Hi, everyone. I need your help! I created a UDP server by using $socket = stream_socket_server($udpAddr, $errno, $errstr, STREAM_SERVER_BIND); the client send me a reqest, then server return a "hello string". but the client simply send me a name or something very short. I have to read upto 100 chars, then the fread can return. my Question is: how can I read a udp packet which length is unknow? thank a lot! Reeze. my src code:===================================== $pkt = stream_socket_recvfrom($socket, 100, 0, $peer); $reciv_data = fread($socket, 100); $message = pre...

Missing packets in multicast receiver.
Hello list. I need to use multicast in a project I am working on. I would like to have a multicast sender send a large amount of multicast data, and a multicast receiver receive it. I used the example I found here: http://onestepback.org/index.cgi/Tech/Ruby/MulticastingInRuby.red to get started. What I want initially is to be able to blast packets to a multicast group. I wrote a simple multicast sender that prints a message every (almost) MB of data it sends. I also wrote a simple receiver that does the same thing for every (almost) MB of data it receives. Here they are. Sender: #...

Receiving more than one UDP packet.
Hello All, I am working on a embedded system which receives UDP packets from multicasting server which send packets at around 80Mbps. I am losing packets between the two recvfrom() api calls. my thread just receives a packet, strip out some of the details and copy the data to a buffer through memcopy and again go to recvfrom() call. This thread works fine at lower bit rates of around 20Mbps but at 80 Mbps many packets are getting lost. Is there a socket API which can receive multiple UDP packets with one call?? I doubt at higher bit rates my user level thread is taking longer time ...

openoffice
Hi I'm trying to work with the visual basic like language of the web part of openoffice, it looks a lot like visual basic. My question is, i'm trying to set focus to a certain textbox, but i can't get it to work. I used to remember that there was something like that in the control properties box in vb, like setfocus or something, but not here. Any tutorials on openoffice about the vb web thingie would be highly appreciated to. Thanks a bunch. ...

UDP packet send / receive
i am unable to send an UDP packet to embedded board on which IP was not implemented. MAC Address and port number were implemented. please let me known how to send UDP packet to Embedded board through MAC Address and port. please help me balajiyalam@gmail.com wrote: > > i am unable to send an UDP packet to embedded board on which IP was not > implemented. MAC Address and port number were implemented. > > please let me known how to send UDP packet to Embedded board through > MAC Address and port. > > please help me You are far from getting UDP datagrams throug...

UDP multicast problem with winsock
Apologies in advance if this newsgroup is considered not relevent, if so please suggest one that is. I have a situation where i need to receive UDP multicasts on a computer that has multiple network cards. The problem i am experiencing is that the udp packets are arriving on the network card of interest (i have run a network analysis application to verify this) but something is blocking the data from arriving on the open socket. Following the advice from an older post i have run TDIMon.exe also and can confirm that the 'TDI_EVENT_RECEIVE_DATAGRAM' message is not reported whe...

[VxW] Receiving multicast packets
Hi =20 I am try to receive a multi-cast (OSPF hello) packet. For this I have created a raw socket and do a recvfrom(). (See the code attached) Everytime I read from the socket, I see that the length field in the IP header is 20 bytes less than the actual length. Does anyone know of this problem...what am I doing wrong?? Any pointers will be helpful. =20 =20 Code sample follows: --------------------------- struct InPkt { char i_vhlen; // Version and header length char i_tos; // Type-of-service short i_len; // Total length in bytes short i_id; ...

Visual Objects compared to Visual Basic and Visual C.
Who can explain me why I have to use VO instead of VB or VC? OR is is there no difference? With kind regards Rob van der Ploeg Rob, Every language has his (dis)advantages. The ones you mention are all wrappers around the Win32 API. VO is a very nice and easy language compared to VC. Data-access is famous with VO, but also memorymanagement, the cargage collector, ragged array's. and the result is fast and reliable code. You do not have to declare every variable if you do not want to. (but you will) Comparing to VB is VO a real OOP langangue where VB is not. You can write your own classes, inherit classes from VO classes or from your own classes, Overide methods, use both strong and loose typed variables, write early and late bound code VO comes with a SDK containing the sourcecode of the part of VO written in VO (almost everything except f.i. the compiler) With VO you get this newsgroup, where almost every question is answered within hours. VO has a prof. usergroup in the netherlands, check www.sdgn.nl. with very often very well organised conferences. I think it is the best organised usergroup in the world. VO is limitted to the Win32 api. A .NET version is announced, but withoot a releasedate yet. More inforrmation about VO can be found at www.cavo.com regards, Erik "Mobi-Data Helpdesk" <info@direcom.nl> schreef in bericht news:1070360435.358105@tbird.introweb.nl... > Who can explain me why I have to use...

receive udp packets on windows xp
Hi All, I'm trying to write some Java code that receives UDP packets on a specific port. I'm using jre1.5.0_06 on a windows XP pro machine. My problem is that the code works on a Linux box, but not my Windows box. Here is the code (which I modified from anohter Usenet post): <code> public static void main(String[] args) { DatagramSocket socket; try { socket = new DatagramSocket(12345); byte[] buf = new byte[256]; DatagramPacket packet = new DatagramPacket(buf, buf.length); System.out.println("Attempting to receive packet..."); socket.receive(p...

Increase Winsock (receive) buffer UDP
Hi community, I have some (embedded) device sending UDP packets over GigE to a Win7 PC. E= ach UDP packet has a size of 8KB (payload). A burts of 180 UDP packets is t= ransmitted every 60ms. Within this burst 180 packets are sent every 83.3=B5= s. This roughly translates to a peak data transfer rate of about 750Mbps an= d an average data transfer rate of about 187.5Mbps, nothing out of the ordi= nary one should think. I thoroughly analyzed the network traffic with Wireshark and confirmed that= every UDP packet is received by the PC side! At a first step I'm just trying to u...

Problem receiving UDP broadcast packets.
I'm have problems figuring out how to receive UDP broadcast packets on Linux. Here's the receiving code: ------------------------------receive.py------------------------------- #!/usr/bin/python import socket host = '' port = 5010 s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) s.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1) s.bind((host, port)) while 1: try: message = s.recv(8192) print "Got data: %s" % repr(message) except KeyboardInterrupt: break --------------...

recvfrom():how to receive multiple UDP packets.
Hello All, I am working on a embedded system which should be capable of receiving UDP packets from multicasting server sending packets at around 80Mbps. I am losing packets between the two recvfrom() api calls. my thread just receives a packet, strip out some of the details and copy the data to a buffer through memcpy and again go to recvfrom() call. This thread works fine at bit rates of around 20Mbps but at 80 Mbps many packets are getting lost. It is very clear that at higher bit rates my user level thread is not fast enough to cope up with the high rate of incoming packets. I think since ...

Receiving series of Bytes in Visual Basic
Hi, I have some problem to receive series of Bytes using MSComm in Visual Basic. If anyone could help me, I am so grateful to you. I am trying to receive series of Bytes from a PIC16F877. These bytes are generated by an image sensor and stored in a SRAM, the PIC get each bytes and send it through USART. The total number of bytes is 16384, but I am getting just less than that (the total number is varying). The following code is the part of Visual Basic programme to receive these bytes. --------------------------------------------------------------------- Public a, b, c as Integer Private Su...

Problem receiving UDP broadcast packets.
I'm trying to receive UDP broadcast packets. It's not working, and I'm stumped. Here's my test program: ------------------------------------------------------------------------ #include <stdlib.h> #include <string.h> #include <netdb.h> #include <stdio.h> void error(const char *msg) { perror(msg); exit(0); } int main(int argc, char *argv[]) { int sock, n; struct sockaddr_in server; char buf[1024]; int one = 1; if (argc < 2) { fprintf(stderr, "ERROR, no port provided\n"); exit(0); } sock=socket(AF_INE...

Visual Basic .net MSComm control
Hi: I have a question about the Microsoft Communications Control Version 6.0 from visual studio .net. I have this code: Dim Buffer As String Do Buffer = AxMSComm1.Input() //Error, it does not recognize this statement. Loop Until Len(Buffer) > 0 AxMSComm1.PortOpen = False Could someone tell me why I get this error or where I can find information on using this ActiveX control. I went to the MSDN website but could not find any information about this control. The MSDN site only referred me to MSComm from visual basic 6.0. Thanks. ...

Getting header of received UDP packet
Hello, I am programming an application which will send and receive UDP packets, however for the received packets I need to be able to read the header information. Is this possible in Winsock? As far as I am aware, it strips the header information and just gives you the data of the packet. If not, would something else do it like WinPCap or something else? On 05/ 1/10 01:36 PM, Philliam Auriemma wrote: > Hello, > I am programming an application which will send and receive UDP > packets, however for the received packets I need to be able to read > the header information. I...

Receiving Unicast packets on Multicast socket
Is it possible to have a single MulticastSocket also receive Unicast packets in Java? I'm able to bind one of each socket to the same port but I'd like to be able to use just one socket. I'm running under RedHat 9.0. Thanks, Rich On 22 Oct 2004 14:06:38 -0700, Rich DeMarinis wrote: > Is it possible to have a single MulticastSocket also receive Unicast > packets in Java? I'm able to bind one of each socket to the same > port but I'd like to be able to use just one socket. I'm running > under RedHat 9.0. Yes, since your application uses the same port number...

Visual Basic AciveX control not deleting
I have an activex control written in Visual Basic 6.0 with service pack 6. My problem is that invoking either delete or release on the control does not in fact delete the control. If I run the Microsoft Spy++ applicaton I see that the control is still loaded. The only way to get free the control is to exit Matlab and restart. One intereresting piece of data is that there are several processes running in my Matlab thread, one of which is a process named MATLABActiveXParent. When I invoke delete this particular thread goes away, however all others stay. ...

Controlling telnet via Visual Basic
I want to access a modem equipment device over the internet by calling it with its IP address and then using telnet to log in to its text style management screen, send a few single character commands and download a page of traffic statistics every 5 minutes and display a running table of date/time and traffic load (transmit, receive, errors etc). I have Visual Basic 2005 Express. What "add-in" is needed / recommended ?. Your advice would be most welcome. Best regards, Eric. On Sat, 22 Jul 2006 20:18:16 GMT, "Eric Johnston" <nospam@redyonder.co.uk> wrote: ...

Web resources about - how to receive udp multicasting packets with winsock control? - comp.lang.basic.visual.misc

PS4 to use Gaikai for instant demos, Ustream multicasting, social gameplay
David Perry, CEO and founder of Gaikai, took the stage at today's PlayStation 4 announcement to reveal new details on the next generation of ...

PS4 to use Gaikai for instant demos, UStream multicasting, social gameplay
Michael McWhertor / Polygon : PS4 to use Gaikai for instant demos, UStream multicasting, social gameplay — David Perry, CEO and founder of Gaikai, ...

iiNet multicasting IPTV over the NBN
iiNet has become the first ISP to deliver IPTV over the NBN using multicasting technology as part of a trial in Sydney.

NPR's Tomorrow Radio Initiative Brings Multicasting to Digital Radio
... on Public Radio Stations LAS VEGAS, NV Leading the U.S. radio industry in technical innovation and programming, NPR has ensured that multicasting ...

App Store - Documents To Go® - Office Suite
Read reviews, get customer ratings, see screenshots, and learn more about Documents To Go® - Office Suite on the App Store. Download Documents ...

Broadcasting - Wikipedia, the free encyclopedia
This article includes a list of references , related reading or external links , but its sources remain unclear because it lacks inline citations ...

ASCAP - ASCAP Radio Music Licensing
ASCAP Radio Music license authorizes performances of copyrighted musical works

02.06.12 // The Future of Networking
Major technology platforms tend to last about 25 to 30 years. This gives them time to gather sufficient developer momentum, enable a set of transformational ...

High Level Logic (HLL) Project
I've decided to release a 2007 video of the robot demonstration (which will be available for download with the new version sometime relatively ...

What's New At Bridge Ratings
For release August 8, 2007 HD Radio vs. Internet Radio - Which is Radio's Future? Here at Bridge Ratings, we are often asked about HD radio. ...

Resources last updated: 2/23/2016 1:27:59 PM