Re: More questions from a newbie
On Thu, 31 Dec 1998, [EMAIL PROTECTED] wrote: >I know I should RTFM but there are so many FMs to read :} >so here are the questions that would make these java posts more >understandable > >what is SWING? Pure java GUI. It is *not* platform dependent. Just download Swing and use it on Linux or w95/8. It provides some very useful enhancements at the expense of speed. Java AWT apps run ok on a P75 but if you use swing you need at least a P166 - IMHO and assuming you are using intel hardware!. >what is lesstiff (i understand its a linux(3) command but what does it do, Cheesh!! tricky one! Unlike micro$oft stuff, GNU/Liinux is built layer by layer by people who take pride in what they are doing -and used by people who appreciate what has been done for them - XFree86 is the layer which allows programmes to display themselves in a window on a graphics screen, but it doesn't define any of the normal windows furniture such as buttons, scroll bars etc. If you were to write an x application you would need to either code all this stuff up - which is probably crazy -or use some preexisting library. Metrolink Motif is a well used UN*X libray to do this sort of stuff, but it is a commercial product.. You can use Motif provided you have paid for the product and distribute statically linked binaries to anyone. Alternatively, you can distribute dynamically linked binaries or the source code to anyone who already owns Motif. Lesstif is an attemp to do everyting that Motif does, but for free. As far as I am aware the Blackdown JDK is developed using the Motif Libraries and distributed as statically linked binaries. I understand there may be attempts to port the JDK using Lesstif. >Why does every other post talk about it. Who knows? OK -- It's to do with the principles of free software on which Linux is being built. Lesstif is free - under the terms of the GNU general public license - (don't quote me on that), but Motif is commerical and Java itself is ???... sort of free. Free as in free speech not free beer. - or as they call it nowadays, Open Source. >What is the diffrence between java 1.1.7 and 1.2 Just the next release of Java really - but - It includes Swing and some other stuff as standard rather than as an add-on as with jdk1.1. However, Sun have decided that java 1.2 is now called java 2, which must really piss off book publishers, my local bookshop is full of books about java 1.2. Oops!! >I intend to write some kind of z80 emulator in java, Any ways of doing this >properly. Cool! I have a Sinclair ZX81 stashed away in the cupboard somewhere, will I still be able to write machine code into line zero :-> >how do you start thinking in Objects and not functions and variables. Use the force Luke --** Nah - I started with Java a year ago when the books I was reading about it all were advising about how to migrate from C, C++, but I had only experience in Visual Basic. It was a steep learning curve but well worth it. -- coming soon - WhiteStar -Java Choropleth Mapping Application >Which is the quickest way to get java certified, is it easy? Just say no - to sanity... >Do people program in Java for the love of Java or for the money, or for the >love of money? For the love of coding, what else do you need? >Whats the meaning of life? 42 > >Regards >Mo -- Hope you don't mind this overblown reply, but it's only 3 hours past new year in my part of the world and I'm sad enough to be replying to a post on this list. Oh well - here's to the millenium bug Tony Atkin [EMAIL PROTECTED] - Overdrawn? But I still have cheques left!
Sun's Commitment to Port JDK 1.2 to Linux
I was excited to hear about Sun's commitment to porting JDK 1.2 to Linux (see http://www.javasoft.com/pr/1998/11/pr981102-01.html) and as new subscriber to this list, I'd be interested in reading any thread discussions that have already taken place on this topic. I'm especiallly curious about when this is likely to happen, and how this changes anything for the Blackdown Java-Linux porting project, if it does at all. If this is an old thread, can anybody tell me how to request an archive from this list server? If not, anybody care to comment now? Thanks, Tony -- Tony Pujals Mail: ObjectMedia, Inc. 1400 Coleman Avenue, Ste. A21 Santa Clara, CA 95050 Tel:(408) 235-8700 x101 Fax:(408) 235-8774 Email: [EMAIL PROTECTED] Web:http://www.objectmedia.com Unite for Java - Join the Java Lobby Now! http://www.javalobby.org "It don't mean a thing if it ain't got that that Swing"
Re: Sun's Commitment to Port JDK 1.2 to Linux
>There are actual engineers @ Sun who are writing code. We'd be nowhere near as >far along as we are without their help. > >It is my belief that the Linux port will be advertized along with the other >licensees ports on Sun's Java ports page. > >Steve > Awesome! Tony -- Tony Pujals Mail: ObjectMedia, Inc. 1400 Coleman Avenue, Ste. A21 Santa Clara, CA 95050 Tel:(408) 235-8700 x101 Fax:(408) 235-8774 Email: [EMAIL PROTECTED] Web:http://www.objectmedia.com Unite for Java - Join the Java Lobby Now! http://www.javalobby.org "It don't mean a thing if it ain't got that that Swing"
Re: Improving Java/Linux support
I have to admit feeling excited but anxious about the 1.2 port. I'm forced to do my development under Windows right now because 1.2 isn't yet available for Linux. The lack of visibility on the porting process makes it easy to forget that the people doing the port are working very hard and not getting paid. But I suppose it would be nice to see the status updated periodically (realizing, of course, that this entails additional work). The lack of information is amazingly demoralizing. Also, if the Intel version is already ready (as the status message on the web site seems to imply--or rather, seemed to; I can't find it now), it would be nice to check it out, even if it's just alpha or beta at this point. In any case, you guys will be heroes when you release it. I'm really looking forward to it. Keep up the good work! Tony Nelson Minar wrote: > >Judging from the volume of "when will 1.2 be ready?" messages, it's > >clear that interest in the Blackdown work is reaching some sort of > >critical mass. > > With 1.1.7, Linux is either the best or second best Unix platform for > running Java. Solaris is obviously alright, but most of the other Java > ports (SGI, Digital Unix, etc) have really bad problems. The Blackdown > team has produced quality. Combine that with the general interest in > Linux and you can see why Java on Linux is so desired. Heck, we even > had one of Sun's big distributed Java gurus asking us when 1.2 would > be ported for Linux :-) > > >Perhaps when the dust settles from the 1.2 port, it might be possible > >to arrange more formal and detailed visibility into what work is > >being done, what's under consideration, what's of interest, and progress. > > I'd like to see more information about the porting process myself, but > that's asking the porting team to do even *more* work. The old rules > for Java made doing a Linux-style port awkward; things had to be > discussed in secret, code couldn't be released, etc. What's the impact > of the new community source licensing? Maybe we can open up the > porting process some? I haven't reviewed the licenses well enough. > > A second thing to watch is the growth of Japhar and Classpath. My > impression is that this code is quality, that we might soon see a > truly viable open source Java. Of course, I said that about Kaffe too, > but that's never quite come to fruition. > > Another interesting option is to see if we can get financial support > for the Linux porters. I was sort of hoping Sun would do this, by > donating some engineers' time, but maybe that's not come together. > Maybe some of the companies relying on Java/Linux could be convinced > to chip in some money? That would again put more responsibility on the > part of the porters, but in this case with a reward for doing it. > > [EMAIL PROTECTED] > . . . .. . . . http://www.media.mit.edu/~nelson/ -- --- Tony Pujals ObjectMedia, Inc. Tel:(408) 255-2700 x101 Fax:(408) 255-5553 Email: [EMAIL PROTECTED] Web:http://www.objectmedia.com Unite for Java - Join the Java Lobby Now! http://www.javalobby.org "It don't mean a thing if it ain't got that that Swing"
Re: Improving Java/Linux support
At 06:09 PM 2/12/99 +, you wrote: >Am I the only person on this list who *doesn't* want to help finish the port? >:-) Nope, me neither! There aren't enough hours in the day or enough days in the week. . . . My hat's off to the guys who are doing it, though -- they deserve a lot of credit! Tony -- Tony Pujals ObjectMedia, Inc. Tel:(408) 255-2700x101 Fax:(408) 255-5553 Email: [EMAIL PROTECTED] Web:http://www.objectmedia.com Unite for Java - Join the Java Lobby Now! http://www.javalobby.org "It don't mean a thing if it ain't got that that Swing"
JDK 1.2 Snapshots???
Not long ago (not much more than a week ago), the web site had some information about the 1.2 port. Where did it go? If I recall correctly, it indicated that 1.2 was successfully running on Intel, but still needed testing. Is there something about the license with Sun that restricts us from being able to check out a current snapshot? I understand that the port may not be ready for prime time, but I'm sure I'm not the only one who urgently needs to get my hands on it... Outside of Sun explicitly forbidding it, I can't see any real good reasons for not letting people access what's been done by the porting team so far. (If this issue has already been discussed, then I apologize in advance for not researching the archives.) Sincerely, Tony ------ Tony Pujals ObjectMedia, Inc. Tel:(408) 255-2700x101 Fax:(408) 255-5553 Email: [EMAIL PROTECTED] Web:http://www.objectmedia.com Unite for Java - Join the Java Lobby Now! http://www.javalobby.org "It don't mean a thing if it ain't got that that Swing"
Re: JDK 1.2 Snapshots???
Ouch! ;-) (But I'd still like to know what happened to the web site information?) Tony At 10:14 AM 2/16/99 +, you wrote: >Tony Pujals wrote: > >> Not long ago (not much more than a week ago), the web site had some >> information about the 1.2 port. Where did it go?... >> >> (If this issue has already been discussed, then I apologize in advance for >> not researching the archives.) > >The issue has been discussed extensively... see the archives. Cardinal rule #1 >of laziness: if you're going to be lazy, it's wiser to pretend ignorance >than to >advertise it :-). > >Nathan > >- >This message was sent using Endymion MailMan. >http://www.endymion.com/products/mailman/ > > -- Tony Pujals ObjectMedia, Inc. Tel:(408) 255-2700x101 Fax:(408) 255-5553 Email: [EMAIL PROTECTED] Web:http://www.objectmedia.com Unite for Java - Join the Java Lobby Now! http://www.javalobby.org "It don't mean a thing if it ain't got that that Swing"
Re: Status pages
Thomas Down wrote: > > I haven't seen this mentioned on the list yet so... > > There are some details about how the Java 2 port is getting on with > passing the JCK online at: > > http://www.blackdown.org/java-linux/jck-status.html > > This is just the information we want to see---many thanks to everyone in > the porting team. On a positive note, it looks like the ia32 port may > not be too far off passing the non-interactive stage of the JCK. > > Thanks again, > > Thomas > Well, it's about time! ;-) The page is a very welcome additon to the site (though it's a real crying shame to hear that the port has been running well since November, but nobody can take it for a test drive...). Tony begin: vcard fn: Tony Pujals n: Pujals;Tony org:ObjectMedia, Inc. adr:18661 Pring Court;;;Cupertino;CA;95014;USA email;internet: [EMAIL PROTECTED] tel;work: 408-255-2700 x101 tel;fax:408-255-5553 x-mozilla-cpt: ;0 x-mozilla-html: TRUE version:2.1 end:vcard
diffs
Is there an ETA for diffs? I want to get this running on FreeBSD ASAP. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Native threads delima
Well folks its like this. I have SuSE 5.3, kernel 2.0.35, /lib/libc.so.5.4.46, and jdk 1.1.7 with green threads . I have not upgraded to 1.2 because of glibc (yea I know I need to make the leap). Now I tried the native methods examples for the jni 1.1 model and can do most direct calls to C code. I can even call Java code while in a thread spawned from Java. Yet when I try to do a callback from a thread spawned by an event in the C side of things it just aint talkin folks. I did the Dejanews and looked in the archives and still didn't find anything concrete but I suspect I need native threads (are these the dreaded OSF/POSIX pthreads? Yuck, I still have nightmares about non threadsafe libraries on HPUX). Now this poses a question. How does AWT do callbacks from the Motif code? Could they be using the 1.0 native interface? So I tried it after I dusted off my copy of first edition Java Tutorial and low and behold what I could not get to work in jni 1.1 works just fine in 1.0 style jni. Well I thought the 1.0 model seems more OOP because you deal with the objects (OK encapsulation is toast), the interface is less obfuscated to these tired C/C++/Java coding eyes, but it looks Muy Pelegroso (Very Dangerous). As a current Java developer I had to perform a couple of old religious rituals like open my old 1978 copy of K&R (without further damaging it), chant the entire section on pointers, and key in the original HelloWorld.c to prepare myself for this journey. I briefly considered calling my Sensei to discuss this journey into the art of C but figured she'd just call the cops (she doesn't hack code). Then I hacked the callback code using the jni 1.0 technique and it worked first try (sort of). My only concern is if the 1.0 model will be going away soon. Don't want to invest too much in stuff that is not likely to be around next year. Yet I want it to work as well on green threads as native threads. So, how does the AWT do it? -- Tony Dean Linux: The choice of a GNU Generation! -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
JNI 1.0 or 1.1 ?
Well folks, I tried to use the JNI from 1.1 was was unable to get callbacks to work using: JDK 1.1.7 libc 5 So, I thought, there has to be a way to do this. What in the JDK uses callbacks? It occurs to me that some networking may but the AWT has to do this. I did the dejanews thing and I followed the thread in here but I was never able to get callbacks to work. Next I dusted off my first edition of Java Tutorial and saw the 1.0 JDK based JNI model and so I tried some experiments. Yesss! The 1.0 model did callbacks just fine. Does anyone want to comment on how the JDK implements callbacks for Java features that use callbacks? Is it JDK 1.0 or 1.1? Will the JDK 1.0 model for JNI continue to be around for a while? -- Tony Dean Linux: The choice of a GNU Generation!
Re: Java IDE
Matthias, I never found any IDE anywhere that I ever liked. After converting to Unix in the 80s, I would always have to take a vi back to dos/windoze. The tools on any decent Unix blow away any IDE I ever saw. This is probably why IDEs never caught on in Unix. Its not as if IDEs don't exist, just nobody uses them. Unix as a development environment is difficult to learn but I've yet to see its equal when it comes to comparing the functionality of its vast array of tools. For Java and most stuff these days I tend to use XEmacs and have it acting like an IDE but with a truely full featured editor. I've used VAJava every working day for the last 18 months and there is absolutely no incentive to load it on my personal development box. I am putting it on my Linux box at work so I can get out of the NT loop. VA was the last tool I needed so I can reformat the rest of the drive :-) need the space ya know. For what its worth. I'd recommend the tools that come with most Unix systems over any IDE because clumping a bunch of lame tools together does not make a more powerful environment. Of course I have had the luxury of working in a Unix shop where we had our own toolsmith to build us a Modular Development Environment (MDE ) based on traditional Unix tools all talking together with tooltalk. So, I admit it, I'm spoiled. You will be too once you get comfortable with the Unix tools, they're hard to learn but easy to use. Alex Rice wrote: On Tue, 29 Jun 1999 23:37:26 +0200, Matthias Carlsson <[EMAIL PROTECTED]> said: Matthias> I'm having problem finding a Java IDE for Linux I like, and I Matthias> thought I should give it a try and ask here. What is everyone Matthias> here using to develop their classes in Linux? I'm used to KAWA Matthias> for Win32, but now after switching to Linux I've been unable Matthias> to find a good replacement. Matthias> I would appreciate any recommendations I could get. You might want to check out Visual Age for Java from IBM. They have a beta for Linux. Alex Rice | [EMAIL PROTECTED] | http://www.swcp.com/~alrice Current Location: N. Rio Grande Bioregion, Southwestern USA -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED] -- Tony Dean Linux: The choice of a GNU Generation!
Re: Linux Desktop based on JDK 1.2
Cliff Baeseman wrote: I do not know if anyone is interested in this yet but here goes. I am not happy with the GNOME or the KDE desktops Havn't tried Gnome yet but I understand that it is window manager neutral. I have used CDE extensively and don't care much for KDE. Put KDE on my machine and my wifes machine. Mine is back to FVWM2 (Motif L&F) with GoodStuff (FvwmButtons) and I like it real well. I use the virtual desktop feature and there is nothing I find I need beyond the fvwm2 environment with several years of my own hacks. so I have started building a desktop on top of a minimal RH 6.0installation. What is the minimal RH 6.0 in this context? Are you doing without X somehow? I am interested in your architecture, as this sounds interesting from a technical standpoint. I have similar issues with Java and am curious as to where you are going. AWT is too limited and Swing is slow and ignores your look and feel customizations. Maybe you have something better? I am using JBuilder3 on windows to code the desktop. This is working out very well and JBuilder already gave me 50 percent of what I needed to build the system. I am using pre v-2 blackdown JDK and am having a bunch of fun doing this. The desktop will talk to the linux bottom end via a api socket server written in C++. Anyone else interested? Cliff Baeseman[EMAIL PROTECTED] Well, I'm curious. -- Tony Dean Linux: The choice of a GNU Generation!
Re: Linux Desktop based on JDK 1.2
Cliff, When I hear Desktop I think of my whole fvwm2 environment. Pop up one of three menus anywhere on the desktop at the click of a mouse button. A nice toolbar with things I need often. How about virtual desktops? I cannot think of working with less then 6 but I usually take the default of 16 and actively use 8 or 9. Cliff Baeseman wrote: The speed is not that big a issue. I am running a desktop written in jbuilder on linux rh6.0 P90 32 meg of ram my test machine It is just as fast as gnome or even a little faster. What do you plan to put in your desktop? I like the things I mentioned earlier. I hate Start buttons that you have to chase to some location on the screen all the time. I like flexibility and configurability and I already tried and abandoned KDE. The thing is the desktop does not even do that much work the apps do all of the work. The desktop just looks cool and launches and configures apps. Is this just a file manager or is there more to it than that? Will it have its own system for launching its own flavor of application. If so I vote for desklets (TM) and want credit for the term :-) Have you hammered these kinds of ideas into some sort of loose architecture document. Even loose notes would be interesting to see. Any screen shots to be available soon? A very small job for the desktop. BTW how can I launch a applet in a frame window. ? Dunno, but something like the appletviewer comes to mind. -- Tony Dean Linux: The choice of a GNU Generation!
Re: favorite code beautifiers?
Hi! I'm usually a vi kind of guy but I find that the auto indent and Java support features available for XEmacs work fine for me. > Any suggestions for nice code beautifiers (for java)? Beautifiers > written in java would, of course, be preferred, but as long as it runs > under linux (C/C++/whatever)... > > Our use is as a documentation tool, so it is not critical that the > output be compilable (e.g. colors, faces, fonts are ok, as long as > such features are configurable). With the functionality in XEmacs you ought to be able to get any output formatting you want. -- Tony Dean Linux: The choice of a GNU Generation!
Re: rh6 and linux solved
Alex, Aint that just the way it goes. I suspect we've all forgotten most of our earliest hurdles because the ones that came immediately thereafter were real bears :-) Never mind, they will see the bats soon enough "Alex M." wrote: On Wed, 7 Jul 1999, steve patient wrote: > know where the jar files are. I wish someone had told me earlier about jar > files. It sort of explains why I couldn't find so many of the files Oh... well... we thought everyone knew about those. :P :) Seriously though, I have that annoying problem of always looking for the most complicated problems first. :) That and jdk1.2 doesn't require you set the classpath, which is nice. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED] -- Tony Dean Linux: The choice of a GNU Generation!
text will not print in an applet
Using jdk1.2 pre_v2
I have a simple applet
import java.awt.*;
import java.applet.Applet;
import java.awt.event.*;
public class FirstEvent extends Applet
implements AdjustmentListener {
private Scrollbar slider;
private int sliderValue = 0;
public void init() {
slider = new Scrollbar(Scrollbar.HORIZONTAL ,0, 1, 0, 100);
add(slider);
slider.addAdjustmentListener(this);
}
public void paint(Graphics g) {
g.drawString("Current value is " + sliderValue, 100,100);
}
public void adjustmentValueChanged(AdjustmentEvent e) {
sliderValue = slider.getValue();
repaint();
}
}
and here for the record is the html file.
First Event applet
When I run this applet, I get some messages about missing dingbat fonts, but
the applet still displays and runs without any problems.
I went to the bug page and downloaded and installed the URW fonts, Now when
I run the applet, the messages about dingbat fonts have disappeared, but the
applet will not display text at all.
Any ideas ?
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: Sun/Inprise/GPL Linux JDK
Nelson, There are a number of possible scenarios that your comments could blossom into. Nelson Minar wrote: There are deeper problems lurking underneath, though, having to do with Sun's control of Java. Sun isn't interested in the ultimate goals of free software, and they're powerful enough to cause a lot of trouble with Java. We play a dangerous game in the free software world, using Java, hoping that we can trust Sun enough to not really screw people the way Microsoft has with their control of the Win32 API. The commercial world is playing the same game, too, and it's the root of so many of the schisms in the Java world. Here are some ideas: 1) Sun owns the Java trademark. They have published the VM spec and the language spec. They permit rogue ports from the specs. Idea: Maybe its time for another rogue port in open source form. This one should shoot for 1.3 from the git-go. 2) Another rogue port could be worked in under the Blackdown umbrella. I suspect that the Sun agreement prohibits the actual transmission of knowledge from the people who are the porters that have done so much for us so far. Idea: Couldn't the existing porters be instrumental in validating and ratifying a "Clean Room" rogue port of 1.3? 3) I used to set on a standards committee for telecom stuff. We were going to move our stuff into one of the standards bodies for standardization and I believe that occurred after I got a different job. Idea: There is no reason Sun has to be involved in the standardization of Java. Oops, I guess it would not be called Java it would be called something else but like ANSI C (XJ311 wasn't it?) once the standard is defined everyone will support the official standard. The product would have a note that says XK682 (or similar name) compliant. That's why I'm glad to see a big player like IBM also enter into the Java/Linux fray. The current ports are bound by Sun's lciense just like the rest, but IBM has enough muscle to push back if need be. 4) I think IBM understands that the fast growing Linux community is the perfect audience for their AIX products. After all Unix to Unix is far easier between the differences from one Unix to another versus the Unix to NT nightmare. When we (Linux users) need some heavy Iron those high end IBM RS6000/SP boxes rock and IBM wants the Linux community to think of them first. Idea: While IBM is trying to actually woo the Linux crowd Sun appears to be trying to tick us all off! Now who is more likely to sell big boxes to Linux users when we need them? IBM knows -- Tony Dean Linux: The choice of a GNU Generation!
Re: Sun/Inprise/GPL Linux JDK
Nathan, It is a bit daunting and possibly impossible as there is enough gray area in the spec as to implement a language that is not capable of passing the Java validation suite of tests and that is the only thing I can think of that could be used to verify the user has implemented the spec. (hmmm... a bit circular). Kaffe is a clean room implementation to the spec but they have expanded the language in some interesting ways. I seem to recall they used the MS alternative to JNI but maybe they put in JNI as well. From a recent read of Kaffe I got the impression that they stopped at 1.1.1 and did not know if they were headed for 1.2 or 1.3. Of course once we enter the standards process we can do anything from start with a clean sheet of paper up to (more or less) Java. I presented a paper on using JNI with Linux at the Atlanta Linux Showcase and the feedback ran from one guy telling me this was exactly what he needed to someone else wanting to rewrite the entire Java class library with JNI and opensource. A replacement library that relied on opensource would be a good place to start and I even had a publisher interested in a book along those lines. What next? Well I guess I'll start making some calls and get back to those who are interested and start a splinter group. Nathan Meyers wrote: Tony Dean wrote: > 1) Sun owns the Java trademark. They have published the VM spec and > the language spec. They permit rogue ports from the specs. There is already an excellent "rogue port" in the Kaffe project, although "cleanroom implementation" is a better term. Interestingly, even the spec carries some scary language... check out paragraph 6 of the copyright from the JVM spec, about the license to "practice this specification": http://java.sun.com/docs/books/vmspec/2nd-edition/html/Copyright.doc.html#997057 Nathan -- Tony Dean Linux: The choice of a GNU Generation!
Re: Sun/Inprise/GPL Linux JDK
Jim, There is such an organization. Its called the Opensource movement. You only have to look as far as Linux to see the potential. Linux is more stable and generally performs better than Win NT and there is plenty of resources behind NT. look at Perl and gcc/g++ to see what can happen. The Opensource movement has more resources behind it than even the giants like IBM and AT&T. [EMAIL PROTECTED] wrote: > ... > But there's an awful lot of evidence that > mounting a serious Java environment effort is not really possible > without the financial resources to feed and clothe a small army of > full-time developers. > > Nathan If only there were a Linux organization/corporation with those kind of financial resources... Jim -- = Jim Kimball [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED] -- Tony Dean Linux: The choice of a GNU Generation!
Re: Sun/Inprise/GPL Linux JDK
Dimitrios, Dimitrios Vyzovitis wrote: Tony Dean wrote: > I presented a paper on using JNI with Linux at the Atlanta Linux > Showcase and the feedback > ran from one guy telling me this was exactly what he needed to someone > else wanting to > rewrite the entire Java class library with JNI and opensource. A > replacement library that > relied on opensource would be a good place to start and I even had a > publisher interested in > a book along those lines. > > What next? Well I guess I'll start making some calls and get back to > those who are > interested and start a splinter group. classpath and japhar are pretty good alternatives and should not be neglected. Perhaps some effort should be put in generalizing the open source java initiative, that could eventyally take control away from sun. Classpath is probably the library you are looking for. This is exactly what I'm interested in. These efforts may only need to be reinvirorated. Btw, sun has dropped the standarization effort (I tried to post this earlier, but somehow it didn't make it to the list): I saw this on Slashdot already and this is why I was pointing out that a standards effort could be effected outside the control of Sun. -- Tony Dean Linux: The choice of a GNU Generation!
Re: Communication with Linux community
I would start with the major archive sites. The MIT site is still around at ftp://tsx-11.mit.edu/pub/linux/ and its been there for years. The other major US archive site is http://metalab.unc.edu which used to be sunsite.unc.edu. This is also an old site that is often the source for people who want to start making distributions of their own. Look into their archive link. They have readme and getting started how-to documents. Others in the group may want to look at the Java area. Jacob Nikom wrote: > > Hi, > > My question is little off the usual java-linux topics and relates > to the activity in Linux community. > > My company thinks about donating some of their applications to the > Linux community. Where I can look how to do it, whom to communicate > with and how it is usually happens? > > Thank you, > > Jacob Nikom > > -- > 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: Tomcat + EJB ?
Mohd, Tomcat supports Servlets and JSP. For EJB you need something a bit bigger. You may want to look at Enhydra. Mohd Mokhtar wrote: > > Does Tomcat suppport EJB ? I could not found any word in Tomcat > documentation saying it have EJB capabilities. > > Anybody have ideas ? > > --= ahYeop =-- > > -- > 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, 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: JRE as part of Linux
Sounds what we need is the old UNIX sticky bit put back into Linux. The sticky bit was a file attribute that told the Kernel that the application should stay in cached for some period of time after it was initially loaded. Way back when, UNIX did this and things that got hit a lot like editors (vi, sed, etc) would stay cached in memory. Someting like this could keep the JVM cached after it was initially started. The initial startup could be something as simple as putting it in your .profile, .login, or .bashrc with the instruction to print the version upon initial login. I'll drop in on one of the Kernel lists this week and see if there is any interest. Regards Tony Dean noisebrain wrote: > > > What is really needed is a pre-started jvm. When you start up a java > > process, the jvm will fork, and the child will su to you and proceed as > > normal. I don't know exactly what the jvm is doing when it is taking > > all that time starting up so I don't know how useful this would be. > > I like this solution, though I don't see the details. > My guess is that part of the startup time is just that java > has to uncompress the classes zip file, which is big. The > scheme above would avoid the uncompress. > > -- > 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: Choosing open source app server for linux
Kevin, I've worked a bit with Enhydra. Seems nice and supports most Java stuff. If I may utter a minor blasphemy in this list server I recently put up a collaborative site in 10 working days (across 5 weeks) with a product called Zope (www.zope.org) it is not Java based though. It is written in Python and uses Python and its own scripting. While I was a Java developer for the four years leading up to about a year ago (and occasionally still use Java) one always has to look at the problem space and select tools based on the need. Regards Tony Dean kevin1 wrote: > > Hello all, > First, I have no budget for this... :) > Having said that - I need to come up with an app server that handles message > driven beans and is open source, and is enterprise capable (we're expecting > massive traffic) . I have narrowed things down to Enhydra or Jboss. We run a > clustered solution here, and that must be factored into the decisions - Java is > not popular here ( superstition ) and I have to have this working soon. Which > app server should I go with? Enhydra or Jboss? Any suggestions? Please help. > > Thanks in advance > > -- > 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: Linux Java IDEs
Chris, I tend to agree. Unix in general is a developers environment. The old DOS environment and Windoze after it are abysmal development environments. It is only reasonable that IDEs came along to fill that void. In any UNIX environment IDEs never really caught on and I suspect that is is due to the fact that a raw Unix environment in the hands of someone who knows it will give superior productivity to "ANY" IDE. I used to be a vi kind of guy. Lately I've been using XEmacs with the Java support. It gives the flexibility of a Unix environment with the handiness of an IDE. The only thing I miss from VA Java ( I used this for a while) was the Debugger. IBM makes a killer debugger but I was happy to let that go to dump the rest of the baggage. later td Chris Kakris wrote: > > Glenn Holmer wrote: > > > > > > definitely worth a look. I haven't gotten very far with it yet, but > > what advice can you guys offer? What IDEs should shops with Linux coders > > consider? > > > > Well I've tried a number of IDEs over the years and I keep going back > to a simple text editor and build utility. At the moment I use vim > (for the syntax highlighting) and Ant. Works on both Windows and Unix. > Some people prefer Emacs and from what I can tell it can be a pretty > awesome development environment: > > >http://www-106.ibm.com/developerworks/java/library/j-emacs/?open&l=302,t=grj,p=Emacs > > Other people use Make instead of Ant but I find Ant easier to use and > it's extensible too. > > I don't know why I keep going back to vim but I guess I have never > found those gui building features helpful and never had luck doing > complete code cycle stuff with them. Besides I almost exclusively > write server side code and not any Swing. Also, I use a Pentium II > 266MHz laptop so it's a little underpowered for most modern IDEs. > > This probably doesn't really help you but I wanted to raise my hand > and say that there are people how are very productive even without > using one of those bloated IDEs. Oops did I say that? > > -- > Chris Kakris http://www.dynamic.net.au/christos/ > ZDS Services Pty Ltd 414 Gilbert Road, Preston, Victoria 3072, Australia > > -- > 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: IBM PPC 1.4.1 Question
{ > Has anyone been able to get the newly released 1.4.1 development kit from
{ > IBM to work.
{
{ When I last looked at it it wasn't available for ppc - thanks for that.
{
{ > I get core dumps whenever I run it.
According to the IBM ReadMe (sdkguide.lnxia32.htm) of the IBM 1.4.1
JVM for Linux IA32, they have only tested their 1.4.0 JVM on:
SLES 7
SLES 7 64-bit (31-bit compatibility mode)
SuSE 8.0
Red Hat Advanced Server
Red Hat 7.3
Turbolinux 7 Server
http://www-106.ibm.com/developerworks/java/jdk/linux/tested.html
They say nothing about the 1.4.1 JVM.
I think they should update this page and -maybe- the version of their
test machines.
Amicalement/Regards,
Tony Reix
Carpe Diem
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: IBM PPC 1.4.1 Question
Oooops.
I just realized you were talking of IBM JVM 1.4.1 on PPC. not on IA32.
Sorry.
But their information page about IBM Linux JVMs is still not up-to-date ...
Regards,
Tony
{ { > Has anyone been able to get the newly released 1.4.1 development kit from
{ { > IBM to work.
{ {
{ { When I last looked at it it wasn't available for ppc - thanks for that.
{ {
{ { > I get core dumps whenever I run it.
{
{
{ According to the IBM ReadMe (sdkguide.lnxia32.htm) of the IBM 1.4.1
{ JVM for Linux IA32, they have only tested their 1.4.0 JVM on:
{
{ SLES 7
{ SLES 7 64-bit (31-bit compatibility mode)
{ SuSE 8.0
{ Red Hat Advanced Server
{ Red Hat 7.3
{ Turbolinux 7 Server
{
{ http://www-106.ibm.com/developerworks/java/jdk/linux/tested.html
{
{ They say nothing about the 1.4.1 JVM.
{ I think they should update this page and -maybe- the version of their
{ test machines.
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: How to get better performances from a linux plateforme ?
{ On Wed, 2003-06-25 at 08:15, Damien Lecan wrote:
{ > Hello,
{ >
{ > I am trying to get better performances from a linux plateforme and I am
{ > a little bit disappointed.
{ >
{ > I am testing a full J2EE application, ie 3 physical layers
{ > (apache/tomcat <=> jboss <=> oracle db ; 3 servers), and this is very
{ > slow on linux ... compared to the same plateforme on Windows 2000 server
{ > (except for the db, this a HP server for both tests).
{ >
{ > Every servers are equiped with JVM SUN 1.4.1_01 and Linux is RedHat 7.3,
{ > not customized.
{ >
{ > I know I could try other VM, but I am wondering if the problem comes
{ > from the OS or from the VM (on windows, performances are twice better),
{ > or from both ?
{ >
{ > What should I modify on my redhat ? Should I use IBM ou Blackdown VM ?
{ >
{ > Thanks for your help, I really would like to use linux instead of
{ > windows for servers ...
Hi Damien,
Since I've made some comparison between different JVMs and different
machines and O.S., I may provide you with some figures.
First, check that your machines are EXACTLY identical. A bigger
cache leads to much better performances (32K -> 512K cache : ~ +30% perf)
with Java benchmarks.
I've used the following benchmarks:
VolanoMarkhttp://www.volano.com/report/index.html
~ 800 threads
SPECjbb2000 http://www.spec.org/osg/jbb2000/
Very few threads but heavy Java work
On a 2xPentiumIII (1.3 GHz with 512 KB of cache), with RedHat 7.3 :
VolanoMark :
- BEA JRockit 8.1 is ~10Km/s
- Sun 1.4.2 beta is ~17Km/s
- IBM 1.4.0 is ~21Km/s
SPECjbb2000:
- BEA JRockit 8.1 : hang
- Sun 1.4.2 beta is ~20Kops/s
- IBM 1.4.0 is ~22Kops/s
So, since your application should be a mix of many threads and heavy
Java run, you should try IBM JVM (1.4.1 is now available).
That also means: the less threads your JVM is running, the better should
be the performances. How many threads are you running ?
This was done with a Linux kernel 2.4.18 SMP .
Kernel 2.6 should provide better results and you should experiment with it.
Take care that JVM results with mono-CPU linux are often different
from results with multi-CPU. Mainly for BEA JRockit (thinthreads).
I haven't experimented with BlackDown, but -based on Volano Report- it
should not be as good as Sun and IBM JVMs.
When running Sun JVM, the following options led to best results with
VolanoMark :
-server -Xbatch -XXAgressiveHeap
With IBM JVM, no options gave the best results.
NPTL does NOT provide better performances for Java. It only (but
that's VERY valuable) provides MUCH BETTER reliability.
Linux 2.4 is far from being an industrial O.S. for heavy load.
Waiting for 2.6 to see how much progress has been done.
When comparing Linux and AIX on the same hardware (4xPPC, same IBM JVM 1.3.1) :
VolanoMark :
- Linux kernel 2.4 is ~17K
- AIX 5Lis ~30K
That means that Linux 2.4 is far to be as optimized for heavy multi-threading
as old Unix O.S. (like AIX, HP-UX, Solaris) are. I think Windows also
is more optimized than Linux 2.4 .
That may explain (some part of) the difference you saw between Linux and Windows.
Other figures from official SPECjbb2000 results show that Linux SMP on IA32
is much less scalable (88 %) than AIX/PPC (100%) or other O.S. (2xCPU -> 4xCPU).
You should also experiment with JOnAS (ObjectWeb, OpenSource) instead of JBoss.
Regards,
Tony Reix
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: 1.3, kernel 2.6, signals
Hi Nicole,
{ ...
{ I upgraded my kernel to version 2.6, and now it looks like these signals
{ aren't being caught anymore -- sort of.
{ ...
{ I've been using blackdown 1.3.1, but as a test I switched to Sun's
{ 1.3.1_10 and am still having the same problem.
{ ...
{ I assumed the problem is related to NPTL, so I have set the
{ LD_ASSUME_KERNEL variable to both "2.2.5" and "2.4.1" to no avail. I
{ thought perhaps I needed to upgrade my libc6, but I don't know that that
{ is the case. Right now it's running 2.2.5-11.5.
{
{ Any ideas ? I'll try anything at this point, I'd really like to keep my
{ kernel. Even if I just have the answer and decide to stick with 2.4 for
{ now, I'd at least like to know :o)
Sebastien and my-self are involved in improving the stability of NPTL,
and we plan to provide a trace mechanism for NPTL.
So we are very interested in understanding and trying to fix your
problem that seems not to be related to a JVM.
We have been said that some signals are lost by NPTL.
Using old LinuxThreads (LD_ASSUME_KERNEL) did not fix your problem,
probably because LinuxThreads was also known to loose signals ...
Or maybe the problem is in the kernel ...
Would it be possible for you to extract the code that produces the
problem and provide a very small program we could use in our labs
in order to reproduce the problem with our environment (RedHat 9,
last 2.6 kernel version, last NPTL version) ?
Thanks,
Amicalement/Regards,
Tony Reix
Carpe Diem
****
Name: Tony Reix
Company:Bull SA : AIX/Linux R&D
EMail: [EMAIL PROTECTED]
Web-Site: http://www-frec.bull.com
Address:BULL, 1 rue de Provence, BP 208, 38432 Echirolles Cedex, France
Phone 04 76 29 72 67 (France), 33 4 76 29 72 67
Fax:04 76 29 76 00 (France), 33 4 76 29 76 00
Bull Phone: 229-7267
Bull Address: FREC B1-204 Office: B1-183
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: 1.3, kernel 2.6, signals
Hi Nicole,
{ ...
{ I will be constructing a basic application that just does the signal
{ handling similar to my application so I can use it to test.
Seems your problem is not easy to understand ...
Let us know when you have built such a basic application. At that
time we'll try to reproduce it there, probably with the Sun or IBM JVMs.
Did you try with IBM JVM ?
Thanks for helping stabilizing NPTL.
Amicalement/Regards,
Tony Reix
Carpe Diem
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
problem with jre1.1 on linux 6.x
Hi All, I am very new to this list. This is my maiden question to you all. My problem is I got the following error when I ran jre1.1 on redhat linux 6.1. ./jre1.1/bin/i686/green_threads/jre: error in loading shared libraries: > ./jre1.1/lib/i686/green_threads/libdl.so.2: undefined symbol: > _dl_default_scope Can any one explain why this is happening? Any solution for this? This happens only with jre1.1.6 and not jre117_v3 or jre1.2. regards Tony Paul ---- Tony Judy Paul, Software Engineer, AdventNet Development Centre (I) Pvt.Ltd, 13A, Kaashyap Enclave, Velacherry Main Road, Velacherry. Chennai-600042 E-mail: [EMAIL PROTECTED] Phone: 2432414-419 -
Re: String manipulation
Hi brEezE,
I am new to this list. I don't know if this
will suffice your requirement. Anyway, Why don't you try StringBuffer class?
You can use it like this,
StringBuffer sb=new StringBuffer();
sb.append("SELECT COF_NAME, ");
sb.append("SALES FROM COFFEES ");
stmt.executeQuery(sb.toString());
Moreover, the "+" sign is actually over loaded in
JAVA. Internally, for every "+" a string buffer is instantiated and
does what I have shown above. So using string buffer would be more efficient.
regards
Tony P.
brEezE wrote:
Hi all, I have a dummy question regaring a
double-quoted string written in multiple line.
Here is what I have been doing:
stmt.executeQuery( "SELECT COF_NAME, " +
"SALES FROM COFFEES " );
Is there a way to to eliminate the '+' sign by doing
something like below?
stmt.executeQuery( "SELECT COF_NAME, \
SALES FROM COFFEES " );
I know the code cannot be compiled, but is there any
substitution to the escape character above?
Many thanks in advance.
__
Do You Yahoo!?
Kick off your party with Yahoo! Invites.
http://invites.yahoo.com/
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
-- -
Tony Judy Paul,
Software Engineer,
AdventNet Development Centre (I) Pvt.Ltd,
13A, Kaashyap Enclave,
Velacherry Main Road,
Velacherry.
Chennai-600042
E-mail: [EMAIL PROTECTED]
Phone: 2432414-419
-
Re: EVENT MODEL PROBLEM
r.java:240) at java.awt.Component.processMouseEvent(Component.java:3726) at java.awt.Component.processEvent(Component.java:3546) at java.awt.Container.processEvent(Container.java:1164) at java.awt.Component.dispatchEventImpl(Component.java:2595) at java.awt.Container.dispatchEventImpl(Container.java:1213) at java.awt.Component.dispatchEvent(Component.java:2499) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2451) at java.awt.LightweightDispatcher.trackMouseEnterExit(Container.java:2318) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:2189) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2125) at java.awt.Container.dispatchEventImpl(Container.java:1200) at java.awt.Window.dispatchEventImpl(Window.java:912) at java.awt.Component.dispatchEvent(Component.java:2499) at java.awt.EventQueue.dispatchEvent(EventQueue.java:333) at java.awt.EventDispatchThread.pumpOneEvent(EventDispatchThread.java:103) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) at java.awt.EventDispatchThread.run(EventDispatchThread.java:84) ]0;root@ovelix2: /root/project/v00[root@ovelix2 v00]# exit exit Script done on Thu Jan 18 21:31:55 2001 -- --- Tony J. Paul AdventNet Development Center India (P) Ltd., 13-A, Velachery Main Road Velachery Chennai - 600 042 Ph: +91-044-2432414/2748/2749/3484 Ext : 419 Email :[EMAIL PROTECTED] http://www.adventnet.com --- Programming today is a race between software engineers striving to buildbigger and better idiot-proof programs,and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.--Rich Cook
Re: DatagramSocket and Thread problem (more)
Hi Dustin Lang,
I have edited your code. It is working fine,
except for few changes.
The sender to the same port you are listening to
else you will get a time out error.
Instead of socket.getLocalAddress().getHostAddress()
use InetAddress. getLocalhost(). The former gives 0.0.0.0.
These make the program work successfully.
Regards
TJP.
Dustin Lang wrote:
Hi again,
Further to my previous message. It seems that the sending thread
is also
bothered by the receiving thread. The first send() succeeds,
but once the
receive thread touches the socket, all further send()s fail with
"IOException: Connection refused". This is a DatagramSocket!
I was under
the impression that this exception should never be thrown by
DatagramSocket.send() - packets are just sent off into the big blue
yonder; if nobody is listening on the destination machine, the packet
should just get tossed into the bit bucket.
Any suggestions would be appreciated.
Cheers,
dstn.
-- Dustin Lang, [EMAIL PROTECTED]
--
User, n.: a particularly slow and unreliable input/
output device that is attached by default to
the
standard input and output streams.
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
-- ---
Tony J. Paul
AdventNet Development Center India (P) Ltd.,
13-A, Velachery Main Road
Velachery Chennai - 600 042
Ph: +91-044-2432414/2748/2749/3484 Ext : 419
Email :[EMAIL PROTECTED]
http://www.adventnet.com
---
When you aim for perfection, you discover it's a moving target. -George
Fisher
import java.net.*;
import java.io.*;
class SocketTest implements Runnable {
DatagramSocket socket;
Thread receiver;
static long time;
public SocketTest() throws IOException {
socket = new DatagramSocket(2000,InetAddress.getLocalHost());
socket.setSoTimeout(5000);
output("Datagram socket open on " + InetAddress.getLocalHost()
+ " port " + socket.getLocalPort() + ".");
receiver = new Thread(this, "Receiver");
receiver.start();
}
public void sendPacket() {
try {
byte[] packetData = new byte[1024];
DatagramPacket packet = new DatagramPacket(packetData, packetData.length,
InetAddress.getLocalHost(), 2000);
output("Sending packet...");
socket.send(packet);
output("Sent packet.");
} catch (Exception e) {
output("Send failed: " + e);
}
}
public void run() {
output("Thread started.");
int packetSize = 1024;
byte[] packetData = new byte[packetSize];
DatagramPacket packet = new DatagramPacket(packetData, packetSize);
for (;;) {
output("Receiving packet...");
try {
socket.receive(packet);
} catch (InterruptedIOException ie) {
output("Receive timed out.");
} catch (IOException ioe) {
output("IO Exception: " + ioe);
output("Stack trace:");
output("-");
ioe.printStackTrace();
output("-");
}
try {
Thread.sleep(5000);
} catch (InterruptedException ie) {
}
}
}
static void output(String s) {
System.out.println("[" + Thread.currentThread().getName() + " "
+ ((System.currentTimeMillis()-time)/1000) + "]: " + s);
}
public static void main(String[] args) {
Thread.currentThread().setName("Sender ");
time = System.currentTimeMillis();
try {
SocketTest st = new SocketTest();
for (;;) {
st.sendPacket();
try {
Thread.sleep(7000);
} catch (InterruptedException ie) {
}
}
} catch (IOException ioe) {
output("IO Exception: " + ioe);
ioe.printStackTrace();
}
}
}
