sync_sockets_programming

sync_sockets_programming - IEG 4180 IEG 4180 Network...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: IEG 4180 IEG 4180 Network Software Design and Programming Network Software Design and Programming Synchronous Sockets Programming Synchronous Sockets Programming IEG4180: Network Software Design and Programming - Synchronous Sockets Programming 2 Copyright Jack Y. B. Lee All Rights Reserved Contents 1. Introduction 2. The Socket Concept 3. Windows Sockets 4. I/O Programming Models 5. Synchronous Programming 6. Winsock Programming Tools 7. Basic Winsock APIs 8. Addressing and Naming 9. Program Flow 10. Core Functions 11. Case Study – NetConsole 12. I/O Multiplexing 13. I/O Multiplexing Using Polling 14. I/O Multiplexing Using select() 15. Concurrent NetConsole 16. Final Remarks on select() IEG4180: Network Software Design and Programming - Synchronous Sockets Programming 3 Copyright Jack Y. B. Lee All Rights Reserved 1. Introduction • Principles of Programming I/O Network Application Software Data Data I/O Device (e.g., Disk, Network) I/O System Structure (e.g., File, Socket) Application Programming Interface Logical structures (e.g., a file or a socket) API includes- Constants, data types/structures- A library of functions IEG4180: Network Software Design and Programming - Synchronous Sockets Programming 4 Copyright Jack Y. B. Lee All Rights Reserved 1. Introduction • Example: File I/O API in Visual C++ Header file: <stdio.h> Some API functions: int _open( const char *filename, int oflag [, int pmode] ); int _read( int handle, void *buffer, unsigned int count ); int _write( int handle, const void *buffer, unsigned int count ); int _close( int handle ); Implementation/Libraries: LIBC.LIB Single thread static library, retail version LIBCMT.LIB Multithread static library, retail version MSVCRT.LIB Import library for MSVCRT.DLL, retail version IEG4180: Network Software Design and Programming - Synchronous Sockets Programming 5 Copyright Jack Y. B. Lee All Rights Reserved 1. Introduction • Example: File I/O API in Visual C++ ¡ The Development Process Source Files (*.c, *.cpp) Header Files (stdio.h) #include<stdio.h> C/C++ Preprocessor Compile Object Files (*.obj) Import/Static Libraries (*.lib) C/C++ Compiler Linker Program Binary Executable (*.exe) Linker ‘Compile’ ‘Build’ or ‘Make’ IEG4180: Network Software Design and Programming - Synchronous Sockets Programming 6 Copyright Jack Y. B. Lee All Rights Reserved 1. Introduction • Example: File I/O API in Visual C++ ¡ The Program Execution Process Program Binary Executable (*.exe) File System Dynamic Libs (e.g., mscvrt.dll) Application Process Process Creation Runtime Library (mscvrt.dll) File System IEG4180: Network Software Design and Programming - Synchronous Sockets Programming 7 Copyright Jack Y. B. Lee All Rights Reserved 1. Introduction • Socket I/O API in Visual C++/Winsock Header file: <winsock2.h> Some API functions: SOCKET socket (int af, int type, int protocol ); int connect (SOCKET s, const struct sockaddr *name, int namelen ); int send (SOCKET s, const char *buf, int len, int flags );...
View Full Document

This note was uploaded on 05/18/2010 for the course INFORMATIO IEG 4180 taught by Professor Jacky.b.lee during the Spring '09 term at CUHK.

Page1 / 111

sync_sockets_programming - IEG 4180 IEG 4180 Network...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online