SlideShare a Scribd company logo
Winsock
OutLine Winsock Introduction Project#3 Template MFC CSocket Demo hint
Winsock Introduction (See testMain) int APIENTRY _tWinMain(…) main routine make hInstance   maps to WndProc while loop for wait message BOOL  InitInstance(HINSTANCE  ,  int) CreateWindow Show  Window LRESULT CALLBACK WndProc( …) Handle message
Winsock Introduction WSAStartup( … ) 通知 Windows Sockets  應用程式要開始網路服務 WSAAsyncSelect (…) WSACleanup() 結束 Windows Sockets  的使用 WSAGETSELECTEVENT(lParam) extract the event code from the lParam in the response   to a WSAAsyncSelect() LOWORD(lParam)
Events FD_READ:  FD_WRITE:  FD_CONNECT:  FD_ACCEPT:  FD_CLOSE:
Project#3 Template EditPrintf (HWND hwndEdit, TCHAR * szFormat, ...) EditPrintf(hwndEdit, TEXT("=== Server START ===\r\n")); EditPrintf(hwndEdit, TEXT("=== Accept one new client(%d), List size:%d ===\r\n"), ssock, Socks.size()); case ID_LISTEN: Press the “Listen” button The button’s ID is “ ID_LISTEN ” WM_USER  =>  0x0400 All Message Numbers below 0x0400 are RESERVED.
To Do Fill actions when event happen When FD_READ/FD_WRITE happen ? GET action Target Server I/O Handle them same place ? Handle htm & cgi
MFC CSocket 繼承 CSocket 類別 覆寫 OnAccept  等 function
 
 
Demo hint 可以用作業二的任一 Server, 但不能重開 有把握的話 ,Test_case 1&2 可以一起測 Delayed server code  和  hide testcase  會在 demo 前幾天公怖 Timeout  機制請做成選項 還要說明如何做

More Related Content

PDF
EasyMock 101
DOCX
test questions
PPTX
Windows xp compromise and remedies
PDF
Vagrant勉強会 チュートリアル編
DOCX
Michael kontopoulos
DOC
Promedio de notas
KEY
Javascript Stacktrace Ignite
EasyMock 101
test questions
Windows xp compromise and remedies
Vagrant勉強会 チュートリアル編
Michael kontopoulos
Promedio de notas
Javascript Stacktrace Ignite

What's hot (8)

PDF
Cellys wpa2 hack_en
PPTX
n|u Dharamsala Humla : Memory Forensic by Tenzin Chokden
PDF
Uses of tmux explained
PDF
Minion pool - a worker pool for nodejs
PPTX
Metasploit - Basic and Android Demo
DOC
Kumpulan script jahil
TXT
Source Code
PDF
Primi passi con Project Tango
Cellys wpa2 hack_en
n|u Dharamsala Humla : Memory Forensic by Tenzin Chokden
Uses of tmux explained
Minion pool - a worker pool for nodejs
Metasploit - Basic and Android Demo
Kumpulan script jahil
Source Code
Primi passi con Project Tango
Ad

Viewers also liked (20)

KEY
Loadrunner
PDF
Preview - Hidden Pearls : Opportunities in Problems
DOC
Fenomenul Placebo Si Medicul Ca Agent Terapeutic Pharma Business (11
PPSX
Presentazione WMO Milan 13 december 2014 $SPY $FTMIB $EUROSTOXX50 $GOLD
PDF
Barbuti
PDF
MOS ESPA
PPT
Diario Blog 0505 0515
PPT
Diario Operativo Blog Gennaio Aprile Maggio 2010 + Serie Storica
PPT
Diario Blog Op Dicembre 2009
PPT
New York Bluejays
DOCX
Lnm fa-27 solicitud para servicios de calibración (12) 2014-07-11-1
PPT
Numeros
PPT
Comportamentele Pozitive
PDF
Marketing Ourselves On Campus (Student Affairs)
PPT
Skstd
PPT
Introducere În Psihologie
PDF
Presentació estrategies metodològiques
PDF
Stralcio Report Zio Romolo - LUGLIO 2015
PPT
Pdi abril2011 (1)
Loadrunner
Preview - Hidden Pearls : Opportunities in Problems
Fenomenul Placebo Si Medicul Ca Agent Terapeutic Pharma Business (11
Presentazione WMO Milan 13 december 2014 $SPY $FTMIB $EUROSTOXX50 $GOLD
Barbuti
MOS ESPA
Diario Blog 0505 0515
Diario Operativo Blog Gennaio Aprile Maggio 2010 + Serie Storica
Diario Blog Op Dicembre 2009
New York Bluejays
Lnm fa-27 solicitud para servicios de calibración (12) 2014-07-11-1
Numeros
Comportamentele Pozitive
Marketing Ourselves On Campus (Student Affairs)
Skstd
Introducere În Psihologie
Presentació estrategies metodològiques
Stralcio Report Zio Romolo - LUGLIO 2015
Pdi abril2011 (1)
Ad

Similar to Winsock (20)

PDF
dSS API by example
PDF
Technical Report Vawtrak v2
PPTX
MFC Message Handling
PPTX
Beginning direct3d gameprogramming01_20161102_jintaeks
PDF
Building an inflight entertainment system controller in twisted
PDF
21 -windows
PDF
Cassandra 2.1 boot camp, Overview
PPTX
PictBridge 05 - PictBridge Library Overview
PDF
WinSock Asynchronous Input/Output
PDF
Extending Flux to Support Other Databases and Data Stores | Adam Anthony | In...
PPTX
KDD 2016 Streaming Analytics Tutorial
PPTX
#2 (UDP)
PPTX
Zeromq - Pycon India 2013
DOC
vbscript-reference book
PDF
Borland star team to tfs simple migration
PDF
TCPIP Client Server program exampleHere is a simple example of .pdf
PDF
Introduction to DirectX 11
ODP
Node js lecture
PDF
Apache Flink Stream Processing
DOCX
network programing lab file ,
dSS API by example
Technical Report Vawtrak v2
MFC Message Handling
Beginning direct3d gameprogramming01_20161102_jintaeks
Building an inflight entertainment system controller in twisted
21 -windows
Cassandra 2.1 boot camp, Overview
PictBridge 05 - PictBridge Library Overview
WinSock Asynchronous Input/Output
Extending Flux to Support Other Databases and Data Stores | Adam Anthony | In...
KDD 2016 Streaming Analytics Tutorial
#2 (UDP)
Zeromq - Pycon India 2013
vbscript-reference book
Borland star team to tfs simple migration
TCPIP Client Server program exampleHere is a simple example of .pdf
Introduction to DirectX 11
Node js lecture
Apache Flink Stream Processing
network programing lab file ,

Recently uploaded (20)

PDF
Getting Started with Data Integration: FME Form 101
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PPTX
The various Industrial Revolutions .pptx
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PPTX
Tartificialntelligence_presentation.pptx
PDF
Getting started with AI Agents and Multi-Agent Systems
PDF
1 - Historical Antecedents, Social Consideration.pdf
PPTX
O2C Customer Invoices to Receipt V15A.pptx
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PDF
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
PPT
What is a Computer? Input Devices /output devices
PPTX
OMC Textile Division Presentation 2021.pptx
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PPTX
TLE Review Electricity (Electricity).pptx
PPTX
observCloud-Native Containerability and monitoring.pptx
PPTX
Final SEM Unit 1 for mit wpu at pune .pptx
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
Enhancing emotion recognition model for a student engagement use case through...
Getting Started with Data Integration: FME Form 101
Univ-Connecticut-ChatGPT-Presentaion.pdf
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
The various Industrial Revolutions .pptx
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Tartificialntelligence_presentation.pptx
Getting started with AI Agents and Multi-Agent Systems
1 - Historical Antecedents, Social Consideration.pdf
O2C Customer Invoices to Receipt V15A.pptx
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
What is a Computer? Input Devices /output devices
OMC Textile Division Presentation 2021.pptx
Group 1 Presentation -Planning and Decision Making .pptx
TLE Review Electricity (Electricity).pptx
observCloud-Native Containerability and monitoring.pptx
Final SEM Unit 1 for mit wpu at pune .pptx
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
A comparative study of natural language inference in Swahili using monolingua...
Enhancing emotion recognition model for a student engagement use case through...

Winsock

  • 2. OutLine Winsock Introduction Project#3 Template MFC CSocket Demo hint
  • 3. Winsock Introduction (See testMain) int APIENTRY _tWinMain(…) main routine make hInstance maps to WndProc while loop for wait message BOOL InitInstance(HINSTANCE , int) CreateWindow Show Window LRESULT CALLBACK WndProc( …) Handle message
  • 4. Winsock Introduction WSAStartup( … ) 通知 Windows Sockets 應用程式要開始網路服務 WSAAsyncSelect (…) WSACleanup() 結束 Windows Sockets 的使用 WSAGETSELECTEVENT(lParam) extract the event code from the lParam in the response to a WSAAsyncSelect() LOWORD(lParam)
  • 5. Events FD_READ: FD_WRITE: FD_CONNECT: FD_ACCEPT: FD_CLOSE:
  • 6. Project#3 Template EditPrintf (HWND hwndEdit, TCHAR * szFormat, ...) EditPrintf(hwndEdit, TEXT("=== Server START ===\r\n")); EditPrintf(hwndEdit, TEXT("=== Accept one new client(%d), List size:%d ===\r\n"), ssock, Socks.size()); case ID_LISTEN: Press the “Listen” button The button’s ID is “ ID_LISTEN ” WM_USER => 0x0400 All Message Numbers below 0x0400 are RESERVED.
  • 7. To Do Fill actions when event happen When FD_READ/FD_WRITE happen ? GET action Target Server I/O Handle them same place ? Handle htm & cgi
  • 8. MFC CSocket 繼承 CSocket 類別 覆寫 OnAccept 等 function
  • 9.  
  • 10.  
  • 11. Demo hint 可以用作業二的任一 Server, 但不能重開 有把握的話 ,Test_case 1&2 可以一起測 Delayed server code 和 hide testcase 會在 demo 前幾天公怖 Timeout 機制請做成選項 還要說明如何做