--
You received this message because you are subscribed to the Google Groups "NUnit-Discuss" group.
To post to this group, send email to nunit-...@googlegroups.com.
To unsubscribe from this group, send email to nunit-discus...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nunit-discuss?hl=en.
As far as I can tell, the SocketException is not connected with your
code directly.
It takes place at the point where NUnit is attempting to call the remote
nunit-agent process to stop it. The process has closed the connection for
some reason.
Because all error information is reported across the connecting socket, it may
provide more useful information if you can force nunit-console to run under
.NET 4.0 in the first place. To avoid changing nunit's own config
file, I suggest
you set the COMPLUS_Version environment variable to v.4.21006 before
running nunit-console.
Charlie
If you are not using nunit-agent (because you already run under 4.0) then
you NUnit is not using sockets at all. So you can't have a SocketException. :-)
Glad it helped. We'll continue to work on the underlying problem.
Charlie
I am trying to post data to a server using the SM5100B programmed using Netduino 2 but my code is showing an unhandled sockets exception.
I have appended my code for review just in case. Any help will greatly appreciated.
Thank you.
using System;
using System.IO;
using System.Net;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.Netduino;
using System.Text;
using System.IO.Ports;
namespace Send_SMS
{
public class Program
{
static SerialPort port = null;
static byte[] buffer = null;
static OutputPort led = new OutputPort(Pins.ONBOARD_LED, false);
public static void Main()
{
port = new SerialPort("COM1", 9600, Parity.None, 8, StopBits.One);
port.Handshake = Handshake.None;
port.Open();
port.DataReceived += new SerialDataReceivedEventHandler(port_DataReceived);
buffer = Encoding.UTF8.GetBytes("AT\r");
port.Write(buffer, 0, buffer.Length);
Thread.Sleep(10000);
byte[] buffer2 = Encoding.UTF8.GetBytes("AT+CGATT=1\r");
port.Write(buffer2, 0, buffer2.Length);
Thread.Sleep(10000);
byte[] buffer3 = Encoding.UTF8.GetBytes("AT+CIPSTATUS");
port.Write(buffer3, 0, buffer3.Length);
Thread.Sleep(10000);
byte[] buffer4 = Encoding.UTF8.GetBytes("AT+CIPHEAD=1");
port.Write(buffer4, 0, buffer4.Length);
byte[] buffer5 = Encoding.UTF8.GetBytes("AT+CDNSORIP=1");
port.Write(buffer5, 0, buffer5.Length);
Thread.Sleep(10000);
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://dops.ubunifuauction.com/start.php?");
//bus=1&stage=2&source=3&destination=4&long=0.336401&lat=32.565022 ");
request.Method = "POST";
request.Headers.Add("Content-Type", "text/x-gwt-rpc; charset=utf-8");
string postData = "Test";
byte[] byteArray = Encoding.UTF8.GetBytes(postData);
request.ContentLength = byteArray.Length;
Stream dataStream = request.GetRequestStream();
dataStream.Write(byteArray, 0, byteArray.Length);
dataStream.Close();
/*byte[] buffer6 = Encoding.UTF8.GetBytes("AT+CIPSTART=TCP"+""+"80");
port.Write(buffer6, 0, buffer6.Length);
Thread.Sleep(10000);*/
byte[] buffer7 = Encoding.UTF8.GetBytes("AT+SSTRSEND=1" + "ABCD");
port.Write(buffer7, 0, buffer7.Length);
Thread.Sleep(10000);
byte[] buffer8 = Encoding.UTF8.GetBytes("AT+CIPSEND");
port.Write(buffer8, 0, buffer8.Length);
Thread.Sleep(10000);
Thread.Sleep(-1);
}
static void port_DataReceived(object sender, SerialDataReceivedEventArgs e)
{
Debug.Print(port.BytesToRead + "");
byte[] bytes = new byte[25];
while (port.BytesToRead > 0)
{
port.Read(bytes, 0, bytes.Length);
}
led.Write(true); // turn on the LED
Thread.Sleep(500); // sleep for 5s
led.Write(false);//turn o
}
}
}
--
You received this message because you are subscribed to the Google Groups "NUnit-Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nunit-discus...@googlegroups.com.
Visit this group at http://groups.google.com/group/nunit-discuss?hl=en.For more options, visit https://groups.google.com/groups/opt_out.
Hi Simone,
I would appreciate some guidance. I have been all over google and I don't seem to find an alternative approach. Thanx
Am using an SM5100B GSM/GPRS modem interconnected to a Netduino 2. The encoding portion of the code is for writing the At commands to the modem's UART.