Hopefully the last post concerning client/server
-
I have gone back to the original synchronous client/server code, however keeping the BeginAccept and EndAccept in order to alleviate the need for a keep alive. I have now run into a final problem being Encoding and streaming. 1) What would be the best Encoding for sending String messages but also files? (Is there 1 encoding that could handle both?) I have had success just opening a file, converting to UTF8, converting back to Default, then writing to another file, but somewhere along the line my client/server code muffles the data. 2) Should I use the socket stream or the socket directly for sending/receiving? Is there any real difference (IE socket.Send(..) streamWriter.Write(..)) Currently I'm using a mixture of both and I don't think that it is good coding. Thanks in advance.