Java bufferedreader -- how to read carriage return/new line sent over network from C
Basically, I have a server in C that is sending a string of text over the using write. Then I have a client written in Java that is receiving the string and updating the text in a JTextArea. The problem I am having is that when I send the string, all carriage returns or new lines are lost and its just sending it as one long line. Does anyone know how to fix this or a little workaround hack for it?
C server code: Code:
struct meeting newMeet; Code:
InetAddress serverAddress = InetAddress.getByName(host); |
Since Java readLine() does not include the newline in the results, you'll need to add it back yourself:
Code:
text = text + s + "\n"; |
I would suggest the system-specific newline char sequence, but then...
Quote:
|
All times are GMT -5. The time now is 03:22 PM. |