SlideShare a Scribd company logo
1 of 28
Aviation and Erlang
        Thomas Karsten
  barcamp Shanghai, 2010-06-12
About me
• Thomas Karsten
• Hometown: Berlin, Germany
• Current location: Shanghai, China
• Developer and scrum master at The
  NetCircle

• Aviation, long distance cycling
Introduction
• Aviation
 •   Wind Correction Angle

 •   Glidepath

• Erlang Server
 •   TCP Connection

 •   Erlang Interface

• Aviation and Erlang
• Storage Application
1 Aviation


• All about aircrafts
• Design, Operation, Navigation
1 Aviation
 Wind Correction Angle (wca)
1 Aviation
 Wind Correction Angle (wca)
1 Aviation
 Wind Correction Angle (wca)
                 vw




                    v
1 Aviation
 Wind Correction Angle (wca)
                 vw




                    v
1 Aviation
 Wind Correction Angle (wca)
                         vw




                    wca

                    v
1 Aviation
  Wind Correction Angle (wca)
                          vw



wca=atan(vw/v)
with v=150kt, vw=20kt:
wca=7.6
                         wca

                         v
1 Aviation
 Wind Correction Angle (wca)
                    vw




                    v
1 Aviation
 Wind Correction Angle (wca)
                    vw




                    v
1 Aviation
  Wind Correction Angle (wca)
                     vw
                         vw90
vw90=sin(wta)*vw


                     v
1 Aviation
  Wind Correction Angle (wca)
                     vw
                         vw90
wca=atan(vw90/v)


                     v
1 Aviation
 Glidepath
1 Aviation
 Glidepath




 120kt=120nm/h=2nm/min
 t=10.3nm/2nm/min
 t=5.15min
1 Aviation
 Glidepath




 5000ft/5.15min=971ft/min
1 Aviation
 Glidepath




 5000ft/5.15min=971ft/min
1 Aviation
 Glidepath




 (5000ft-1416ft)/5.15min=696ft/min
1 Aviation
2 Erlang Server
  Erlang


• Developed at Ericsson 1986
• Open source since 1998
• Distributed, fault-tolerant applications
• Processes are lightweight
• RabbitMQ, ejabberd
2 Erlang Server
 TCP Connection
 -module(server).
 -export([start/0, stop/0]).
 -export([listen/0]).


 listen() ->
    case gen_tcp:listen(Port, ?TCP_OPTIONS) of
        {ok, LSocket} ->
               NewState=State#state{lsocket=LSocket},
               case gen_tcp:accept(LSocket) of
                     {ok, Socket} ->
                         do_something(Socket),
                     {error, Reason} ->
                         {error, Reason}
               end


               {ok, NewState};
        {error, Reason} ->
               {stop, Reason}
    end.
2 Erlang Server
 Erlang Interface
 -module(listen).
 -export([start/0, stop/0]).
 -export([listen/0]).


 start() ->
    register(?MODULE, spawn(fun() -> listen() end)).


 stop() ->
    ?MODULE ! stop.


 listen() ->
    receive
        {Pid, Request} ->
               io:format("From: ~p~nReceived: ~p~n", [Pid, Request]);
        Any ->
               io:format("Received: ~p~n", [Any])
    end.
2 Erlang Server
 Erlang Interface
 int main(int ac, char** av)
 {
     erl_init(NULL, 0);
     if (erl_connect_init(1, cookie, 0) == -1)
        erl_err_quit("err_connect_init");
     if ((fd=erl_connect(node)) < 0)
        erl_err_quit("erl_connect: Cannot connect to node");


     tuple=create_tuple();
     erl_reg_send(fd, RECIPIENT, tuple);


     return 0;
 }
3 Aviation and Erlang
 Code examples
4 Storage Application
 Code examples
Lessons learned


• How to land an airplane in cross-wind
• Different communication types in Erlang
• How to program a server in Erlang
Aviation and Erlang


 Thank you very much for listening

 Any questions?

More Related Content

What's hot

REBO unloading-components-roro 2014-10-02
REBO unloading-components-roro 2014-10-02REBO unloading-components-roro 2014-10-02
REBO unloading-components-roro 2014-10-02reboostende
 
Original Mosfet MC33151DR2G 33151 MC33151 SOP-8 New
Original Mosfet MC33151DR2G 33151 MC33151 SOP-8 NewOriginal Mosfet MC33151DR2G 33151 MC33151 SOP-8 New
Original Mosfet MC33151DR2G 33151 MC33151 SOP-8 NewAUTHELECTRONIC
 
Weapons grade React by Ken Wheeler
Weapons grade React by Ken Wheeler Weapons grade React by Ken Wheeler
Weapons grade React by Ken Wheeler React London 2017
 
GNAT GPL For Mindstorms
GNAT GPL For MindstormsGNAT GPL For Mindstorms
GNAT GPL For MindstormsAdaCore
 
Ovl by example
Ovl by exampleOvl by example
Ovl by examplealexgn1
 
Codecraft Dunedin, 2015-03-04, Blackbox feature for Cleanflight, Nicholas She...
Codecraft Dunedin, 2015-03-04, Blackbox feature for Cleanflight, Nicholas She...Codecraft Dunedin, 2015-03-04, Blackbox feature for Cleanflight, Nicholas She...
Codecraft Dunedin, 2015-03-04, Blackbox feature for Cleanflight, Nicholas She...thenickdude
 

What's hot (7)

REBO unloading-components-roro 2014-10-02
REBO unloading-components-roro 2014-10-02REBO unloading-components-roro 2014-10-02
REBO unloading-components-roro 2014-10-02
 
Original Mosfet MC33151DR2G 33151 MC33151 SOP-8 New
Original Mosfet MC33151DR2G 33151 MC33151 SOP-8 NewOriginal Mosfet MC33151DR2G 33151 MC33151 SOP-8 New
Original Mosfet MC33151DR2G 33151 MC33151 SOP-8 New
 
Weapons grade React by Ken Wheeler
Weapons grade React by Ken Wheeler Weapons grade React by Ken Wheeler
Weapons grade React by Ken Wheeler
 
GNAT GPL For Mindstorms
GNAT GPL For MindstormsGNAT GPL For Mindstorms
GNAT GPL For Mindstorms
 
Ovl by example
Ovl by exampleOvl by example
Ovl by example
 
Codecraft Dunedin, 2015-03-04, Blackbox feature for Cleanflight, Nicholas She...
Codecraft Dunedin, 2015-03-04, Blackbox feature for Cleanflight, Nicholas She...Codecraft Dunedin, 2015-03-04, Blackbox feature for Cleanflight, Nicholas She...
Codecraft Dunedin, 2015-03-04, Blackbox feature for Cleanflight, Nicholas She...
 
Appsec obfuscator reloaded
Appsec obfuscator reloadedAppsec obfuscator reloaded
Appsec obfuscator reloaded
 

Viewers also liked

Viewers also liked (7)

McConnell family020505
McConnell family020505McConnell family020505
McConnell family020505
 
5340 Wasrag May 2010
5340 Wasrag May 20105340 Wasrag May 2010
5340 Wasrag May 2010
 
Ciclos biogeoq
Ciclos biogeoqCiclos biogeoq
Ciclos biogeoq
 
Engagement, change, empowerment to harness opportunity & creatively manage ch...
Engagement, change, empowerment to harness opportunity & creatively manage ch...Engagement, change, empowerment to harness opportunity & creatively manage ch...
Engagement, change, empowerment to harness opportunity & creatively manage ch...
 
Chapter04
Chapter04Chapter04
Chapter04
 
5 simple rules to Twitter
5 simple rules to Twitter5 simple rules to Twitter
5 simple rules to Twitter
 
Compclassification0708
Compclassification0708Compclassification0708
Compclassification0708
 

Similar to Aviation and Erlang

PWM wave generator using microcontroller
 PWM wave generator using microcontroller  PWM wave generator using microcontroller
PWM wave generator using microcontroller Swapnil2515
 
swift-nio のアーキテクチャーと RxHttpClient
swift-nio のアーキテクチャーと RxHttpClientswift-nio のアーキテクチャーと RxHttpClient
swift-nio のアーキテクチャーと RxHttpClientShinya Mochida
 
Take Off And Landing Performance
Take Off And Landing PerformanceTake Off And Landing Performance
Take Off And Landing Performanceahmad bassiouny
 
「SPICEの活用方法」セミナー資料(28JAN2011) PPT
「SPICEの活用方法」セミナー資料(28JAN2011) PPT「SPICEの活用方法」セミナー資料(28JAN2011) PPT
「SPICEの活用方法」セミナー資料(28JAN2011) PPTTsuyoshi Horigome
 
Flyback Converter using PWM IC(LTspice Version)
Flyback Converter using PWM IC(LTspice Version)Flyback Converter using PWM IC(LTspice Version)
Flyback Converter using PWM IC(LTspice Version)Tsuyoshi Horigome
 
Writing Docker monitoring agent with Go
Writing Docker monitoring agent with GoWriting Docker monitoring agent with Go
Writing Docker monitoring agent with GoNaoki AINOYA
 
Actor Concurrency
Actor ConcurrencyActor Concurrency
Actor ConcurrencyAlex Miller
 
Cdd Dual Sample Pulse width modulation Flow Chart Diagram.pptx
Cdd Dual Sample Pulse width modulation Flow Chart Diagram.pptxCdd Dual Sample Pulse width modulation Flow Chart Diagram.pptx
Cdd Dual Sample Pulse width modulation Flow Chart Diagram.pptxRajSingh616745
 
Lego: A brick system build by scala
Lego: A brick system build by scalaLego: A brick system build by scala
Lego: A brick system build by scalalunfu zhong
 
How to Leverage Go for Your Networking Needs
How to Leverage Go for Your Networking NeedsHow to Leverage Go for Your Networking Needs
How to Leverage Go for Your Networking NeedsDigitalOcean
 
PWM Buck Converter using Average Model
PWM Buck Converter using Average ModelPWM Buck Converter using Average Model
PWM Buck Converter using Average ModelTsuyoshi Horigome
 
Job Queue in Golang
Job Queue in GolangJob Queue in Golang
Job Queue in GolangBo-Yi Wu
 
The Joy of ServerSide Swift Development
The Joy  of ServerSide Swift DevelopmentThe Joy  of ServerSide Swift Development
The Joy of ServerSide Swift DevelopmentGiordano Scalzo
 
The Joy Of Server Side Swift Development
The Joy Of Server Side Swift DevelopmentThe Joy Of Server Side Swift Development
The Joy Of Server Side Swift DevelopmentGiordano Scalzo
 

Similar to Aviation and Erlang (20)

PWM wave generator using microcontroller
 PWM wave generator using microcontroller  PWM wave generator using microcontroller
PWM wave generator using microcontroller
 
Pwm wave
Pwm wave Pwm wave
Pwm wave
 
swift-nio のアーキテクチャーと RxHttpClient
swift-nio のアーキテクチャーと RxHttpClientswift-nio のアーキテクチャーと RxHttpClient
swift-nio のアーキテクチャーと RxHttpClient
 
Take Off And Landing Performance
Take Off And Landing PerformanceTake Off And Landing Performance
Take Off And Landing Performance
 
Akka http 2
Akka http 2Akka http 2
Akka http 2
 
「SPICEの活用方法」セミナー資料(28JAN2011) PPT
「SPICEの活用方法」セミナー資料(28JAN2011) PPT「SPICEの活用方法」セミナー資料(28JAN2011) PPT
「SPICEの活用方法」セミナー資料(28JAN2011) PPT
 
Flyback Converter using PWM IC(LTspice Version)
Flyback Converter using PWM IC(LTspice Version)Flyback Converter using PWM IC(LTspice Version)
Flyback Converter using PWM IC(LTspice Version)
 
Writing Docker monitoring agent with Go
Writing Docker monitoring agent with GoWriting Docker monitoring agent with Go
Writing Docker monitoring agent with Go
 
Erlang/OTP in Riak
Erlang/OTP in RiakErlang/OTP in Riak
Erlang/OTP in Riak
 
Actor Concurrency
Actor ConcurrencyActor Concurrency
Actor Concurrency
 
Rack Middleware
Rack MiddlewareRack Middleware
Rack Middleware
 
Cdd Dual Sample Pulse width modulation Flow Chart Diagram.pptx
Cdd Dual Sample Pulse width modulation Flow Chart Diagram.pptxCdd Dual Sample Pulse width modulation Flow Chart Diagram.pptx
Cdd Dual Sample Pulse width modulation Flow Chart Diagram.pptx
 
Lego: A brick system build by scala
Lego: A brick system build by scalaLego: A brick system build by scala
Lego: A brick system build by scala
 
Hexapod ppt
Hexapod pptHexapod ppt
Hexapod ppt
 
How to Leverage Go for Your Networking Needs
How to Leverage Go for Your Networking NeedsHow to Leverage Go for Your Networking Needs
How to Leverage Go for Your Networking Needs
 
15757597 (1).ppt
15757597 (1).ppt15757597 (1).ppt
15757597 (1).ppt
 
PWM Buck Converter using Average Model
PWM Buck Converter using Average ModelPWM Buck Converter using Average Model
PWM Buck Converter using Average Model
 
Job Queue in Golang
Job Queue in GolangJob Queue in Golang
Job Queue in Golang
 
The Joy of ServerSide Swift Development
The Joy  of ServerSide Swift DevelopmentThe Joy  of ServerSide Swift Development
The Joy of ServerSide Swift Development
 
The Joy Of Server Side Swift Development
The Joy Of Server Side Swift DevelopmentThe Joy Of Server Side Swift Development
The Joy Of Server Side Swift Development
 

Recently uploaded

From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 

Recently uploaded (20)

From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 

Aviation and Erlang

  • 1. Aviation and Erlang Thomas Karsten barcamp Shanghai, 2010-06-12
  • 2. About me • Thomas Karsten • Hometown: Berlin, Germany • Current location: Shanghai, China • Developer and scrum master at The NetCircle • Aviation, long distance cycling
  • 3. Introduction • Aviation • Wind Correction Angle • Glidepath • Erlang Server • TCP Connection • Erlang Interface • Aviation and Erlang • Storage Application
  • 4. 1 Aviation • All about aircrafts • Design, Operation, Navigation
  • 5. 1 Aviation Wind Correction Angle (wca)
  • 6. 1 Aviation Wind Correction Angle (wca)
  • 7. 1 Aviation Wind Correction Angle (wca) vw v
  • 8. 1 Aviation Wind Correction Angle (wca) vw v
  • 9. 1 Aviation Wind Correction Angle (wca) vw wca v
  • 10. 1 Aviation Wind Correction Angle (wca) vw wca=atan(vw/v) with v=150kt, vw=20kt: wca=7.6 wca v
  • 11. 1 Aviation Wind Correction Angle (wca) vw v
  • 12. 1 Aviation Wind Correction Angle (wca) vw v
  • 13. 1 Aviation Wind Correction Angle (wca) vw vw90 vw90=sin(wta)*vw v
  • 14. 1 Aviation Wind Correction Angle (wca) vw vw90 wca=atan(vw90/v) v
  • 16. 1 Aviation Glidepath 120kt=120nm/h=2nm/min t=10.3nm/2nm/min t=5.15min
  • 17. 1 Aviation Glidepath 5000ft/5.15min=971ft/min
  • 18. 1 Aviation Glidepath 5000ft/5.15min=971ft/min
  • 19. 1 Aviation Glidepath (5000ft-1416ft)/5.15min=696ft/min
  • 21. 2 Erlang Server Erlang • Developed at Ericsson 1986 • Open source since 1998 • Distributed, fault-tolerant applications • Processes are lightweight • RabbitMQ, ejabberd
  • 22. 2 Erlang Server TCP Connection -module(server). -export([start/0, stop/0]). -export([listen/0]). listen() -> case gen_tcp:listen(Port, ?TCP_OPTIONS) of {ok, LSocket} -> NewState=State#state{lsocket=LSocket}, case gen_tcp:accept(LSocket) of {ok, Socket} -> do_something(Socket), {error, Reason} -> {error, Reason} end {ok, NewState}; {error, Reason} -> {stop, Reason} end.
  • 23. 2 Erlang Server Erlang Interface -module(listen). -export([start/0, stop/0]). -export([listen/0]). start() -> register(?MODULE, spawn(fun() -> listen() end)). stop() -> ?MODULE ! stop. listen() -> receive {Pid, Request} -> io:format("From: ~p~nReceived: ~p~n", [Pid, Request]); Any -> io:format("Received: ~p~n", [Any]) end.
  • 24. 2 Erlang Server Erlang Interface int main(int ac, char** av) { erl_init(NULL, 0); if (erl_connect_init(1, cookie, 0) == -1) erl_err_quit("err_connect_init"); if ((fd=erl_connect(node)) < 0) erl_err_quit("erl_connect: Cannot connect to node"); tuple=create_tuple(); erl_reg_send(fd, RECIPIENT, tuple); return 0; }
  • 25. 3 Aviation and Erlang Code examples
  • 26. 4 Storage Application Code examples
  • 27. Lessons learned • How to land an airplane in cross-wind • Different communication types in Erlang • How to program a server in Erlang
  • 28. Aviation and Erlang Thank you very much for listening Any questions?

Editor's Notes