Peer-to-Peer Forum

 

Login Register    
Establishing Connection Programmatically
Posted: 05 August 2010 04:03 AM  
Newbie
Rank
Total Posts:  1
Joined  2009-09-07

Hi,

i’m trying to establish a network connection (either in DIS or HLA) programmatically using vegaprime 2.1.2. On manual, it is written that i must declare connection like this:

vpNetDISConnection* myNetDISConnection = new vpNetDISConnection();

but when i put this line into my code, i got a compile error telling me that i cant access protected member.

Is there another way to initialize a connection?

Thx

 
Posted: 18 August 2010 03:26 AM   [ # 1 ]  
Jr. Member
RankRank
Total Posts:  33
Joined  2009-04-03

vpNetDISConnection* m_pDisConnection;

// create
m_pDisConnection = vpNetDISConnection::create();

// set stuff up
  m_pDisConnection ->setAppNum(m_sDisParams.AppNumber);
  m_pDisConnection ->setPort(m_sDisParams.DisPort);
  ...

  m_pDisConnection ->setSendEnabled( true );
  m_pDisConnection ->setReceiveEnabled( true );
  ...

// then configure

  m_pDisConnection ->configure();


I think that you need to create the connection prior to configuring the app - though I could be wrong