Netduino home hardware projects downloads community

Jump to content


Photo

TCP/IP Communications Using Netduino Plus 2

netduino TCP-IP netduinoplus2 communications netduino plus2 microframework visual studio 2010 .NET Micro Framework SDK v4.2

  • Please log in to reply
2 replies to this topic

#1 Marjoc

Marjoc

    New Member

  • Members
  • Pip
  • 2 posts

Posted 13 November 2013 - 09:20 AM

I work with OS Win7 and Microsoft Visual Studio 2010 and I have downloaded the programs for to work with Netduino plus 2. I am doing test of exception error on the code and when I run the code line of the socket the program stops and exits the compiler. Obviously I want to treat socket error when network cable is disconnected but I get the error  mentioned above.
 
I have run the program on OS XP and I don't have problem with it. I check the program that I am doing and it works well and the installation of the programs I did in the order listed.
 
Can anyone help me for to solve this error? Thanks.


#2 JoopC

JoopC

    Advanced Member

  • Members
  • PipPipPip
  • 148 posts

Posted 14 November 2013 - 07:59 PM

it is easier when you publish some program code, there could be a Thousand things wrong.



#3 Marjoc

Marjoc

    New Member

  • Members
  • Pip
  • 2 posts

Posted 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.







Also tagged with one or more of these keywords: netduino, TCP-IP, netduinoplus2, communications netduino plus2, microframework, visual studio 2010, .NET Micro Framework SDK v4.2

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

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.