Socket.Connect is broken in RC3 (at least for TCP)
Ugh. I'd only tested UDP and TCP listen. I had not tested a TCP socket.Connect then socket.Send. I can't get it to work either, but only for TCP and Sending... UDP seems to work fine.
Update: It turns out I do have code that does this in one of my apps. And it works fine. I think it doesn't work until after the IP address is obtained by Netduino. I don't really know what to look for to see if the network connection is ready. Here is the actual working code from my app:
using (var s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp) { SendTimeout = 2000 })
{
var entry = Dns.GetHostEntry(host); // DNS lookup
var address = entry.AddressList[0];
var ep = new IPEndPoint(address, 80);
s.Connect(ep);
s.Send(Encoding.UTF8.GetBytes(message));
s.Receive(response);
}
-Valkyrie-MT