Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MyServer {
- ServerSocket sSoc;
- Socket soc;
- ServerThread t;
- int porta = 12345;
- public void main(String Args[]) {
- try {
- sSoc = new ServerSocket(porta);
- System.out.println("Server avviato in ascolto sulla porta 12345");
- while(true) {
- soc = sSoc.accept();
- t = new ServerThread(soc);
- t.start();
- System.out.println("Avviato thread: " + t.getName());
- }
- }catch(IOException e){
- System.out.println(e);
- }
- }
- }
- public class partecipante implements Serializable {
- final static long serialVersionUID = 1;
- String nome;
- String cognome;
- String cellulare;
- String email;
- String codiceCorso;
- String idOperatore;
- public partecipante (String n, String co, String ce, String e, String cod, String id) {
- this.nome= n;
- this.cognome= co;
- this.cellulare= ce;
- this.email= e;
- this.codiceCorso= cod;
- this.idOperatore = id;
- }
- public String getNome() {
- return nome;
- }
- public String getCognome() {
- return cognome;
- }
- public String getCellulare() {
- return cellulare;
- }
- public String getEmail() {
- return email;
- }
- public String getCodiceCorso() {
- return codiceCorso;
- }
- public String getIdOperatore() {
- return idOperatore;
- }
- }
- public class ServerThread extends Thread {
- Socket soc;
- public ServerThread(Socket s) {
- soc = s;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement