I already know how to send data (image and string) from WP7 to PC.
But my problem its how I send 2 string (2 data)
this code for send 1 data by socket
public string Send(string serverName, int portNumber, string data)
{
string response = "Timeout";
if (socket != null)
{
SocketAsyncEventArgs socketEventArg = new SocketAsyncEventArgs();
socketEventArg.RemoteEndPoint = new DnsEndPoint(serverName, portNumber);
socketEventArg.Completed += new EventHandler<SocketAsyncEventArgs>(delegate(object s, SocketAsyncEventArgs e)
{
response = e.SocketError.ToString();
clientDone.Set();
});
byte[] payload = Encoding.UTF8.GetBytes(data);
socketEventArg.SetBuffer(payload, 0, payload.Length);
clientDone.Reset();
socket.SendToAsync(socketEventArg);
clientDone.WaitOne(TIMEOUT_MILLISECONDS);
}
else
{
response = "not initialized";
}
return response;
}
So what modification can I do?
If you can send 1 string you can send 2 the same way. Just have a delimit the strings and concatenate them together.
You then split them on the other end.