Recent Posts

Pages: 1 2 3 [4] 5 6 ... 10
31
RakNet C++ Support / RakNet::Replica3::Serialize error
« Last post by pkovacs86 on December 03, 2014, 10:09:54 AM »
Hi All,

I have to use this "mDummy" integer member variable to avoid a crash in my program.
The "mFileName" is a RakString.

RakNet::RM3SerializationResult Defrost::StaticVisualImpl::Serialize( RakNet::SerializeParameters *serializeParameters )
{
   RakNet::VariableDeltaSerializer::SerializationContext serializationContext;
   serializeParameters->pro[0].reliability = RELIABLE_ORDERED;
   mVariableDeltaSerializer.BeginIdenticalSerialize(&serializationContext, serializeParameters->whenLastSerialized == 0, &serializeParameters->outputBitstream[0]);
   mVariableDeltaSerializer.SerializeVariable(&serializationContext, mFileName);
   mVariableDeltaSerializer.SerializeVariable(&serializationContext, mDummy);
   mVariableDeltaSerializer.EndSerialize(&serializationContext);
   return RakNet::RM3SR_SERIALIZED_ALWAYS;
}

The crash is only came up when the second client is connected to the server.

Any help would be appreciated......
And sure, if more information is needed to find out what is the problem, it will be provided...

Regards,
Peter



 
32
Please find attached, modified version of NAT punch through client and server codes (using only punch through mechanism): server.cpp, and client.cpp

I can run the server and connect two clients with it easily; then I can make the punch through to work. After the process is successful, I am also saving other client's GUID automatically.

in the modified client processing loop:
Code: [Select]
if ( !kbhit() )
{
while(true)
{
packet=rakPeer->Receive();
if ( packet == NULL )
break;
sample->ProcessPacket(packet);

PrintPacketMessages(packet, rakPeer);
rakPeer->DeallocatePacket(packet);
}
RakSleep(30);
}
else
{
char temp[32];
Gets( temp, sizeof(temp ) );
if ( strcmpi(temp,"q" ) == 0 )
break;
RakNet::BitStream bs;
bs.Write( (RakNet::MessageID)TM_TEST_STRING );
bs.Write(temp);
NatPunchthoughClientFramework *f = (NatPunchthoughClientFramework *) sample;
uint32_t rv = rakPeer->Send( &bs, HIGH_PRIORITY, RELIABLE_ORDERED, 0, f->remoteSystemAddress,  true);
if ( rv == 0 )
printf("\nnot formatted properly");
}
I try to send some text to the saved system address of other client: i.e.

rakPeer->Send( &bs, HIGH_PRIORITY, RELIABLE_ORDERED, 0, f->remoteSystemAddress,  true);

even tried the GUID, i.e. f->remoteSystemGuid, which also does not work.

But instead of getting to other client directly, it is intercepted only at server side (that is OK since it is being broadcasted); but why doesn't the other client get it???
33
Hi,

Is it necessary I use socket handler from test clients? Or can I use another application that connects to another external IP on already provided port?

Question rephrased: is it necessary to do further communication after NAT punch through using the same application only, or, can I use other application to start broadcasting on the already open external IP/port?
34
After successful punch hole, with similar output:

Listener:

Quote
My GUID is 990791923771143894
Calculating port stride from aaa.bbb.ccc.ddd|61111
INCAPABLE_PORT_STRIDE. My external ID is 116.0.40.130|20000
OnGetMostRecentPort mostRecentExternalPort first time set to 20000
79719264: TESTING_INTERNAL_IPS: OOB ID_NAT_ESTABLISH_UNIDIRECTIONAL to guid 2837
26782210090481, system address 192.168.56.1|10000.

79719294: TESTING_INTERNAL_IPS: OOB ID_NAT_ESTABLISH_UNIDIRECTIONAL to guid 2837
26782210090481, system address 192.168.56.1|10000.

79719324: TESTING_INTERNAL_IPS: OOB ID_NAT_ESTABLISH_UNIDIRECTIONAL to guid 2837
26782210090481, system address 192.168.1.43|10000.

79719354: TESTING_INTERNAL_IPS: OOB ID_NAT_ESTABLISH_UNIDIRECTIONAL to guid 2837
26782210090481, system address 192.168.1.43|10000.

79719384: TESTING_INTERNAL_IPS: OOB ID_NAT_ESTABLISH_UNIDIRECTIONAL to guid 2837
26782210090481, system address 169.254.33.44|10000.

79719385: TESTING_INTERNAL_IPS: OOB ID_NAT_ESTABLISH_BIDIRECTIONAL to guid 28372
6782210090481, system address 192.168.1.43|10000.

Punchthrough to guid 283726782210090481, system address 192.168.1.43|10000 succe
eded on 1st attempt.
NAT punch success from remote system 192.168.1.43|10000.
Enter RakNetGuid of the remote system, which should have already connected.
Or press 'q' to quit.

Sender:
Quote
Calculating port stride from aaa.bbb.ccc.ddd|61111
INCAPABLE_PORT_STRIDE. My external ID is 39.50.155.10|37697
Starting ID_NAT_PUNCHTHROUGH_REQUEST to guid 990791923771143894.
OnGetMostRecentPort mostRecentExternalPort first time set to 37697
79719266: TESTING_INTERNAL_IPS: OOB ID_NAT_ESTABLISH_UNIDIRECTIONAL to guid 9907
91923771143894, system address 192.168.119.1|20000.

79719296: TESTING_INTERNAL_IPS: OOB ID_NAT_ESTABLISH_UNIDIRECTIONAL to guid 9907
91923771143894, system address 192.168.119.1|20000.

79719326: TESTING_INTERNAL_IPS: OOB ID_NAT_ESTABLISH_UNIDIRECTIONAL to guid 9907
91923771143894, system address 192.168.91.1|20000.

79719356: TESTING_INTERNAL_IPS: OOB ID_NAT_ESTABLISH_UNIDIRECTIONAL to guid 9907
91923771143894, system address 192.168.91.1|20000.

PUNCHING_FIXED_PORT: Received ID_NAT_ESTABLISH_UNIDIRECTIONAL from guid 99079192
3771143894, system address 192.168.1.80|20000.
79719356: PUNCHING_FIXED_PORT: OOB ID_NAT_ESTABLISH_BIDIRECTIONAL to guid 990791
923771143894, system address 192.168.1.80|20000.

79719386: PUNCHING_FIXED_PORT: OOB ID_NAT_ESTABLISH_BIDIRECTIONAL to guid 990791
923771143894, system address 192.168.1.80|20000.

Received ID_NAT_ESTABLISH_UNIDIRECTIONAL from guid 990791923771143894, system ad
dress 192.168.1.80|20000.
79719386: PUNCHING_FIXED_PORT: OOB ID_NAT_ESTABLISH_BIDIRECTIONAL to guid 990791
923771143894, system address 192.168.1.80|20000.

79719417: PUNCHING_FIXED_PORT: OOB ID_NAT_ESTABLISH_BIDIRECTIONAL to guid 990791
923771143894, system address 192.168.1.80|20000.

ID_NAT_ESTABLISH_BIDIRECTIONAL: Estimated port stride from incoming connection a
t 37839. ourExternalPort=10000 mostRecentExternalPort=37697
ID_NAT_ESTABLISH_BIDIRECTIONAL: New mostRecentExternalPort 10000
79719417: PUNCHING_FIXED_PORT: OOB ID_NAT_ESTABLISH_BIDIRECTIONAL to guid 990791
923771143894, system address 192.168.1.80|20000.

Punchthrough to guid 990791923771143894, system address 192.168.1.80|20000 succe
eded on 1st attempt.
NAT punch success to remote system 192.168.1.80|20000.
Enter RakNetGuid of the remote system, which should have already connected.
Or press 'q' to quit.

Suppose I want to send from 'sender' computer to 'listener' computer, a constant stream on a single port (using a separate application for streaming) - what UDP IP and port should I select for 'sender' computer, and what 'listener' address and port should I specify for 'listener' computer?

I have come this far, please give a little push...

Thanks...
35
Ok, some more updates ... if I cannot test on local, I have to go live - so I did.

With the NATCompleteClient interfaces started on two different computers, I can punch hole easily.

Suppose:

PC 1 IP : 192.168.1.43
PC 2 IP : 192.168.1.80

- PC 1 starts at local port 10000
- PC 2 starts at local port 20000

Both communicate with same Linux server hosting NATCompleteServer interface. By passing right GUID from listener to other, NAT punch hole succeeds.

Now, I want to transfer data between these two computers from another application.

Suppose I start a test streaming service that streams from PC1 to PC2 in following way:

PC1 -> starts broadcasting to PC2:
i.e. to 192.168.1.80:20000

I can see it starts streaming.

From PC2, however, when I try to open incoming data using this address: 192.168.1.43:20000, I get 'bind' error. If I use port 10000 (would not be right logically as well), I can open it, but no data gets through, obviously.

Can anyone guide from here onwards please?
36
I noticed in this post: http://www.jenkinssoftware.com/forum/index.php?topic=3687.0 Op is addressing a similar issue - since the original post is from few years back, maybe it is not very relevant to my specific case (with the latest code I acquired I can see there is no GetMyIP_Linux() function; even its calling from SocketLayer.cpp is commented out.

Has this issue re-opened in RakNet?

Edit: I noticed calls are different in case of server, being diverted to 'RNS2_Linux::GetMyIP( addresses )', whose implementation is similar to windows counter part - anyways, debugging won't help me much - would really appreciate if someone can guide on how to enable IP address detection on dev. server....

Thanks...
37
Ok, I have an update:

Apparently, since Linux VM is not on a public IP, therefore (probably) client cannot connect with it. I moved the compiled server sample from VM Box to live environment, and I can see my Windows clients can connect with it after some time, although at the time of server startup, it shows it's binding to just 127.0.0.1|61111 (but I refer to live IP address, not this one, obviously).

Quote
Enter port of system NatPunchthroughServer, or press enter for default:
Connecting...
sendto failed with code -1 for char 5 and length 1464.
sendto failed with code -1 for char 5 and length 1464.
sendto failed with code -1 for char 5 and length 1464.
Enter RakNetGuid of the remote system, which should have already connected
to the server.
Or press enter to just listen.

which is good for the long run, but I cannot test everything all the time on live, I need a dev setup.

Can RakNet allow me this provision somehow?

Thanks again...
38
Some updates:

I was able to get NATCompleteServer and NATCompleteClient to work under Windows environment, and developed a very basic level understanding. It looks very good and promising.

I have my server hosted on Linux, so I decided to compile NATCompleteServer under Linux environment, based on help files provided with RakNet - which was also a success. This Linux machine is a virtual machine running side by side my Windows machine.

When I run this server example on my Linux VM, I can see it gives me only two IPs:

1. 127.0.0.1
2. 127.0.0.1
Using port 61111
Started on 127.0.0.1|61111

While my Linux VM 'does' have a proper IP: 192.168.1.69 (just an example).

I can ping this IP from my Windows, and vice versa - I have no issues; but NATCompleteServer example is unable to find this at startup time, some how.

In order to get NAT punch hole mechanism to work, at a basic level, I need this IP to be recognized somehow... local host won't do me any good unfortunately.

Can someone kindly guide why server example is unable to find this proper IP?

Thanks in advance for your time.
39
Hi!

Sorry for disturbing you guys again; can some one kindly reply with some help? Thanks...
40
SWIG and C# support / DLL build error
« Last post by johnlanni on November 27, 2014, 03:31:25 AM »
I've followed swig tutorial (“Creating the Swig Wrapped DLL Project” )but when I build the project (Visual Studio 2012) it says this error:

error C2558: class“RakNet::ReliabilityLayer”: No copy constructor available or copy constructor is declared "explicit"

error code:
Code: [Select]
jresult = new ReliabilityLayer((const ReliabilityLayer &)result);
how can I do?
Pages: 1 2 3 [4] 5 6 ... 10