I need to send an organized byte array via tcp/udp
Posted on 2006-04-24
I need to send an organized byte array via tcp/udp.
Here is the problem:
Dim sendBytes() As Byte = Encoding.ASCII.GetBytes(Data1.Text & Data2.Text)
This is just a test. But you see how I have to merge the Data1 & Data2 together? Then the server would receive it and I would have to parse them. Instead of doing that is there an organized way to send a byte array in the form of a structure?
Private structure organizedPacket
Dim Data1 as string
Dim Data2 as string
Dim UDPPAcket as new organizedPacket
udppacket.data1 = "hello"
udppacket.data2 = "world"
Examples in VB.NET would be great. Thanks experts.