Datagram broadcast in J2ME...
nbonniotTue Dec 17, 2013 02:23 AM
I'm a newbie on this forum and I've got a small project running on a Raspberry Pi with J2ME 3.3.
I want to make a Wake On Lan packet generator and so far I achieved all my goals except one limitation on which I would like some suggestions.
I'm able to generate a valid WOL magic packet (checked on Wireshark), but only to a precise IP. My router doesn't store its ARP table (IP/MAC address association) so any IP disconnected for while (5 mins) simply disappear. The WOL goal is to wake it up, but ironically the router doesn't transmit any packet to this IP because... it's not here.
Using softs such as WOL sender, I managed to wake it up, BUT I had to configure it on broadcast, so that my router would transmit it anyway and the packet reach its destination.
As far as I saw, J2ME doesn't allow UDP datagram broadcast for security/network overload reasons.
1) Could you confirm me it's not possible (I got IOException doing this, while classic IP goes through) ?
My plan is the following : create a C program my MIDlet will invoke using socket. In C, I will be able to create a broadcat datagram. As my Pi is on a switch with the target machine to wake up, the packet would be sent on the target machine without going through router. This is the theory.
What do you think about it? Do you have any other dea on the way I could achieve this?
Report | Quote This | Reply | Print