I'm trying to build a program that uses sockets and connections to connect to the internet. Right now, I use a PrintWriter to send messages out, but I don't like using it? Is there any other alternative to PrintWriter? I don't like the idea of having to flush() when I want the message to send and it seems to lose the connection after i flush() it the first time. Is there any way to stop this or something better to use to send outgoing messages? Thanks for any help in advance.