VB Battle System Help

VB Battle System Help

Ive never made a p2p style battle system before and Im the type of person i learn by seeing the completed code vs. trial error. The MSDN had something that seemed to be on the right track but im not sure how to code it. The Network button click action is were I think most of this code will take place. When you click on the network button, I want it to popup a box requesting the ip to link to for battle. MSDN suggests this for networking. This is how to send text but I need it to send something else:

SharedSub Connect(ByVal server As[String], ByVal message As[String]

)
Try

' Create a TcpClient.
' Note, for this client to work you need to have a TcpServer
' connected to the same address as specified by the server, port
' combination.
'Changed to port 80 to avoid port forwarding
Dim port AsInt32
= 80

Dim client AsNewTcpClient
(server, port)

' Translate the passed message into ASCII and store it as a Byte array.
Dim data As[Byte]() = System.Text.Encoding
.ASCII.GetBytes(message)

' Get a client stream for reading and writing.
' Stream stream = client.GetStream();
Dim stream AsNetworkStream
= client.GetStream()

' Send the message to the connected TcpServer.
stream.Write(data, 0, data.Length)
Console.WriteLine("Sent: {0}"
, message)
' Receive the TcpServer.response.
' Buffer to store the response bytes.
data =
New[Byte]
(256) {}
' String to store the response ASCII representation.
Dim responseData As[String] = [String]
.Empty

' Read the first batch of the TcpServer response bytes.
Dim bytes AsInt32
= stream.Read(data, 0, data.Length)
responseData = System.Text.
Encoding
.ASCII.GetString(data, 0, bytes)

Console.WriteLine("Received: {0}"
, responseData)
' Close everything.
stream.Close()
client.Close()
Catch e As
ArgumentNullException
Console.WriteLine("ArgumentNullException: {0}"
, e)
Catch e As
SocketException
Console.WriteLine("SocketException: {0}"
, e)
End

Try
Console.WriteLine(ControlChars.Cr + " Press Enter to continue..."
)
Console
.Read()
EndSub'Connect

I need it to connect to the other person and then contenue to update each others health information and military counts etc. until someone dies or retreats. I use a class called "storage" to store all the global information. So basicly we need to make calls to the storage class across the network. I can post more code if someone wants to try to help. Thanks