PDA

View Full Version : Talking to IOCP from C#



capetonian
11-17-2013, 06:23 PM
Hi Everyone,

I started learning C# this year with the view on developing some software for my new sim project. Under the mottoe, if it isn;t there then I might as well try and make it myself! Unfortunately I am not a person who studies very well from books, . I like to read a bit then go out and try all kinds of things until I get stuck, then I go back to the books. Now I have been able to come a long way using MS Visual Studio, Paul Hent'y FSUIPCclient.dll and of course my dearly loved, registered copy of FSUIPC.

Now I have reached the stage whene I need, or rather want, to connect to the IOCP server to read and write switch states. I'm not too lazy to read all the ins and outs of winsock programming it is just that I am just too darn frigidity and my childhood ADHD seems to be making sporadic re-entrances on my stage of life for me to sit down and start from scratch while I am still a novice at .NET programming. I have a small setup with a few switches, 5 leds and to rotary encoders that I use for testing stuff. Of course I am dying to try and talk to IOCP from within a WFP project.

Does anyone have any sample code or other examples? The only documentation that I have found on the new is very limited and refers only to the init and ack strings uesd to pass variables to IOCP. Unfortunately Nico's IOCP client is not available any longer and neither can I find the script examples written by Johan Knol for his PMDGSiocConnector program.

Thanks for taking the time to read this.

pshz11
11-21-2013, 09:29 PM
Hi,

I have coded couple of classes implementing IOCP server functionality. I use them in my 737NG project to interface Arduino with ProSim:737. Check the link below:

http://ylmbl.ru/wp-content/uploads/2013/11/NGConnect.rar

Few lines to initialize class:

IOCPServer iocps = new IOCPServer();
iocps.ClientComandReceived += new IOCPComandDelegate(iocps_ClientComandReceived);
iocps.Start();

Hope it will help :)

capetonian
11-22-2013, 05:29 AM
Hi there,

Thank you very much for your reply and your examples. I am going to get stuck into this the coming weekend.

Andrew.

prinwibowo
12-05-2013, 07:09 PM
Hi Pshz11,

the link is down, do you have alternative link?

thanks...

pshz11
12-05-2013, 07:16 PM
Hi Pshz11,

the link is down, do you have alternative link?

thanks...

Forgot to pay for server ((( it will be back online soon

prinwibowo
12-05-2013, 07:30 PM
I'm looking forward...

thx

Roarkr
01-01-2014, 07:00 PM
Hi,

I have coded couple of classes implementing IOCP server functionality. I use them in my 737NG project to interface Arduino with ProSim:737. Check the link below:

http://ylmbl.ru/wp-content/uploads/2013/11/NGConnect.rar

Few lines to initialize class:

IOCPServer iocps = new IOCPServer();
iocps.ClientComandReceived += new IOCPComandDelegate(iocps_ClientComandReceived);
iocps.Start();

Hope it will help :)


Hi,

I tried your NGConnect code, but got a compilation error using the

iocps.ClientComandReceived += new IOCPComandDelegate(iocps_ClientComandReceived);

when initializing the class

This is the error code:
The name 'iocps_ClientComandReceived' does not exist in the current context

Any ideas what is wrong?

/Roar

pshz11
01-10-2014, 10:53 PM
Hi,

You need to declare iocps_ClientComandReceived function (or any other name you wish). That's an event handler.