Network Client-Server Terminology A client initiates communication A server waits for incoming requests Integrated model (e.g. server as client) Does TCP/IP care? Client-Server Paradigms Message passing (Synch and Asynch) Remote Procedure Call (Syncg and Asynch) 4 / 1 - 10
Protocol Client Server 4 / 2 - 10
Client-Server Communication Models Point-to-point Vs. Multi-point/Group – A client to multiple servers – A server to multiple clients Broadcast Vs. Multicast Connection-oriented Vs. Connectionless 4 / 3 - 10
Servers Design Issues System Ports Vs. User Ports Statefull Vs. Stateless Servers Privileges and Complexity: authentication, authorization, data sharing, privacy, protection Robustness and Reliability Client or Message Independent Client or Message Independent (dispatching) Concurrency - Multi-processes - Multi-threaded - I/O Multiplexing - Asynchronous I/O 4 / 4 - 10
Client Design Issues Server Independent (dispatching) Stateless Protocol/Messages (e.g. slide tool) Rich and Flexible Parameters (e.g. telnet ) 4 / 5 - 10
Praktek Membuat komunikasi Client server Agar terbentuk menjadi jaringan komunikasi client server kita haruslah membuat 2 buah form yaitu: 1. Form Server sebagai sentral koneksi 2. Form Client sebagai user yang melakukan koneksi Pada jaringan Client –Server antara client dengan server haruslah menggunakan port yang sama, agar terjadi komunikasi 4 / 6 - 10
Buat Form Server seperti GUI (Graphical User Interface) di bawah ini Namakan winsock1 dengan Wserver 4 / 7 - 10
4 / 8 - 10 Lalu tuliskan code dibawah ini pada text form tersebut Private IP As String Private Sub Command1_Click() End End Sub Private Sub Form_Load() Text1.Text = Wserver.LocalIP Wserver.LocalPort = 5050 Wserver.Listen Private Sub Form_Unload(Cancel As Integer) Wserver.Close Private Sub Wserver_ConnectionRequest(ByVal requestID As Long) If Wserver.State <> sckClosed Then Wserver.Close Wserver.Accept requestID List1.AddItem "Client terkoneksi" 4 / 8 - 10
Buat Form Client Seperti GUI (Graphical User Interface) di bawah ini Namakan winsock1 dengan wclient 4 / 9 - 10
4 / 10 - 10 Lalu tuliskan codeng dibawah ini pada text form tersebut Private IP As String Private Sub Command2_Click() Unload Me End Sub Private Sub Form_Load() Text2.Text = Wclient.LocalIP IP = InputBox("Masukan IP Server: (contoh : 141.108.1.76)") Wclient.Connect IP, 5050 4 / 10 - 10