Re: java developer feedback
hi, there're some os wher this is not required for receiving multicast packet. man 7 ip IP_ADD_MEMBERSHIP Join a multicast group. Argument is a struct ip_mreqn structure. struct ip_mreqn { struct in_addr imr_multiaddr; /* IP multicast group address */ struct in_addr imr_address; /* IP address of local interface */ intimr_ifindex; /* interface index */ }; imr_multiaddr contains the address of the multicast group the application wants to join or leave. It must be a valid multicast address. imr_address is the address of the local interface with which the system should join the multicast group; if it is equal to INADDR_ANY an appropriate interface is chosen by the system. imr_ifindex is the interface index of the interface that should join/leave the imr_multiaddr group, or 0 to indicate any interface. For compatibility, the old ip_mreq structure is still supported. It differs from ip_mreqn only by not including the imr_ifindex field. Only valid as a setsockopt(2). Calvin Austin wrote: > > I don't know if anyone else can verify this, but the bug listed below > seems to be BSD socket related (ie OS related) > > I hacked some code together from an online example and included what > Java does on the server side , compile cc -o serv serv.c and > test with the Broadcaster client from the bug report. > > If the ip address field is not used then the server gets the broadcast > packets > (it works) If the address is used then it doesn't. I'm thinking that > this > may be trapped elsewhere and not in Java > > regards > calvin > > Jason Gilbert wrote: > > > > > 3) Bug 4191980 > > (http://developer.java.sun.com/developer/bugParade/bugs/4191980.html). > >It's amazing that this has been around since 1.1.6 (probably > > earlier). Sadly, if > >the jdk was in fact Free Software this would have easily been > > fixed. Don't mention > >the Sun open source license (I don't remember what it's called > > today). That's more > >of a lock-in than Microsoft. At least they just lock you into > > using there software > >by not being compatible with other software. Sun wants people > > to effectively lock > >themselves into using only the Sun implementation. There > > attempt at blocking > >'forking' basically would appear to block creating or working > > on another implementation. > >Kaffe for instance. Or blocking real innovation by allowing > > someone to say, "hey, > >these people are completely off base with their impl, I could > > make the JVM 100x faster > >by doing X" and then release it under the GPL. they're > > already tainted. I think the > >shortcoming is basically that Sun is trying to create this > > "community" which seems to > >be on only a product by product basis when the real community > > already exists which is > >the software developer community. small pond, largest pond. > > > > > jason > > > > -- > > Jason Gilbert | http://home.hiwaay.net/~gilbertj/ > > -- > > I wish I could make the garbage collector thread in my > > brain less aggressive. > > > > -- > > To UNSUBSCRIBE, email to [EMAIL PROTECTED] > > with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED] > > > #include > #include > #include > #include > > #include > #include > > typedef intSIZE_T; > #define PACKET_SIZE1024 > > > main(int argc, char **argv) > { > intrr; > intrc; > intsockfd; > SIZE_T client_addr_len; > char*cmd_name; > charsend_data[PACKET_SIZE]; > charrecv_data[PACKET_SIZE]; > struct sockaddr_in servaddr; > struct sockaddr client_addr; > > cmd_name = argv[0]; > > /* > * Create a socket. > */ > sockfd = socket(AF_INET, SOCK_DGRAM, 0); > if (sockfd < 0) { > printf("%s: socket errno = %d\n", cmd_name, errno); >exit(-1); > } > > /* > * Initialize the address the socket will bind to. > */ > bzero(&servaddr, sizeof(servaddr)); > servaddr.sin_family = AF_INET; > servaddr.sin_port= htons(3000); > /* > * NOTE: assigning INADDR_ANY works > but listening to the machines own address does not receive broadcast > udp for that subnet */ > servaddr.sin_addr.s_addr = htonl(INADDR_ANY); > /*servaddr.sin_addr.s_addr = htonl(0x81907D7C);*/ > /*servaddr.sin_addr.s_addr = htonl(0x81907D6F);*/ > > /* > * Bind the socket to the address. >
Hot Spot crashes
Hello everybody, we`re using the j2sdk-1.3.0-FCS with Resin 1.1.5 (Java-Servlet-Engine) and Apache 1.3.14 on a SuSE7.0-Machine. Under higher load, the Servlet Engine reports: # HotSpot Virtual Machine Error, Internal Error After that, the whole engine restarts, which causes long accesstimes to our webserver. Is this a "real" Hotspot-Problem or is it a problem of our servlet-engine? Anybody ideas? -- Jochen Witte <[EMAIL PROTECTED]> -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: java developer feedback
Calvin Austin wrote: > > I don't know if anyone else can verify this, but the bug listed below > seems to be BSD socket related (ie OS related) This is probably true. However, I guess my point is 2 fold. 1) The implementation doesn't match the API specification. If you can't work around it about the API level then you should be able to work around it below the API and provide the specified interface. Which is possible. Write once, run anywhere. 2) The initial response from sun regarding this issue was to change the API from not directly specifying what happens to something that doesn't happen accross all platforms. This doesn't really help anything. > If the ip address field is not used then the server gets the broadcast packets > (it works) If the address is used then it doesn't. This works the same in java. When you don't specify and address, you get all addresses. Broadcast and otherwise. jason -- Jason Gilbert | http://home.hiwaay.net/~gilbertj/ -- I wish I could make the garbage collector thread in my brain less aggressive. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: localhost ip
Joi, A host may have multiple IP addresses. This is called a multi-homed host. Do not confuse multiple IP addresses with Domain addresses. An address may have a domain address plus aliases associated with it. In my home setup I have several machines running on one of the test IP network addresses and this is not visible to the Net. However when I connect to DU I get an IP address assigned dynamically (plan to change that soon). So my machine at the time of this writing hosts two distinct IP addresses and could do more. Each network device attached to the host gets an IP address. Usually the host has only one DNS (domain name associated with it) but multiple domains can be hosted on one box. Some RFCs you might want to look at are: rfc799.txt rfc887.txt rfc917.txt rfc1127.txt rfc1537.txt rfc1630.txt rfc1738.txt rfc1912.txt (Obsoletes 1537) Cruse the RFCs (also use zgrep on the files if compressed) a bit and I think you will find a wealth of info. Also recall that "localhost" is 127.0.0.1 in IP. I think the person really wanted the info about which IP address they were assigned to be visible on the net and not the localhost address. This is a different problem. I would start with the System and Properties classes. Probably will not get what you want there but may find soem clues. If not there is always JNI techniques to the platform or poking around the etc file. td Joi Ellis wrote: > > On 22 Nov 2000, Juergen Kreileder wrote: > > > It's not that easy. A host may have several IP addresses and other > > hosts may have to use different addresses to reach it. E.g. hosts on > > the intranet may have to use 192.168.0.100, but external machines may > > have to use 65.123.66.124. > > This is true, but it is not allowed in DNS for one host to have multiple > addresses. At least the DNS admin at my previous job claimed this was so. > If you give each interface a DNS entry, each name must be unique. > > Even if you have an internal DNS with one address, and an external DNS with > a different address, when your own host looks itself it, it can only get > one A record back. > > So, if what I understand of DNS is true, it is just that easy. > > -- > Joi EllisSoftware Engineer > Aravox Technologies [EMAIL PROTECTED], [EMAIL PROTECTED] > > No matter what we think of Linux versus FreeBSD, etc., the one thing I > really like about Linux is that it has Microsoft worried. Anything > that kicks a monopoly in the pants has got to be good for something. >- Chris Johnson > > -- > To UNSUBSCRIBE, email to [EMAIL PROTECTED] > with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: How do you get to process list ?(ps auwwx in Java)
You wrote: > I had an inquiry/ feature request about how to do this for my JavaUnix project. > Looks pretty easy on LINUX. Damn if I know how to do on Solaris tho. > You said some directories in /proc//* are in accessible, ok just try it. > > I could also default to `/usr/sbin/ps -afe' or `/usr/sbin/ps auuwx' ! > What about a sidekick to Perl? Perl folks are successfully using "Proc-ProcessTable", a general approach for a lot of unix systems, sources are easy to find on www.perl.com/CPAN/ Cheers, Albrecht -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: localhost ip
What about doing something like this: InetAddress me = InetAddress.getLocalHost(); // get the object InetAddress myName = me.getByName( me.getHostName() ); // lookup my name InetAddress IPs = InetAddress.getAllByName(myName); Peace... Tom Juergen Kreileder <[EMAIL PROTECTED]> on 11/21/2000 07:10:37 PM To: Joi Ellis <[EMAIL PROTECTED]> cc: Joseph Shraibman <[EMAIL PROTECTED]>, Nathan Meyers <[EMAIL PROTECTED]>, [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: Re: localhost ip > "Joi" == Joi Ellis <[EMAIL PROTECTED]> writes: Joi> On Mon, 20 Nov 2000, Joseph Shraibman wrote: >> Nathan Meyers wrote: >> > >> > [EMAIL PROTECTED] wrote: >> > >> > > dear all >> > >how can i get the localhost ip in java . >> > >> > InetAddress.getLocalHost() Joi> You need to ask your host what its IP is by using its name. Joi> I haven't had to do this yet, but I'd start with something Joi> like this: Joi> InetAddress me = InetAddress.getLocalHost(); // get the object Joi> InetAddress myName = me.getByName( me.getHostName() ); // lookup my name Joi> String myIp = myName.getIpAddress(); // looup my ip address by my name Joi> I haven't tested this, it's just what my own first attempt at Joi> this would be. BAsically, don't ask the machine for its own Joi> ip address, you'll get a random selection from whatever shows Joi> up in its own interface, including the lo local interface Joi> you're trying to avoid. Ask the machine for its real name, Joi> then ask it for the IP address of the machine which owns that Joi> name. THis does happen to be the same host, but the system Joi> library will ask the name resolution libs to look it up and Joi> will return the IP address by which that machine can be Joi> reached by others. It's not that easy. A host may have several IP addresses and other hosts may have to use different addresses to reach it. E.g. hosts on the intranet may have to use 192.168.0.100, but external machines may have to use 65.123.66.124. If you have a socket connection to another host you can call Socket.getLocalAddress() to find out which local address is used for the socket. Juergen -- Juergen Kreileder, Blackdown Java-Linux Team http://www.blackdown.org/java-linux.html JVM'01: http://www.usenix.org/events/jvm01/ -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: localhost ip
Rather this: InetAddress[] IPs = InetAddress.getAllByName(myName); Peace.. Tom [EMAIL PROTECTED] on 11/22/2000 09:35:10 AM To: [EMAIL PROTECTED] cc: [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: Re: localhost ip What about doing something like this: InetAddress me = InetAddress.getLocalHost(); // get the object InetAddress myName = me.getByName( me.getHostName() ); // lookup my name InetAddress IPs = InetAddress.getAllByName(myName); Peace... Tom Juergen Kreileder <[EMAIL PROTECTED]> on 11/21/2000 07:10:37 PM To: Joi Ellis <[EMAIL PROTECTED]> cc: Joseph Shraibman <[EMAIL PROTECTED]>, Nathan Meyers <[EMAIL PROTECTED]>, [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: Re: localhost ip > "Joi" == Joi Ellis <[EMAIL PROTECTED]> writes: Joi> On Mon, 20 Nov 2000, Joseph Shraibman wrote: >> Nathan Meyers wrote: >> > >> > [EMAIL PROTECTED] wrote: >> > >> > > dear all >> > >how can i get the localhost ip in java . >> > >> > InetAddress.getLocalHost() Joi> You need to ask your host what its IP is by using its name. Joi> I haven't had to do this yet, but I'd start with something Joi> like this: Joi> InetAddress me = InetAddress.getLocalHost(); // get the object Joi> InetAddress myName = me.getByName( me.getHostName() ); // lookup my name Joi> String myIp = myName.getIpAddress(); // looup my ip address by my name Joi> I haven't tested this, it's just what my own first attempt at Joi> this would be. BAsically, don't ask the machine for its own Joi> ip address, you'll get a random selection from whatever shows Joi> up in its own interface, including the lo local interface Joi> you're trying to avoid. Ask the machine for its real name, Joi> then ask it for the IP address of the machine which owns that Joi> name. THis does happen to be the same host, but the system Joi> library will ask the name resolution libs to look it up and Joi> will return the IP address by which that machine can be Joi> reached by others. It's not that easy. A host may have several IP addresses and other hosts may have to use different addresses to reach it. E.g. hosts on the intranet may have to use 192.168.0.100, but external machines may have to use 65.123.66.124. If you have a socket connection to another host you can call Socket.getLocalAddress() to find out which local address is used for the socket. Juergen -- Juergen Kreileder, Blackdown Java-Linux Team http://www.blackdown.org/java-linux.html JVM'01: http://www.usenix.org/events/jvm01/ -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: Hot Spot crashes
On Wed, Nov 22, 2000 at 03:50:05PM +0100, Jochen Witte wrote: > Hello everybody, > we`re using the j2sdk-1.3.0-FCS with Resin 1.1.5 (Java-Servlet-Engine) > and Apache 1.3.14 on a SuSE7.0-Machine. > Under higher load, the Servlet Engine reports: > > # HotSpot Virtual Machine Error, Internal Error If it says "internal error", it's very unlikely to be anything that can be blamed on the application code (including the servlet engine). Nathan > > After that, the whole engine restarts, which causes long accesstimes to > our webserver. > > Is this a "real" Hotspot-Problem or is it a problem of our > servlet-engine? > > Anybody ideas? > -- > Jochen Witte > <[EMAIL PROTECTED]> > > > -- > To UNSUBSCRIBE, email to [EMAIL PROTECTED] > with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: localhost ip
Joi Ellis wrote: > > On 22 Nov 2000, Juergen Kreileder wrote: > > > It's not that easy. A host may have several IP addresses and other > > hosts may have to use different addresses to reach it. E.g. hosts on > > the intranet may have to use 192.168.0.100, but external machines may > > have to use 65.123.66.124. > > This is true, but it is not allowed in DNS for one host to have multiple > addresses. [jks@d1 ~] nslookup www.yahoo.com Server: proxy1.union1.nj.home.com Address: 24.3.128.33 Non-authoritative answer: Name:www.yahoo.akadns.net Addresses: 216.32.74.52, 216.32.74.53, 216.32.74.55, 216.32.74.50 216.32.74.51 Aliases: www.yahoo.com -- Joseph Shraibman [EMAIL PROTECTED] Increase signal to noise ratio. http://www.targabot.com -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: Hot Spot crashes
Vote for: http://developer.java.sun.com/developer/bugParade/bugs/4372197.html Jochen Witte wrote: > > Hello everybody, > we`re using the j2sdk-1.3.0-FCS with Resin 1.1.5 (Java-Servlet-Engine) > and Apache 1.3.14 on a SuSE7.0-Machine. > Under higher load, the Servlet Engine reports: > > # HotSpot Virtual Machine Error, Internal Error > > After that, the whole engine restarts, which causes long accesstimes to > our webserver. > > Is this a "real" Hotspot-Problem or is it a problem of our > servlet-engine? > > Anybody ideas? > -- > Jochen Witte > <[EMAIL PROTECTED]> > > -- > To UNSUBSCRIBE, email to [EMAIL PROTECTED] > with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED] -- Joseph Shraibman [EMAIL PROTECTED] Increase signal to noise ratio. http://www.targabot.com -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]