Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > APPLE developers: JVM bug in OSX

APPLE developers: JVM bug in OSX
Thread Tools
Grizzled Veteran
Join Date: Sep 2000
Location: Netherlands
Status: Offline
Reply With Quote
Feb 20, 2001, 06:02 AM
 
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
Reply With Quote
Feb 20, 2001, 11:51 AM
 
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
Reply With Quote
Feb 20, 2001, 12:42 PM
 
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
     
The DJ  (op)
Grizzled Veteran
Join Date: Sep 2000
Location: Netherlands
Status: Offline
Reply With Quote
Feb 20, 2001, 02:59 PM
 
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
Reply With Quote
Feb 21, 2001, 09:36 AM
 
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
Reply With Quote
Feb 23, 2001, 03:07 PM
 
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.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 12:26 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2