Welcome! Log In Create A New Profile

Advanced

The latest SIOC v6 do not work in my OC4BA_XP

Posted by roarkr 
The latest SIOC v6 do not work in my OC4BA_XP
February 23, 2018 02:38PM
Hi,
I have had a good working OC4BA_XP app that interfaces Opencockpits modules witht XPLANE11 B737 airplanes when the SIOC.exe was in version 5


Using the new SIOC v6 do not work. AS I do not know what changes there have been made between v5 to v6 of SIOC it is hard to debug.


This is the fault message I get from the debugger:

System.IO.IOException occurred
HResult=0x80131620
Message=Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
Source=<Cannot evaluate the exception source>
StackTrace:
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at DotNetDataRefConnector.SIOCinterface.SIOCListenThread()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

Inner Exception 1:
SocketException: An existing connection was forcibly closed by the remote host

This is the code part where the problem is located to:


public bool SIOCConnect()
{
string ServerIP = "Localhost";

//string[] Lines = System.IO.File.ReadAllLines("g:\\SIOC\\SIOC.ini"winking smiley;
string[] Lines = System.IO.File.ReadAllLines(@"SIOC.ini"winking smiley;
//string ServerPort = "8092";
string ServerPort = (Lines[1].Substring(10, 4));
SiocConnectionState = (int)Connection.trying; // trying
//RefreshControlWindow();

try
{
/* Connecting to server (will crash if address/name is incorrect) */
//
TCPClient = new TcpClient(ServerIP, Int32.Parse(ServerPort));
//

SiocConnectionState = (int)Connection.connected; //Connected
//RefreshControlWindow();

/* Store the NetworkStream */
NetworkStream = TCPClient.GetStream();
/* Create data buffer */
NetworkBuffer = new byte[TCPClient.ReceiveBufferSize];

// Create listening thread and assign it to ListenThread()
Thread SIOCListenTread = new Thread(new ThreadStart(SIOCListenThread));

// Now start listening to incomming message from SIOC
SIOCListenTread.Start();
//
SiocConnectionState = (int)Connection.connected; /*RefreshControlWindow();*/

//WeAreClosing = false;

SendInicio(); // Send Inicio String to SIOC so it knows what variables we need
return true;
}
catch
{
SiocConnectionState = (int)Connection.failed; /*RefreshControlWindow();*/
return false;
}
}
Re: The latest SIOC v6 do not work in my OC4BA_XP
February 23, 2018 03:23PM
The protocol require PING<->PONG alive system.

Can be the SIOC close the connection by timeout if you dont sent the response from SERVER ?

SIOC V6 run perfectly with others SIOC connections, and Prosim connections...
Re: The latest SIOC v6 do not work in my OC4BA_XP
February 24, 2018 11:19AM
adminforo Wrote:
-------------------------------------------------------
> The protocol require PING<->PONG alive system.
>
> Can be the SIOC close the connection by timeout if
> you dont sent the response from SERVER ?
>
> SIOC V6 run perfectly with others SIOC
> connections, and Prosim connections...

If there is no changes to the protocol itself, it is probably a timing issue. Maybe I have to increase the timeout variable.

SIOC v6 also work fine with OC4BAv4 and PMDG airplanes,
Re: The latest SIOC v6 do not work in my OC4BA_XP
December 01, 2018 10:57PM
Updated OC4BA_XP driver works fine with SIOC v6 now.
In addition OC4BA_XPv1.3.1 supports Opencockpits FMCv2/FMCv3
Sorry, only registered users may post in this forum.

Click here to login