Giter VIP home page Giter VIP logo

moviefinder's Introduction

TODO Please edit the following information in this README

  • Name:Xinyu Dai
  • How many hours did it take you to complete this assignment?
    • I spent 30 hours to complete this assignment.
  • Did you collaborate with any other students/TAs/Professors? (Name them below)
    • None.
  • Did you use any external resources? (Cite them below)
    • Beej's Guide to Networking Listed in Project Description.
  • (Optional) What was your favorite part of the assignment?
    • The implementation of client and server communication.
  • (Optional) How would you improve the assignment?
    • Extract all functions applied in the assignment for better reference.

The detail information of the assignment: https://course.ccs.neu.edu/cs5007su19-seattle/assignments/project.html

Final Project: Client-Server

Steps:

  • Write The Client: After started, the client should stay running until the user terminates it. Identify and implement a graceful way to with a server that is not accepting connections. This could be very simple or more complex, but your program should not crash. (It can terminate intentionally, with an informative message.) The client should make a new connection for every query, and close it properly. Limit query from user to 100 characters. Makefile has a target client which generates an executable queryclient (provided; if you need modifications that is fine) Client is started by calling queryclient [ipaddress] [port] Note: localhost is the same as IP 127.0.0.1 If the wrong input is provided when launching the program, print out instructions to run it properly.

  • Write A Simple Server: There is a target in the Makefile called "server", that builds the server. Modify it as/if necessary. Create an executable called "queryserver". Run the server like this: ./queryserver -f [datadir] -p [port], where the -f flag specifies which directory to index, and the -p flag specifies which port the server should be listening on for connections. We'll continue to use the data_tiny, data_small and data directories for data. Copy them into your project directory if you want, or modify the path to point at your data folders. If improper arguments are provided when launching, handle it gracefully and provide a message specifying correct usage.

    Handling graceful could be either providing defaults or specifying the appropriate usage. Run your server with valgrind to ensure you're handling memory properly. There should be no memory in use after the server is killed. The server can be killed gracefully by hitting ctrl+C. There is a function in QueryServer.c (void sigint_handler(int sig)) that captures the ctrl+C event and does some cleanup. You might want to take advantage of this, but you don't need to worry about the details of it yet.

  • Write Multi Servers: Makefile has a target multiserver which generates an executable multiserver Server is started by calling multiserver -f [dirname] -p [port] There is an optional flag -d for debugging. When the -d is passed when starting the multiserver, please ask the new process to sleep for 10 seconds before handling the query. If the wrong input is provided, print out instructions to run it properly. Run your code with valgrind to ensure you handled memory properly. You might want to introduce sleeps in your code to help test multiple connections. Commit your code! And push it to github, if you haven't done this yet.

moviefinder's People

Contributors

sarahdai avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.