1 / 7

Sistemas Operativos Distribuidos Prácticas

Sistemas Operativos Distribuidos Prácticas. Justo N. Hidalgo Sanz Universidad Antonio de Nebrija 2002/03. Tabla de Contenidos. Práctica I: Java Sockets Práctica II: Java RMI Práctica III: Java IDL. Práctica I: Java Sockets. Práctica I: Sockets (I). Práctica I: Sockets (II). Servidor:

Download Presentation

Sistemas Operativos Distribuidos Prácticas

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. Sistemas Operativos DistribuidosPrácticas Justo N. Hidalgo Sanz Universidad Antonio de Nebrija 2002/03

  2. Tabla de Contenidos • Práctica I: Java Sockets • Práctica II: Java RMI • Práctica III: Java IDL Sistemas Distribuidos - Nebrija - Justo Hidalgo

  3. Práctica I: Java Sockets

  4. Práctica I: Sockets (I) Sistemas Distribuidos - Nebrija - Justo Hidalgo

  5. Práctica I: Sockets (II) • Servidor: • try { • serverSocket = new ServerSocket(4444); • }catch (IOException e) { • System.out.println("Could not listen on port: 4444"); System.exit(-1); • } • Socket clientSocket = null; • try { • clientSocket = serverSocket.accept(); • } catch (IOException e) { • System.out.println("Accept failed: 4444"); • System.exit(-1); • } Sistemas Distribuidos - Nebrija - Justo Hidalgo

  6. Práctica I: Sockets (III) • Resto del algoritmo del servidor: • Obtiene los streams de entrada y salida del socket. • Abre los lectores y escritores sobre ellos. • Inicia la comunicación con el cliente escribiendo en el socket. • Se comunica con el cliente leyendo y escribiendo en el socket (generalmente en un bucle). • Cierra streams. • Cierra el socket. Sistemas Distribuidos - Nebrija - Justo Hidalgo

  7. Práctica I: Sockets (IV) • En el caso del cliente: • Abre un socket. • Abre un stream de entrada y otro de salida sobre el socket. • Lee y escribe al stream de acuerdo con el protocolo del servidor. • Cierra los streams. • Cierra el socket. Sistemas Distribuidos - Nebrija - Justo Hidalgo

More Related