Hi everyone, I am trying to write a small app that sends multicast udp
packets using a socket object.
I have more than one NIC on my PC and the following code works OK only if I
disable all the NICs but the one i want to use.
Of course i tried to use Socket.Bind method, but even if i use it to bind to
the correct NIC (I also verify using LocalEndPoint and IT IS the correct
one), the packet is sent on the wrong NIC! (I have a software firewall that
tells me the source NIC). What is really weird is that after executing the
first setsocketoption the program broadcasts to 224.0.0.22, WHY??? The group
is 224.5.6.7!
Can someone help me, i'm going nuts on this problem!
The code i use to send the packet is next, thanx to anyone answering!!!
UdpSender = New Socket(AddressF amily.InterNetw ork, SocketType.Dgra m,
ProtocolType.Ud p)
UdpSender.Bind( New IPEndPoint(IPAd dress.Parse("19 2.168.0.1"), 5000))
<--- WITH OR WITHOUT THIS IT IS THE SAME!!!!
With UdpSender
.SetSocketOptio n(SocketOptionL evel.IP,
SocketOptionNam e.AddMembership , New
MulticastOption (IPAddress.pars e("224.5.6.7")) )
.SetSocketOptio n(SocketOptionL evel.IP,
SocketOptionNam e.MulticastTime ToLive, 1)
End With
groupEP = New IPEndPoint(IPAd dress.Parse("22 4.5.6.7"), 5000)
bytes = Encoding.ASCII. GetBytes(messag e)
UdpSender.Conne ct(groupEP)
UdpSender.Send( bytes, bytes.Length, SocketFlags.Non e)
UdpSender.Close () 0 1049 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: anuradha.k.r |
last post by:
hi,
i am writing a socket program in python,both client side and server
side.I've written the client side which is working perfectly
fine(checked it against server program written in C).but as for my
server program written in python it simply hangs.it does not show any
error also.I've tried sample programs available .I don understand what
the reason is as i am quite new to it.
here is teh server side program:
///////////////////////
|
by: Clarence Gardner |
last post by:
I've got a problem that I don't see how to program around. A socket server
that was running fine, today started getting an exception from the bind()
call (errno 22, Invalid argument) and yet the bind had actually worked.
This is apparent from this code: it prints the error message, but then
breaks out of the loop and the listen() and accept() calls work normally.
How can one handle a function that is both working and raising an...
|
by: Philippe C. Martin |
last post by:
Hi,
I am following a few tutorial and this howto:
*************************************************************
............
What happens in the web server is a bit more complex. First, the web
server creates a "server socket".
|
by: 0k |
last post by:
Hi everyone, I am trying to write a small app that sends multicast udp
packets using a socket object.
I have more than one NIC on my PC and the following code works OK only if I
disable all the NICs but the one i want to use.
Of course i tried to use Socket.Bind method, but even if i use it to bind to
the correct NIC (I also verify using LocalEndPoint and IT IS the correct
one), the packet is sent on the wrong NIC! (I have a software...
|
by: DaTurk |
last post by:
I am makeing a Multicast server client setup and was wondering what the
difference is between Socket.Connect, and Socket.Bind.
It may be a stupid question, but I was just curious. Because I tried a
test, and I can't bind two sockets to the same port/ip but I can
connect with one socket, and bind with another to the same ip/port.
Thanks
| |
by: zxo102 |
last post by:
Hi everyone,
I am using a python socket server to collect data from a socket
client and then control a image location ( wxpython) with the data,
i.e. moving the image around in the wxpython frame.
But the "app.MainLoop()" in wxpython looks like conflicting with
the "while 1:" in socket server. After I commented the
"app.MainLoop()", everything is working except two things:
1. if I click anywhere on the screen with the mouse, the image is...
|
by: Sean |
last post by:
Hi Everyone,
My apologies for a somewhat dump question but I am really stuck. I have
been working on this code for two days straight I am dont know what is
wrong with it. when I run the code, All I get is Input: and the program
quits. I also tried reading this online but I didn't quite get it.
What is the diff between sin_addr and sin_addr.s_addr. My understanding
is that the latter is the IP address of my machine where as the former
is...
|
by: Mangabasi |
last post by:
Howdy,
I would like to use the Synthesis Toolkit for a demo. I downloaded
the STK from http://ccrma.stanford.edu/software/stk/index.html. It
seems very powerful and user friendly. There are bindings for socket
connections and TCL gui examples. I would like to get one of the demo
samples work with Python/wxPython. I am including the TCL code for
the drums demo (this was the shortest one).
Has anybody converted this to wxPython? ...
|
by: silverburgh.meryl |
last post by:
Hi,
I read the following code which open a server socket for client
request.
However, i would like to know how can I change it so that i just
listen for client requestfor 10 seconds, after that, it bows out?
Code:
|
by: natambu |
last post by:
I have a linux box with multiple ip addresses. I want to make my
python client connect from one of the ip addresses. Here is my code,
no matter what valid information I put in the bind it always comes
from the default ip address on the server. Am I doing something wrong?
-------------
#!/usr/bin/python
import socket
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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 launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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 into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
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
|
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |