 |
 |
APPLE developers: JVM bug in OSX
|
 |
|
 |
|
Grizzled Veteran
Join Date: Sep 2000
Location: Netherlands
Status:
Offline
|
|
I posted this to the OSX feedback site aswell, but maybe posting it here is better.
This needs to be fixed in OSX final. The development of a freeware Samba GUI client depends on it. And everyone wants that. ;-)
Could someone with a later build than OSX PB check if this class is working with their JVM?
I found a bug in the JVM of macos x PB.
This is the function i wanted to use (in a test program)
import java.net.*;
public class TestDatagram {
public static void main( String[] argv ) throws Exception {
DatagramPacket packet = new DatagramPacket( "hello, world".getBytes(), 12, InetAddress.getByName( "broadcastadress" ), 137 );
DatagramSocket socket = new DatagramSocket();
socket.send( packet );
}
}
replace "broadcastaddress" with a string of your local broadcastaddress. like in my case 130.89.255.255
When run, this produces.
%: java TestDatagram
Exception in thread "main" java.io.IOException: Permission denied
at java.net.PlainDatagramSocketImpl.send(Native Method)
at java.net.DatagramSocket.send(DatagramSocket.java:3 21)
at TestDatagram.main(TestDatagram.java:8)
Not what it should be ;-)
I used this function on other platforms, but it doesn't work in OSX.
I really need this function working by Final.
Hope i discovered it in time
DJ
[This message has been edited by The DJ (edited 02-20-2001).]
|

Derk-Jan Hartman, Student of the University Twente (NL), developer of VLC media player
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Jan 2000
Status:
Offline
|
|
I'm going to move this over to the Mac OS X Developer forum. Click through to find your post.
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Apr 1999
Location: MA
Status:
Offline
|
|
This actually seems reasonable...
Have you tried this with a Unix and/or Linux box? Does it work without being superuser (aka, root)?
I do know that you can't ping a broadcast address under Linux without being root (i.e. ping -b 192.168.1.255).
Under Windows and Classic MacOS, there probally isn't any restrictions regarding the use of broadcast addresses. Also, it may work differently than under other Unices, but if it wasn't specified in the Java spec to allow broadcast under non-privledged users, than Apple could've implemented it either way.
------------------
dennis
|
|
dennis
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Sep 2000
Location: Netherlands
Status:
Offline
|
|
Originally posted by SmileyDude:
Have you tried this with a Unix and/or Linux box? Does it work without being superuser (aka, root)?
I do know that you can't ping a broadcast address under Linux without being root (i.e. ping -b 192.168.1.255).
Under Windows and Classic MacOS, there probally isn't any restrictions regarding the use of broadcast addresses. Also, it may work differently than under other Unices, but if it wasn't specified in the Java spec to allow broadcast under non-privledged users, than Apple could've implemented it either way.
I used the method on Windows and several *nix's and it works on all of them.
This is what it says when run as root.
root# java TestDatagram
Exception in thread "main" java.io.IOException: Permission denied
at java.net.PlainDatagramSocketImpl.send(Native Method)
at java.net.DatagramSocket.send(DatagramSocket.java:3 21)
at TestDatagram.main(TestDatagram.java:8)
|

Derk-Jan Hartman, Student of the University Twente (NL), developer of VLC media player
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Nov 2000
Status:
Offline
|
|
I just gave it a whirl with 127.0.0.1 and it ran no-err.
Maybe the problem is that you're trying to use a "broadcastadress" that you're not allowed to in your test cases. Well, I don't know enough about datagrams to say either way but that's what it looks like to me.
Good luck!
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Sep 2000
Location: in front of the keyboard
Status:
Offline
|
|
It works fine in 4K56.
By the way, what exactly are you trying to do?
|
|
signatures are a waste of bandwidth
especially ones with political tripe in them.
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|