...
> I am trying to broadcast a message.
> When I am doing this (on FORTE IDE),
> everything works fine, and I am not getting any exception.
>
> When I am trying the follows, and running from the command line :
> In Java code :
....
> I get the exception message :
> access denied (java.net.SocketPermission 240.0.0.1:2222 connect,resolve)
>
> Why ?
Usually this type of error happens when a developer switches
from running code that does not invoke any security manager,
into an applet, or WebStarted application or applet.
But that does not quite fit your description - that it fails
when run from the command line. An application launched
from the command line should have no security manager,
or at least - it should be able to do anything that can be
done by running the code direct from the IDE.
> And what should I do in order to solve the problem ?
If you get no solution, you might try posting a complete,
compilable example so that we can investigate further.
Andrew T.
Mark Space - 21 Jul 2006 18:00 GMT
> ...
>> I am trying to broadcast a message.
[quoted text clipped - 6 lines]
>> I get the exception message :
>> access denied (java.net.SocketPermission 240.0.0.1:2222 connect,resolve)
Total off the cut guess, but broadcast address are fixed by the TCP/IP
protocol. Are you sure this is a valid broadcast address for the
network in question? Is it your network or someone else's? Sending a
broadcast to another network may not be implemented in TCP/IP, so if
it's not your network, that may explain the permission denied part.
Ok I actually did a search, because I thought the IP address looked
funny. That's a multi-cast address, not a broadcast. I'm pretty sure,
with out doing any more research, that multicasting is not guaranteed to
be implemented, and often isn't. YMMV.
Eitan M - 21 Jul 2006 20:15 GMT
It just an experiment to learn how things work.
(Besides - not 240.0.0.1, but 239.0.0.1,
just a random number i pick up between 224.0.0.0 - 239.255.255.255,
The same problem stays ...)
It may be not as simple as that (I should probebly configure a web-server
for that).
How can I make the simpliest broadcast station on internet using above ports
and methods ?
Thanks :)
>> ...
>>> I am trying to broadcast a message.
[quoted text clipped - 17 lines]
> doing any more research, that multicasting is not guaranteed to be
> implemented, and often isn't. YMMV.
Mark Space - 22 Jul 2006 04:57 GMT
> It just an experiment to learn how things work.
> (Besides - not 240.0.0.1, but 239.0.0.1,
[quoted text clipped - 4 lines]
> How can I make the simpliest broadcast station on internet using above ports
> and methods ?
I haven't done any low level network programming on Java, but best as I
can remember, 255.255.255.255 is always the default broadcast address
for any network. Routers won't forward that (they can't) but any local
machines should receive a packet. Port: can't remember if ports work for
broadcast or not, but try it. Just pick a port #, broadcast and listen
on the same port #, see if it goes.
You should really get some info on basic TCP/IP stuff, like how it works
and all. My books are packed away at the moment, but try a Google
search for TCP tutorial or some such.