Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Python Korea Twisted Study 2013-06-30
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Bae KwonHan
July 01, 2013
200
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Python Korea Twisted Study 2013-06-30
Bae KwonHan
July 01, 2013
More Decks by Bae KwonHan
See All by Bae KwonHan
PyCon Korea 2017 micropython, led and thermostat
darjeeling
1
430
PyCon KR 2015 python and test
darjeeling
3
1.3k
PyCon.KR 2014 continuous luck and future
darjeeling
1
190
Featured
See All Featured
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.6k
Ethics towards AI in product and experience design
skipperchong
2
370
Side Projects
sachag
456
43k
Tell your own story through comics
letsgokoyo
1
1.1k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
500
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
270
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
440
Claude Code のすすめ
schroneko
67
230k
Transcript
Twisted for beginners 배권한 13년 7월 1일 월요일
강의에 앞서 요청드릴 점 • 강의료 대신에 부담가지 않는 금액으로
원하는곳에 기부를 해주세요. • 누군가 Twisted 에 대해서 알려달라고 하 면 알려주세요. • 초심자를 위한 강의입니다. 고급자는 아 는것부터 시작합니다. 13년 7월 1일 월요일
이 강의의 목표 13년 7월 1일 월요일
소켓프로그래밍은 쉽 다. 13년 7월 1일 월요일
목차 • socket programming is? • socket client / server
• single socket • multi thread • generator • framework • gevent • tornadio • twisted 13년 7월 1일 월요일
그전에 .. • pythonbrew 설치 • twisted 설치를 합시다. 13년
7월 1일 월요일
개발 환경 셋업 • mac • xcode • homebrew •
ubuntu • apt-get install build-essential 13년 7월 1일 월요일
pythonbrew • https://github.com/utahta/pythonbrew 13년 7월 1일 월요일
socket programming • UDP ( Datagram Sockets ) • TCP
( Stream Sockets ) • RAW ( RAW Sockets ) 13년 7월 1일 월요일
소켓의 특성 • UDP • TCP • RAW 13년 7월
1일 월요일
네트워크는 어떻게 되 어 있는가? • 라우터 • 노드 (
써버 클라이언트 ) • L4 • Proxy 13년 7월 1일 월요일
network address • IPV4 • IPV6 : https://en.wikipedia.org/wiki/IPV6 • Private
Network • 10.0.0.0/8 • 172.16.0.0/12 • 192.168.0.0/16 13년 7월 1일 월요일
network address • https://en.wikipedia.org/wiki/IPv4 • Special USE Addresses 13년 7월
1일 월요일
IP Header 13년 7월 1일 월요일
https://en.wikipedia.org/ wiki/IPv4#Header 13년 7월 1일 월요일
• https://en.wikipedia.org/wiki/ User_Datagram_Protocol UDP 13년 7월 1일 월요일
TCP • https://en.wikipedia.org/wiki/ Transmission_Control_Protocol 13년 7월 1일 월요일
TCP Header 13년 7월 1일 월요일
13년 7월 1일 월요일
TCP 상태가 어쩌고.. 13년 7월 1일 월요일
우리는 이런거 몰라도 됨 13년 7월 1일 월요일
• 연결 • 사용 • 끝 • 에러 이것만 알면
됩니다. 13년 7월 1일 월요일
그럼 하나씩 짜봅시 다. 13년 7월 1일 월요일
웹 페이지를 가져오는 소켓 프로그래밍 13년 7월 1일 월요일
1 #!/usr/bin/python 2 3 import socket 4 5 s =
socket.socket() 6 s.connect(("ifconfig.me",80)) 7 s.sendall("GET /\n") 8 data = "" 9 while True: 10 buf = s.recv(1024) 11 if buf == "": 12 break 13 else: 14 data += buf 15 s.close() 16 print data 13년 7월 1일 월요일
urllib 13년 7월 1일 월요일
1 #!/usr/bin/python 2 3 import urllib 4 5 print urllib.urlopen("http://ifconfig.me").read()
13년 7월 1일 월요일
그런데 지금까지의 문 제는? 13년 7월 1일 월요일
1번에 1개만 됨 13년 7월 1일 월요일
그럼 써버도 짜봅시 다. 13년 7월 1일 월요일
1 #!/usr/bin/python 2 3 import socket 4 5 s =
socket.socket() 6 s.bind(("0.0.0.0",9999)) 7 s.listen(1) 8 conn, addr = s.accept() 9 print 'Connected by', addr 10 while 1: 11 data = conn.recv(1024) 12 if not data: break 13 conn.sendall(data) 14 conn.close() 15 13년 7월 1일 월요일
tornado 13년 7월 1일 월요일
http:// www.tornadoweb.org/ en/stable/ 13년 7월 1일 월요일
http://www.tornadoweb.org/ en/stable/ ioloop.html#ioloop-objects 13년 7월 1일 월요일
about twisted 13년 7월 1일 월요일
http:// www.aosabook.org/en/ twisted.html 13년 7월 1일 월요일
• 역사 • socket • protocol • factory • process
• threads • logging • application • callLater / LoopingCall • database call • twistd 13년 7월 1일 월요일
• 2002년 첫 릴리즈 • 지금은 13.0.0 역사? 13년 7월
1일 월요일
• Separation of protocols and transports • Deferreds • Thread
Support • Foreign Loop support 특징점 13년 7월 1일 월요일
socket • http://twistedmatrix.com/trac/wiki/ FrequentlyAskedQuestions#HowdoImakein putononeconnectionresultinoutputonanoth er 13년 7월 1일 월요일
code examples • http://twistedmatrix.com/documents/ 13.0.0/core/examples/ 13년 7월 1일 월요일
writing servers • http://twistedmatrix.com/documents/ 12.2.0/core/howto/servers.html 13년 7월 1일 월요일
run another process • http://twistedmatrix.com/documents/ 13.0.0/core/howto/process.html 13년 7월 1일 월요일
threads • http://twistedmatrix.com/documents/ 12.2.0/core/howto/threading.html 13년 7월 1일 월요일
application • http://twistedmatrix.com/documents/ 12.3.0/core/howto/application.html 13년 7월 1일 월요일
logging • http://twistedmatrix.com/documents/ 12.2.0/core/howto/logging.html 13년 7월 1일 월요일
callLater • http://twistedmatrix.com/documents/ 11.0.0/core/howto/time.html 13년 7월 1일 월요일
database • http://twistedmatrix.com/documents/ 12.2.0/core/howto/rdbms.html 13년 7월 1일 월요일
twistd • http://www.saltycrane.com/blog/2008/10/ running-twisted-perspective-broker- example-twistd/ 13년 7월 1일 월요일