Go to Post To go a step further, to be "steam punk", electrics would need to be powered from a steam turbine operated dynamo but electric wiring would still be required to follow all rules as they would apply. - Al Skierkiewicz [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #16   Spotlight this post!  
Unread 09-01-2013, 16:12
mitchellweb1 mitchellweb1 is offline
Registered User
AKA: Mitchell W
FRC #0190
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2009
Location: Acton, MA
Posts: 30
mitchellweb1 is an unknown quantity at this point
Re: NetworkTable crash in unmodified SimpleRobot template

Can you post the actual output. Also make sure that you rebuild the WPILib project
Reply With Quote
  #17   Spotlight this post!  
Unread 21-01-2013, 22:29
IBeMad IBeMad is offline
Registered User
FRC #3968
 
Join Date: Jan 2013
Location: Washington
Posts: 4
IBeMad is an unknown quantity at this point
Re: NetworkTable crash in unmodified SimpleRobot template

Fixed it.

As it turned out, when you debug the first time after rebooting the robot, everything works fine. The second time you debug, the crash is caused by an IOException thrown in SocketServerStreamProvider::SocketServerStreamProv ider(int port).

The crash happened because the cRIO's user code (ours) attempted to bind a socket that had already been bound by a previous debugging session.

It can be fixed quite easily by inserting the following code somewhere (anywhere) between the call to setsockopt(...SO_REUSEADDR...) and the call to bind():

Code:
// NWR2013 - Set the port as reusable too.
if (setsockopt(serverSocket, SOL_SOCKET, SO_REUSEPORT, (char*) &reuseAddr, sizeof(reuseAddr)) == ERROR)
{
	printf("[SocketServerStreamProvider] Unable to mark the server socket port as reusable! Reason: %s\n", strerror(errno));
	return;
}
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 13:40.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi