Hi, I’m trying to send a string from a client to a server over network. But it always gives me EOF and no error. Can someone tell me what I am doing wrong?
While EOF is formally returned as an error, it actually just says that the reader reached the end of the file.
But still, according to the documentation, you should not get an error if the input ends in the delimiter.
If ReadString encounters an error before finding a delimiter, it returns the data read before the error and the error itself (often io.EOF). ReadString returns err != nil if and only if the returned data does not end in delim.
Sorry for being late - that was pretty much the code. But I got told on IRC that using encode to json or gob was a better option and that had worked! I will try flushing after WriteString and see what happens.