OK I finally found my problem. I got rid of the "Implements IDisposable" and the region and sub that went with it that I did not include in the code clip above. Then I added a close command and made the socket = nothing in the response sub that also did not include above. I now can send a post or get a thousand times without it shutting down
- Netduino Forums
- → Viewing Profile: Posts: marksmanaz
Community Stats
- Group Members
- Active Posts 15
- Profile Views 9585
- Member Title Member
- Age Age Unknown
- Birthday Birthday Unknown
-
Gender
Not Telling
User Tools
Friends
marksmanaz hasn't added any friends yet.
Posts I've Made
In Topic: Socket server stops accepting after 5 connections
12 September 2013 - 04:01 AM
In Topic: HttpWebRequest GetResponse Error
27 May 2013 - 05:47 PM
I found the answer here:
http://forums.netdui...+iis#entry49398
You cannot prefix the address with "http://"
Thanks NakChak I didn't see your post until after I posted but thank you very much for the reply.
In Topic: Understanding InterruptPort Handling
27 May 2013 - 05:21 AM
I figured it out:
Dim span As TimeSpan = New TimeSpan() Dim duration As TimeSpan = span.Duration() Dim StartTime As Date Dim DoorTimer As New Timer(New TimerCallback(AddressOf lightOff), Nothing, duration, TimeSpan.Zero) Dim led As New OutputPort(Pins.GPIO_PIN_D8, False) Dim PIR As New InterruptPort(Pins.GPIO_PIN_D0, True, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeHigh) Public Sub PIR_OnInterrupt(data1 As UInteger, data2 As UInteger, time As Date) If StartTime = Nothing Then led.Write(True) StartTime = time DoorTimer.Change(600000, Timeout.Infinite) ElseIf StartTime <> Nothing Then DoorTimer.Change(600000, Timeout.Infinite) StartTime = time End If End Sub Public Function MinutesDifference(startTime As DateTime) As Double Return (DateTime.Now.Subtract(startTime).Ticks / TimeSpan.TicksPerMinute) End Function Sub lightOff() led.Write(False) StartTime = Nothing DoorTimer.Dispose() End Sub
In Topic: HttpWebRequest GetResponse Error
27 May 2013 - 05:16 AM
Stefan,
I could use your help. I have been trying to use your HttpClient
all day and can't get it to post to my IIS server and get a response. If you leave your test server in on port 80 it works fine but any other server it does nothing and eventualy I get this error:
"A first chance exception of type 'System.Net.Sockets.SocketException' occurred in Microsoft.SPOT.Net.dll"
When I check the logs on the IIS server it shows no requests being made by the Netduino. I can access the page from any browser with no problem.
Any help is appreciated.
Thank,
Mark
Public Sub PostSmsMsg() Try ' Creates a new web session Dim WebSession As HTTP_Client = New HTTP_Client(New IntegratedSocket("http://XXXXXXXX.no-ip.biz/Twilio/WebSite/smsresponse.aspx", 10343)) ' Requests the latest source Dim Response As HTTP_Client.HTTP_Response = WebSession.Post("") ' Did we get the expected response? (a "200 OK") If Response.ResponseCode <> 200 Then Throw New ApplicationException("Unexpected HTTP response code: " + Response.ResponseCode.ToString()) End If ' Fetches a response header Debug.Print("Current date according to www.netmftoolbox.com: " + Response.ResponseHeader("date")) ' Gets the response as a string Debug.Print(Response.ToString()) Catch ex As Exception Debug.Print(ex.ToString) End Try End Sub
In Topic: HttpWebRequest GetResponse Error
27 May 2013 - 05:07 AM
oops
- Netduino Forums
- → Viewing Profile: Posts: marksmanaz
- Privacy Policy