PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Compact Framework How can I broadcast a WakeOnLan datapacket?

Reply

How can I broadcast a WakeOnLan datapacket?

 
Thread Tools Rate Thread
Old 08-11-2007, 01:33 PM   #1
=?Utf-8?B?UCBXaGVsZG9u?=
Guest
 
Posts: n/a
Default How can I broadcast a WakeOnLan datapacket?


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?

  Reply With Quote
Old 08-11-2007, 02:15 PM   #2
im.djmatty@googlemail.com
Guest
 
Posts: n/a
Default Re: How can I broadcast a WakeOnLan datapacket?

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?
>
> 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?



  Reply With Quote
Old 08-11-2007, 02:26 PM   #3
=?Utf-8?B?UCBXaGVsZG9u?=
Guest
 
Posts: n/a
Default Re: How can I broadcast a WakeOnLan datapacket?

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.

"im.djmatty@googlemail.com" wrote:

> 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?
> >
> > 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?

>
>
>

  Reply With Quote
Old 08-11-2007, 03:01 PM   #4
=?Utf-8?B?UCBXaGVsZG9u?=
Guest
 
Posts: n/a
Default Re: How can I broadcast a WakeOnLan datapacket?

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.

"im.djmatty@googlemail.com" wrote:

> 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?
> >
> > 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?

>
>
>

  Reply With Quote
Old 08-11-2007, 03:19 PM   #5
Paul G. Tobey [eMVP]
Guest
 
Posts: n/a
Default Re: How can I broadcast a WakeOnLan datapacket?

That's the problem. You've opened a stream socket, not a datagram socket.
You want SocketType.Dgram, not stream.

Paul T.

"P Wheldon" <PWheldon@discussions.microsoft.com> wrote in message
news:954481FE-1A6A-455A-A130-E3075D4D7592@microsoft.com...
> 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.
>
> "im.djmatty@googlemail.com" wrote:
>
>> 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?
>> >
>> > 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?

>>
>>
>>



  Reply With Quote
Old 08-11-2007, 03:21 PM   #6
=?Utf-8?B?UCBXaGVsZG9u?=
Guest
 
Posts: n/a
Default Re: How can I broadcast a WakeOnLan datapacket?

I've got a bit further thanks, helps if the socket is Dgram UDP.

"im.djmatty@googlemail.com" wrote:

> 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?
> >
> > 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?

>
>
>

  Reply With Quote
Old 08-11-2007, 03:26 PM   #7
=?Utf-8?B?UCBXaGVsZG9u?=
Guest
 
Posts: n/a
Default Re: How can I broadcast a WakeOnLan datapacket?

Yep.


thankyou Paul

"Paul G. Tobey [eMVP]" wrote:

> That's the problem. You've opened a stream socket, not a datagram socket.
> You want SocketType.Dgram, not stream.
>
> Paul T.
>
> "P Wheldon" <PWheldon@discussions.microsoft.com> wrote in message
> news:954481FE-1A6A-455A-A130-E3075D4D7592@microsoft.com...
> > 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.
> >
> > "im.djmatty@googlemail.com" wrote:
> >
> >> 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?
> >> >
> >> > 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?
> >>
> >>
> >>

>
>
>

  Reply With Quote
Old 08-11-2007, 07:23 PM   #8
Guest
 
Posts: n/a
Default Re: How can I broadcast a WakeOnLan datapacket?

Something like this?

http://blog.opennetcf.org/ctacke/Pe...3f61ffc21b.aspx


--

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



"P Wheldon" <PWheldon@discussions.microsoft.com> wrote in message
news:78FCA545-90FC-404E-A969-C088CC461AD1@microsoft.com...
> 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?
>



  Reply With Quote
Old 09-11-2007, 09:47 AM   #9
=?Utf-8?B?UCBXaGVsZG9u?=
Guest
 
Posts: n/a
Default Re: How can I broadcast a WakeOnLan datapacket?

Yep

"<ctacke/>" wrote:

> Something like this?
>
> http://blog.opennetcf.org/ctacke/Pe...3f61ffc21b.aspx
>
>
> --
>
> Chris Tacke, eMVP
> Join the Embedded Developer Community
> http://community.opennetcf.com
>
>
>
> "P Wheldon" <PWheldon@discussions.microsoft.com> wrote in message
> news:78FCA545-90FC-404E-A969-C088CC461AD1@microsoft.com...
> > 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?
> >

>
>
>

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off