Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Compact Framework / November 2007

Tip: Looking for answers? Try searching our database.

How can I broadcast a WakeOnLan datapacket?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
P Wheldon - 08 Nov 2007 13:33 GMT
How can I broadcast a WakeOnLan datapacket?

Tried using Sockets but compact framework does not support broadcasting nor
connectionless sending .

Looked at IPHelper function IcmpSendEcho, but iphlpapi.dll failed to load
when using reflection.

Any suggestions?
im.djmatty@googlemail.com - 08 Nov 2007 14:15 GMT
Can't you send the packet to the subnets broadcast address? (http://
en.wikipedia.org/wiki/Broadcast_address)

Compact Framework does support connectionless sending, via the
Socket.SendTo method, I seem to recall I had WOL working on my WM5
device, but my router does not allow packets from the internet to the .
255 address on the LAN, so I couldn't actually turn on my machine from
the internet, although it worked great when I was connected via my
WLAN.

Matt

On Nov 8, 1:33 pm, P Wheldon <PWhel...@discussions.microsoft.com>
wrote:
> How can I broadcast a WakeOnLan datapacket?
>
[quoted text clipped - 5 lines]
>
> Any suggestions?
P Wheldon - 08 Nov 2007 14:26 GMT
I will give this a go.

I have tried SendTo using ip 255.255.255.255 as the EndPoint, but it failed.
Not sure of the exception though.

> Can't you send the packet to the subnets broadcast address? (http://
> en.wikipedia.org/wiki/Broadcast_address)
[quoted text clipped - 19 lines]
> >
> > Any suggestions?
P Wheldon - 08 Nov 2007 15:01 GMT
this is the reported error
error code 10057
A request to send or receive data was disallowed because the socket is not
connected and (when sending on a datagram socket using a sendto call) no
address was supplied.

This happens on the local bradcast and also loopback addresses.

Socket address family is internetwork, type is stream and protocol is TCP.  
Have tried raw data stream and UDP protocol, but the sockect fails to
initlise.   SendTo flags does not allow broadcast.

> Can't you send the packet to the subnets broadcast address? (http://
> en.wikipedia.org/wiki/Broadcast_address)
[quoted text clipped - 19 lines]
> >
> > Any suggestions?
Paul G. Tobey [eMVP] - 08 Nov 2007 15:19 GMT
That's the problem.  You've opened a stream socket, not a datagram socket.
You want SocketType.Dgram, not stream.

Paul T.

> this is the reported error
> error code 10057
[quoted text clipped - 33 lines]
>> >
>> > Any suggestions?
P Wheldon - 08 Nov 2007 15:26 GMT
Yep.

thankyou Paul

> That's the problem.  You've opened a stream socket, not a datagram socket.
> You want SocketType.Dgram, not stream.
[quoted text clipped - 38 lines]
> >> >
> >> > Any suggestions?
P Wheldon - 08 Nov 2007 15:21 GMT
I've got a bit further thanks, helps if the socket is Dgram UDP.

> Can't you send the packet to the subnets broadcast address? (http://
> en.wikipedia.org/wiki/Broadcast_address)
[quoted text clipped - 19 lines]
> >
> > Any suggestions?
<ctacke/> - 08 Nov 2007 19:23 GMT
Something like this?

http://blog.opennetcf.org/ctacke/PermaLink,guid,8a2b4fa0-3ab1-4ddf-b5d2-893f61ff
c21b.aspx


Signature

Chris Tacke, eMVP
Join the Embedded Developer Community
http://community.opennetcf.com

> How can I broadcast a WakeOnLan datapacket?
>
[quoted text clipped - 6 lines]
>
> Any suggestions?
P Wheldon - 09 Nov 2007 09:47 GMT
Yep

> Something like this?
>
[quoted text clipped - 10 lines]
> >
> > Any suggestions?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.