this code is the netduino code
INTERFACE = NetworkInterface.GetAllNetworkInterfaces()[0]; INTERFACE.EnableStaticIP("192.168.15.5", "255.255.255.0", "192.168.15.1"); END_POINT = new IPEndPoint(IPAddress.Parse("192.168.15.5"), 90); Thread.Sleep(5000); ledpin.Write(true); SOCK = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); SOCK.Bind(END_POINT); SOCK.Listen(1); byte[] s=UTF8Encoding.UTF8.GetBytes("nart schinackow"); while (true) { ACCP_SOCK = SOCK.Accept(); for (byte i = 0; i < 10; i++) ACCP_SOCK.Send(s); ACCP_SOCK.Close(); }
this code is the pc code
private void button1_Click(object sender, EventArgs e) { Socket sock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); sock.Connect(new IPEndPoint(IPAddress.Parse("192.168.15.5"), 90)); byte[] r = new byte[100]; for (int i = 0; i < 10; i++) { sock.Receive(r); } sock.Close(); }
each time i press the button on the windows application code it keeps giving me this exception on the netduino application:
#### Exception System.Net.Sockets.SocketException - CLR_E_FAIL (1) ####
#### Message:
#### Microsoft.SPOT.Net.SocketNative::send [IP: 0000] ####
#### System.Net.Sockets.Socket::Send [IP: 0018] ####
#### System.Net.Sockets.Socket::Send [IP: 0010] ####
#### TestNetduino.Program::ConfigureSockets [IP: 003d] ####
#### TestNetduino.Program::Main [IP: 0008] ####
#### SocketException ErrorCode = 10055
#### SocketException ErrorCode = 10055
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in Microsoft.SPOT.Net.dll
#### SocketException ErrorCode = 10055
An unhandled exception of type 'System.Net.Sockets.SocketException' occurred in Microsoft.SPOT.Net.dll
thought trying same example between two windows application no problems happned why is that ?