Thanks, that did the trick. It is frusterating that HF java didn't mention it at all, not even in their code examples. I have two other HF books and are generally fantastic, that I thought getting HF Java to learn a bit more of the language and the new 1.5 stuff was a good idea. So far it has proved to be a poor book, especially the GUI sections. Although it does have some great sections, but is too often frusterating, and I am not a newbie, although obviously not an expert.
So everytime print(), from PrintWriter, using Sockets I need to do this or set autoflush in the constructor? I thought that PrintWriter was not supposed to care, or really know what the underlying stream really is. I use printwriter all the time for writing to files, and have never had this issue.
It seemed like using these higher level IO classes would make life easier, but it turned out that DataInputStream and DataOutputStream is more straight forward, less likely to have problems. Being able to send everything as a string has its charms, but having to flush
alot seems that it is not worth it.
What is your opinion about DataOutputstream vs PrintWriter? Does one have any specific advantages or disadvantages, other then my frusterations already vented here?
Like I said, I am working up to writing a rather complex(at least for me) Chat client/server, with everything you would expect from a chat room and then some. I have most of what I need, other then trying to figure out the insanely convoluted Swing Layouts, and would like your opinion on which IO route I should go, based on the 2 client/server examples. For the most part only integers and strings will be sent back and forth, at least until I am ready to write the autoupdater.
The reason I asked about a C program communicating with a java server, is because I am also working on Simple client/server games that can be started from the java client, but is actually a C/C++ wxwidgets project, and the server I want to write in java since I want to keep everything platform independant, and I think writing a PI server in C would be more hassles then it is worth. No reason for the langauge/GUI library switch other then getting practice doing lots of other stuff.
Maybe these other questions should go into seperate threads, so I apologize if this is a bit much for a single
thread. I realize that these are very general questions, and am not looking for specific answers, just a few basic ideas of yours and/or links to good information.
Thanks again for the help! Both of you.
[ March 30, 2006: Message edited by: Mat Cauthon ]