c# - Sending and receiving plain text with TCP -
i want send string through tcp connection: tr220,2,a10000xx,3545.1743,5119.5794,001.0,1503,52:56:16,2012/09/13,0,0,0,0,0,v,000,0,0,0,,+989123456789,* i using code send text: string uri = "http://localhost:1414"; string record = "tr220,2,a10000xx,3545.1743,5119.5794,001.0,1503,52:56:16,2012/09/13,0,0,0,0,0,v,000,0,0,0,,+989123456789,*"; httpwebrequest request = (httpwebrequest) webrequest.create(uri); request.method = "post"; byte[] postbytes = getbytes(record); request.contenttype = "text/plain"; request.contentlength = postbytes.length; stream requeststream = request.getrequeststream(); requeststream.write(postbytes, 0, postbytes.length); and getbytes method: private byte[] getbytes(string str) { byte[] bytes = new byte[str.length * sizeof(char)]; system.buffer.blockcopy(str.tochararray(), 0, bytes, 0, bytes.length); return bytes; } after sending request, in other side app, string: post / http/1.1\r\ncontent-type: t...