• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Winsock
 

Winsock

on

  • 775 views

 

Statistics

Views

Total Views
775
Views on SlideShare
775
Embed Views
0

Actions

Likes
1
Downloads
6
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Winsock Winsock Presentation Transcript

    • 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 === "));
        • EditPrintf(hwndEdit, TEXT("=== Accept one new client(%d), List size:%d === "), 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 機制請做成選項 還要說明如何做