2 Learning Outcomes Pada akhir pertemuan ini, diharapkan mahasiswa akan mampu : Mendemokan program aplikasi pada sistem operasi windows dengan menggunakan Windows Socket.
3 Outline Materi What is Socket ? What is Winsock ? The Socket History Winsock History Supported Programming Models Elements of Winsock Programming General Program Flow Iterative Server pada Windows Concurrent Server pada Windows
4 WinSock What is Socket? –Socket is is a programming model originally designed for network programming under UNIX operating systems. What is Winsock? –Winsock stands for Windows Socket; –An Application Programming Interface for network programming under the Microsoft Windows operating systems. –It is modeled after UNIX Socket but with platform-specific features added.
8 Supported Programming Models –Synchronous Model –Asynchronous Model Synchronous Model –Makes use of blocking-mode I/O function calls. –What is Blocking I/O? Guaranteed either function completed successfully or failed upon function return The calling code has to wait (i.e. block) for the function to complete before continuing execution
9 WinSock Asynchronous Model –Makes use of non-blocking-mode I/O function calls. What is Non-Blocking I/O? –Guaranteed function will return immediately: –The calling code has to check if the function has completed before return. –If not, the calling code will have to handle that itself.(e.g. check at a later time, call the function again, wait for asynchronous event to trigger, etc.)
16 Online References References –The Winsock 1.1 and 2.0 Specifications –Winsock Resource Centre at http://www.winsock.com –Windows socket programming resources at http://www.sockets.com –Visual C++ On-Line Help and Programming Reference