Raknet connection issue on Unity3D + iOS (il2cpp) -


i have weird issue running last version of raknet on ios unity3d: connection_attempt_failed when trying connect server.

now let's me detail issue:

he exact same library connects fine when used in objectivec application, issue seems unity3d related.

i managed pinpoint issue located in raknet reliability layer:

apparently, during last step of connection process (when connection handshake been completed) reliability layer of server thinks id_connection_request packet received client acknowledgment instead of message. therefore doesn't answer. after few tries, (and 10s timeout) client fails connection_attempt_failed error.

does there idea? update question when manage more info.

update

we using unity3d 5.1.1f1

we managed find workaround! see answer more information. workaround doesn't tell happened, gladly hear c++/xcode/unity/ios/applellvm6.1 experts around here explain happened.

the issue raknet header wasn't generated ios client. namely sending ack messages in place of simple packets. rest of message considered garbage server , packet dropped. client kept trying send corrupted handshake packet few times before timeouting.

this doesn't tell why, doesn't it? apparently serialize method of class datagramheaderformat wasn't called should have been when running raknet in unity (ios). else (and don't know what) linked in place of method , filling bitstream corrupted header.

i quite sure serialize method wasn't called because printf calls inside weren't displayed in console.

we renamed datagramheaderformat::serialize datagramheaderformat::serializeheader and... voila, works.

now want understand did compiler (and why).


Comments