Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.

Marjoc

Member Since 13 Nov 2013
Offline Last Active Jun 17 2015 06:59 PM
-----

Posts I've Made

In Topic: TCP/IP Communications Using Netduino Plus 2

15 November 2013 - 03:09 PM

[color=rgb(0,0,0);font-family:Arial, Helvetica, sans-serif;font-size:12px;]Deputy of the code to treat socket exception error.[/color]

[color=rgb(0,0,0);font-family:Arial, Helvetica, sans-serif;font-size:12px;]Sub Main()[/color]

[color=rgb(0,0,0);font-family:Arial, Helvetica, sans-serif;font-size:12px;]Try[/color]

[color=rgb(0,0,0);font-family:Arial, Helvetica, sans-serif;font-size:12px;]Socket.Connect()[/color]

[color=rgb(0,0,0);font-family:Arial, Helvetica, sans-serif;font-size:12px;]flagException = False[/color]

[color=rgb(0,0,0);font-family:Arial, Helvetica, sans-serif;font-size:12px;]Debug.Print("Connected Socket")[/color]

[color=rgb(0,0,0);font-family:Arial, Helvetica, sans-serif;font-size:12px;]'following code[/color]

[color=rgb(0,0,0);font-family:Arial, Helvetica, sans-serif;font-size:12px;]' ERROR CONECTION TCP-IP ==> System.Net.Sockets.SocketException[/color]

[color=rgb(0,0,0);font-family:Arial, Helvetica, sans-serif;font-size:12px;]Catch errorSocket As SocketException[/color]

[color=rgb(0,0,0);font-family:Arial, Helvetica, sans-serif;font-size:12px;]'Socket.Close()[/color]

[color=rgb(0,0,0);font-family:Arial, Helvetica, sans-serif;font-size:12px;]'Debug.Print("ethernet connection")[/color]

[color=rgb(0,0,0);font-family:Arial, Helvetica, sans-serif;font-size:12px;]flagException = True[/color]

[color=rgb(0,0,0);font-family:Arial, Helvetica, sans-serif;font-size:12px;]Finally[/color]

[color=rgb(0,0,0);font-family:Arial, Helvetica, sans-serif;font-size:12px;]End Try[/color]

[color=rgb(0,0,0);font-family:Arial, Helvetica, sans-serif;font-size:12px;]Thread.Sleep(Timeout.Infinite)[/color]

[color=rgb(0,0,0);font-family:Arial, Helvetica, sans-serif;font-size:12px;]End Sub[/color]

 

When the network cable is disconnected then is when occurs the error and is closed the emulator. This occurs is with OS W7 but in Windows XP the code works well and is established the Socket exception error. I think the problem is in the installation of the Micro Framework on W7 because libraries are not containing the. NET.If por example, I want testing that the network cable is connected in each time, it not is posible. I have tested in multiple computers on W7 and it not works.


home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.