[Mono-list] TCPClient not normal bevaiour
Alan McGovern
alan.mcgovern at gmail.com
Tue Dec 4 16:07:53 EST 2007
Attach a compilable testcase so the behavior can be checked. That'll make it
easier to spot the issue. The only thing i'd say is that the way you've
created the streamwriter is probably the most bizarre way i've ever seen.
It's identical to this:
StreamWriter writer = new StreamWriter(socket.GetStream());
except you're creating two additional streamwriters for some unknown reason.
The additional bytes could be a byte order mark. What happens if you do a
.Receive() in c#, do you get just the 5 bytes?
Alan.
On Dec 4, 2007 12:27 PM, Phillip N. <pneumann at gmail.com> wrote:
> Dear mono's..
>
> Im using a simple tcpclient as follows:
>
> TcpClient socket = new TcpClient(host, 5038);
> StreamWriter writer = new StreamWriter(
> new StreamWriter(socket.GetStream(), Encoding.Default).BaseStream,
> new StreamWriter(socket.GetStream(), Encoding.Default).Encoding
> );
>
> writer.Write("GET /");
> writer.Flush();
>
>
> im throwing the request to 'socat' to see whats flying around, and see
> the folowing output:
>
>
>
> > 2007/12/04 12:08:46.497805 length=3 from=0 to=2
> ...> 2007/12/04 12:08:46.500647 length=5 from=3 to=7
> GET /
>
>
> Wich are two requests, one 3 bytes, and the other 5 bytes long. the last
> one if correct, but the first one, i dont know where/why is it comming
> from.
>
> What do you think could be the problem?
>
> This happends just on this particular mashine, wich is a FreeBSD/i386
> one. (mono 1.2.5.1)
> It does work fine on windows, linux and freebsd/amd64.
>
> For testing i had mono 1.2.6 installed in here, but wiped it out
> completly, i see nothong laying around for 1.2.6. Just see 1.2.5.1 bits.
>
> Any information about what could couse this, would be helpful
>
> thanks!
>
>
> --
> Phillip N. <pneumann at gmail.com>
>
> _______________________________________________
> Mono-list maillist - Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20071204/a7a79901/attachment.html
More information about the Mono-list
mailing list