Presentation is loading. Please wait.

Presentation is loading. Please wait.

PEMROGRAMAN JARINGAN Sockets Programming Network API Socket Structures Socket Functions 3 / 1 - 11.

Similar presentations


Presentation on theme: "PEMROGRAMAN JARINGAN Sockets Programming Network API Socket Structures Socket Functions 3 / 1 - 11."— Presentation transcript:

1 PEMROGRAMAN JARINGAN Sockets Programming Network API Socket Structures Socket Functions 3 /

2 PEMROGRAMAN JARINGAN Network Application Programming Interface (API) The services provided by the operating system that provide the interface between application and protocol software. 3 /

3 PEMROGRAMAN JARINGAN Network API Generic Programming Interface. Support for message oriented and connection oriented communication. Uses the existing I/O services Operating System independence. Support multiple communication protocol suites (families): IPv4, IPv6, XNS, UNIX. Provide special services for Client and Server? 3 /

4 PEMROGRAMAN JARINGAN TCP/IP There are a variety of APIs for use with TCP/IP: Sockets TLI Winsock MacTCP 3 /

5 PEMROGRAMAN JARINGAN Functions Socket Specify local and remote communication endpoints Initiate a connection Wait for incoming connection Send and receive data Terminate a connection gracefully Error handling 3 /

6 PEMROGRAMAN JARINGAN 3 / Bind The bind() system call is used to assign an address to an existing socket. bind returns 0 if successful or -1 on error. calling bind() assigns the address specified by the sockaddr structure to the socket descriptor.

7 PEMROGRAMAN JARINGAN 3 / Fungsi Dari Bind Server would like to bind to a well known address (port number). Client can bind to a specific port. Client can ask the O.S. to assign any available port number. Clients typically don’t care what port they are assigned When you call bind you can tell it assign you any available port How can you find out what your IP address is so you can tell bind() ? There is no realistic way for you to know the right IP address to give bind() - what if the computer has multiple network interfaces?

8 PEMROGRAMAN JARINGAN 3 /

9 PEMROGRAMAN JARINGAN 3 / Pengenalan winsock pada Visual Basic atau Visual C++

10 PEMROGRAMAN JARINGAN 3 / Pengenalan winsock pada Visual Basic atau Visual C++

11 PEMROGRAMAN JARINGAN 3 / Pengenalan winsock pada Visual Basic atau Visual C++


Download ppt "PEMROGRAMAN JARINGAN Sockets Programming Network API Socket Structures Socket Functions 3 / 1 - 11."

Similar presentations


Ads by Google