Under VB6 with winsock I spend half a day writing an app that receives a plain old byte array that was mostly text but also had control characters. Under VB.net I've been trying for four days to do the same thing without success.
I stole a client server example from MS Windows Simple Multi-User TCP/IP Client/Server Example sample in VB.NET for Visual Studio 2010 and used the client portion (the server is actually a piece of hardware, nothing I can change). This almost works but it appears the encoding is mangling the stream and I can't figure out how to stop it. I triend encoding.default (example uses acii I think) with no luck.
I also thought why bother with passing strings between the connection class and main app but I really can't figure out how. Why something so simple in VB6 has to be so mind destroyingly difficult in .net is beyond me. I was finally starting to get to like vb.net too.
Can anyone point to an example that uses simple byte arrays or give me a clue as to how to modify this one?
Thanks!
Edit: I should clarify.. The data coming in is 8 bit ascii and looks something like this
<first byte values as a command sequence>
200
15
8
9
<then text>
serial: # 12356
version: 2.83.1
blah blah blah
<final byte value meaning end of message>
5
EOLs are chr(10)
When I get these through vb.net the EOLs are messed up, I end up with data after the chr(5) etc. In VB6 with winsock the message comes in perfect.y
I stole a client server example from MS Windows Simple Multi-User TCP/IP Client/Server Example sample in VB.NET for Visual Studio 2010 and used the client portion (the server is actually a piece of hardware, nothing I can change). This almost works but it appears the encoding is mangling the stream and I can't figure out how to stop it. I triend encoding.default (example uses acii I think) with no luck.
I also thought why bother with passing strings between the connection class and main app but I really can't figure out how. Why something so simple in VB6 has to be so mind destroyingly difficult in .net is beyond me. I was finally starting to get to like vb.net too.
Can anyone point to an example that uses simple byte arrays or give me a clue as to how to modify this one?
Thanks!
Edit: I should clarify.. The data coming in is 8 bit ascii and looks something like this
<first byte values as a command sequence>
200
15
8
9
<then text>
serial: # 12356
version: 2.83.1
blah blah blah
<final byte value meaning end of message>
5
EOLs are chr(10)
When I get these through vb.net the EOLs are messed up, I end up with data after the chr(5) etc. In VB6 with winsock the message comes in perfect.y
Last edited: