TAILIEUCHUNG - Networking and Network Programming 2 TCP/IP phần 8

con trỏ đến dữ liệu được trả lại và các số nguyên chỉ bởi pnLen chứa số lượng byte trong bộ đệm dữ liệu trở lại. Về lỗi, NULL được trả về. kiểm tra xem nếu có dữ liệu để lấy loại bỏ các dòng dữ liệu từ danh sách pStreamData con trỏ đến dữ liệu được tạo ra lỗi gửi pDataWritten | Part III WinSock Class Library pointer to the data is returned and the integer pointed to by pnLen contains the number of bytes in the data buffer returned. On error NULL is returned. CStreamSocket Read Read data that has been received by the socket. ll ll This function takes a pointer to an integer that will be filled ll with the length of the data read. ll ll A pointer to the data is returned on success. The application ll using this object must free this pointer. NULL is returned on failure. ll LPVOID CStreamSocket Read LPINT pnLen LPVOID pData NULL ll check to see if there is data to retrieve if ll remove the stream data from the list LPSTREAMDATA pStreamData LPSTREAMDATA pData pStreamData- pData pnLen pStreamData- nLen delete pStreamData return pData CStreamSocket OnWinSockEvent The OnWinSockEvent member function handles the asynchronous event notification messages sent by the WinSock subsystem. The WinSock events of interest are FD_READ FD_WRITE and FD_CLOSE. If the socket is a server interest is also expressed in the FD_ACCEPT event. For clients FD_CONNECT is the additional event of interest. Interest in these events is registered by the call to WSAAsyncSelect in the CreateSocket member function. The Microsoft Foundation Class message map facility is used to map the CWINSOCK_EVENT_NOTIFICATION message to the OnWinSockEvent function. The message map looks like the following ll message map BEGIN_MESSAGE_MAP CStreamSocket CWnd ll AFX_MSG_MAP CStreamSocket afx_msg_map ON_MeSSAGE CWINSOCK_EVENT_NOTIFICATION OnWinSockEvent END_MESSAGE_MAP OnWinSockEvent checks for errors and if there are none executes an appropriate message handler. For the FD_ACCEPT FD_CONNECT and FD_CLOSE events a message is simply relayed to the parent of the stream object. Before the FD_CLOSE message is relayed to the Chapter 12 CStreamSocket application by the sending of the CWINSOCK_LOST_CONNECTION message a check is made for additional data arriving

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.