c# - Socket Error The requested address is not valid in its context -
while trying set socketoption using :
listener.setsocketoption(socketoptionlevel.ip, socketoptionname.addmembership, new multicastoption(ipaddress));
i getting next exception ;
the requested address not valid in context
my listmer is:
socket listener = new socket(addressfamily.internetwork, sockettype.dgram, protocoltype.udp);
and ip 3.212.x.x
is problem because of ip ?
the problem in statement:
listener.setsocketoption(socketoptionlevel.ip, socketoptionname.addmembership, new multicastoption(ipaddress));
msdn outline constructor :
public multicastoption( ipaddress grouping )
so multicastoption looks grouping broadcast had passed localip , problem.
i instead updated code:
ipaddress ip = ipaddress.parse("224.5.6.7"); socket _socketserver = new socket(addressfamily.internetwork, sockettype.dgram, protocoltype.udp); _socketserver.setsocketoption(socketoptionlevel.ip, socketoptionname.addmembership, new multicastoption(ip)); _socketserver.setsocketoption(socketoptionlevel.ip, socketoptionname.multicasttimetolive, 1);
c# sockets multicast
Nice tutorial. Thanks for sharing the valuable information. it’s really helpful. Who want to learn this blog most helpful. Keep sharing on updated tutorials…
ReplyDeleteBest Devops Training in pune
Best Devops Training institute in Chennai
This is such a good post. One of the best posts that I\'ve read in my whole life. I am so happy that you chose this day to give me this. Please, continue to give me such valuable posts. Cheers!
ReplyDeletepython training in chennai
python course institute in chennai
Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. keep up!!
ReplyDeleteandroid training in chennai
android online training in chennai
android training in bangalore
android training in hyderabad
android Training in coimbatore
android training
android online training