Git Product home page Git Product logo

codeu_project_2017's Introduction

CODEU CHAT SERVER | README

DISCLAIMER

CODEU is a program created by Google to develop the skills of future software engineers. This project is not an official Google Product. This project is a playground for those looking to develop their coding and software engineering skills.

ENVIRONMENT

All instructions here are relative to a LINUX environment. There will be some differences if you are working on a non-LINUX system. We will not support any other development environment.

This project was built using JAVA 7. It is recommended that you install JAVA 7 when working with this project.

GETTING STARTED

  1. To build the project:

    $ sh clean.sh
    $ sh make.sh
    
  2. To test the project:

    $ sh test.sh
    
  3. To run the project you will need to run both the client and the server. Run the following two commands in separate shells:

    $ sh run_server.sh <team_id> <team_secret> <port> <persistent-dir>
    $ sh run_client.sh <host> <port>
    

    You must specify the following startup arguments for `run_server.sh:

    • <team_id> and <team_secret>: a numeric id for your team, and a secret code, which are used to authenticate your server with the Relay server. You can specify any integer value for <team_id>, and a value expressed in hexadecimal format (using numbers 0-9 and letters in the range A-F) for <team_secret> when you launch the server in your local setup since it will not connect to the Relay server.

    • <port>: the TCP port that your Server will listen on for connections from the Client. You can use any value between 1024 and 65535, as long as there is no other service currently listening on that port in your system. The server will return an error:

      java.net.BindException: Address already in use (Bind failed)
      

      if the port is already in use.

    • <persistent-dir>: the path where you want the server to save data between runs.

    The startup arguments for run_client.sh are the following:

    • <host>: the hostname or IP address of the computer on which the server is listening. If you are running server and client on the same computer, you can use localhost here.
    • <port>: the port on which your server is listening. Must be the same port number you have specified when you launched run_server.sh.

All running images write informational and exceptional events to log files. The default setting for log messages is "INFO". You may change this to get more or fewer messages, and you are encouraged to add more LOG statements to the code. The logging is implemented in codeu.chat.util.Logger.java, which is built on top of java.util.logging.Logger, which you can refer to for more information.

In addition to your team's client and server, the project also includes a Relay Server and a script that runs it (run_relay.sh). This is not needed to get started with the project.

Finding your way around the project

All the source files (except test-related source files) are in ./src/codeu/chat. The test source files are in ./test/codeu/chat. If you use the supplied scripts to build the project, the .class files will be placed in ./bin. There is a ./third_party directory that holds the jar files for JUnit (a Java testing framework). Your environment may or may not already have this installed. The supplied scripts use the version in ./third_party.

Finally, there are some high-level design documents in the project Wiki. Please review them as they can help you find your way around the sources.

Source Directories

The major project components have been separated into their own packages. The main packages/directories under src/codeu/chat are:

codeu.chat.client

Classes for building the two clients (codeu.chat.ClientMain and codeu.chat.SimpleGuiClientMain).

codeu.chat.server

Classes for building the server (codeu.chat.ServerMain).

codeu.chat.relay

Classes for building the Relay Server (codeu.chat.RelayMain). The Relay Server is not needed to get started.

codeu.chat.common

Classes that are shared by the clients and servers.

codeu.chat.util

Some basic infrastructure classes used throughout the project.

codeu_project_2017's People

Contributors

crepricg avatar jason-cooke avatar kevinworkman avatar theycallmemac avatar vaage avatar wgenemorgan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

codeu_project_2017's Issues

Bug when converting Uuid to String and vice versa

In Uuid, ids are 32 bit unsigned integers. As Java does not supported unsigned integers, when converting to a string, the 32 bit integer is converted to a long so that it can be written to a string as a positive integer (using all 32 bits).

When converting from a string to a Uuid, the integer value is not handled correctly as values that would be acceptable as a 32 bit unsigned integer fail to be parsed as a 32 bit signed integer.

If the id value of a Uuid is 0xFFFFFFFF and is converted to the string 4294967295. When 4294967295 is parsed, it will fail as it is not expressible as a 32 bit signed integer.

Parsing needs to parse the unsigned integer and convert and store the bit pattern correctly in a signed integer.

Relay Is Not Fully Integrated

Right now in the server there is code to merge the data from the relay into the server's copy - but it is never called. The integration with the relay should be finished.

Generalize third-party loading

Right now in our build and run scripts we specifically state which third-party jar files to load. This can be generalized and will make it easier for others to add dependencies.

Get Builds To Work On Windows

Many students run Windows. We know that some student have gotten the project to work with Cygwin but it would be better if CodeU supported Windows. The build and run system should be updated to work on Linux and Windows.

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.