1 / 10

PEMOGRAMAN SOCKET

PEMOGRAMAN BERBASIS JARINGAN. PEMOGRAMAN SOCKET. Ilustrasi C-S Computing. a client, a server, and network. Request. Client. Server. Network. Result. Client machine. Server machine. Protokol TCP dan UDP menggunakan port untuk mengumpulkan data dari komputer jaringan. Memahami Port.

Download Presentation

PEMOGRAMAN SOCKET

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. PEMOGRAMAN BERBASIS JARINGAN PEMOGRAMAN SOCKET

  2. Ilustrasi C-S Computing a client, a server, and network Request Client Server Network Result Client machine Server machine

  3. Protokol TCP dan UDP menggunakan port untuk mengumpulkan data dari komputer jaringan. Memahami Port server Port TCP Client app app app app port port port port TCP or UDP Packet Data port# data

  4. Memahami Port • Port sebuah terminal virtual yang digambarkandengansebuahNilai (integer) sebagaitempatkeluarmasuk data • Beberapa port telahdirekomendasikansebagaisebuah services antara lain : • ftp 21/tcp • telnet 23/tcp • smtp 25/tcp • login 513/tcp • User level process/services generally use port number value >= 1024

  5. Sockets • Sockets provide an interface for programming networks at the transport layer. • Network communication using Sockets is very much similar to performing file I/O • In fact, socket handle is treated like file handle. • The streams used in file I/O operation are also applicable to socket-based I/O • Socket-based communication is programming language independent. • That means, a socket program written in Java language can also communicate to a program written in Java or non-Java socket program.

  6. Socket Communication • A server (program) runs on a specific computer and has a socket that is bound to a specific port. The server waits and listens to the socket for a client to make a connection request. server Connection request port Client

  7. Socket Communication • If everything goes well, the server accepts the connection. Upon acceptance, the server gets a new socket bounds to a different port. It needs a new socket (consequently a different port number) so that it can continue to listen to the original socket for connection requests while serving the connected client. server port port Client port Connection

  8. Server Client Implementasi PHP Sockets ServerSocket(8000) Output/write stream Input/read stream Socket(“127.0.0.1”, 8000) It can be host_name like “informatika.itp.ac.id”

  9. ContohImplementasi PHP dalamPemograman Sockets • Buatlah file : - stream_server.php - stream_client.php - formsockclient.php • Buka browser, lalu aktifkan stream_server.php, buka browser lain aktifkan formsockclient.php

  10. Tugas Kelompok • Buatlah program Chatting LAN / program Chatting berbasis pemograman jaringan • Buatkan laporan hardcopy atas tugas ini. • Masing-masing kelompok akan dilakukan pengujian atas tugas nya.

More Related