1 / 11

Sockets Programming

Sockets Programming. Network API Socket Structures Socket Functions. 3 / 1 - 11. Network Application Programming Interface (API). The services provided by the operating system that provide the interface between application and protocol software. 3 / 2 - 11. Network API.

Download Presentation

Sockets Programming

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

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

  3. 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 / 3 - 11

  4. TCP/IP • There are a variety of APIs for use with TCP/IP: • Sockets • TLI • Winsock • MacTCP 3 / 4 - 11

  5. 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 / 5 - 11

  6. 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. 3 / 6 - 11

  7. 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? 3 / 7 - 11

  8. 3 / 8 - 11

  9. Pengenalan winsock pada Visual Basic atau Visual C++ 3 / 9 - 11

  10. Pengenalan winsock pada Visual Basic atau Visual C++ 3 / 10 - 11

  11. Pengenalan winsock pada Visual Basic atau Visual C++ 3 / 11 - 11

More Related