Android Open Source - LotR_Risk Donnees Connexion






From Project

Back to project page LotR_Risk.

License

The source code is released under:

GNU General Public License

If you think the Android project LotR_Risk listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.net;
//  w w w.  j a  va  2s .c o m
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.Socket;

public class DonneesConnexion {

  private Reception in;
  private Emission out; 
  private Socket socket;
  private boolean connectionReussi;
  
  
  public DonneesConnexion(String servAddr, int port) {
    Boolean reussi = this.connexionServeur(servAddr, port);
    if (reussi)
      this.connectionReussi = true;
    else
      this.connectionReussi = false;
  }

  private Boolean connexionServeur(String servAddr, int port)
  {
    try {
      this.socket = new Socket();
      this.socket.setSoTimeout(5000);
      this.socket.connect(new InetSocketAddress(servAddr, port));
      this.out = new Emission(this.socket.getOutputStream(), this);
      this.in = new Reception(this.socket.getInputStream());
      return true;
    } catch (IOException e) {
      e.printStackTrace();
      return false;
    }
  }
  
  public boolean get_Connexion_Reussi() {
    return this.connectionReussi;
  }

  public Emission getOutput() {
    return out;
  }
  
  public Reception getInput() {
    return this.in;
  }
  
  public void close() throws IOException {
    out.close();
    in.close();
  }
  
  public String getString() throws IOException, ClassNotFoundException {
    return this.in.getString();
  }
  
}




Java Source Code List

com.activities.InitGameActivity.java
com.activities.StartUpActivity.java
com.custom.Compteur.java
com.custom.HelperCouleur.java
com.custom.Liste_Couleur.java
com.custom.ServiceReseau.java
com.game.InterfaceLOTR.java
com.game.LOTR_Data.java
com.net.DonneesConnexion.java
com.net.Emission.java
com.net.Reception.java
com.net.TacheConnexion.java
com.net.TacheTransmission.java
net.Emission.java
net.EnvoiReception.java
net.Reception.java
net.TestClient.java
net.ThreadConnexion.java
objects.Client.java
objects.Joueur.java
objects.Joueur.java
objects.Region.java
objects.Region.java
objects.Territoire.java
objects.Territoire.java
objects.TypeTerritoire.java
objects.TypeTerritoire.java
swingGUI.InfoJoueur.java
swingGUI.InfoTerritoire.java
swingGUI.Logger.java
swingGUI.MainWindow.java
swingGUI.Main.java
swingGUI.Map.java
utils.InterfaceLOTR.java
utils.LOTR_Data.java
utils.LOTR_Game.java
utils.Main.java