Dsy Network www | forum | my | didattica | howto | wiki | el goog | stats | blog | dona | rappresentanti
Homepage
 Register   Calendar   Members  Faq   Search  Logout 
.dsy:it. : Powered by vBulletin version 2.3.1 .dsy:it. > Didattica > Corsi N - Z > Reti di calcolatori > [java] due esercizi non funzionanti!
  Last Thread   Next Thread
Author
Thread    Expand all | Contract all    Post New Thread    Post A Reply
Collapse
No?Ya!
il supercoatto

User info:
Registered: Oct 2002
Posts: 187 (0.02 al dì)
Location: Berghèm
Corso: Tecnologie Della Comunicazione
Anno: ...fuori corso...
Time Online: 1 Day, 9:55:47 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged
[java] due esercizi non funzionanti!

Posto un paio di esercizi che non vanno!
Se qualcuno ci vuol dare un'occhiata ben venga...

import java.io.*;
import java.net.*;
class ServerThread extends Thread{
Socket socketConnessione = null;
String testoServer = null;
public ServerThread(Socket socketCon, String text) throws Exception{
this.socketConnessione = socketCon;
this.testoServer = text;
}
public void run(){
try{
DataOutputStream testoOut = new DataOutputStream(socketConnessione.getOutputStream());
if (testoServer.equals(null)){
testoOut.writeBytes(testoServer+666);
}else{
testoOut.writeBytes(testoServer);
}

}catch(Exception e){}
}

}

class ServerConcorrente{
public static void main(String[] args) throws Exception{
ServerSocket servSock = new ServerSocket(6789);
while(true){
Socket socketConnessione = servSock.accept();
ServerThread serverAttivo = new ServerThread(servSock,args[0]);
serverAttivo.start();
}
}
}

in questo esercizio in fase di compilazione non mi sgama il costruttore... perchè?

L'uso sarebbe java ServerConcorrente StringaDaMandare

non sto a postare il client...

__________________
http://www.noya.it
--------
Delta9 Drum&Bass Crew
--------
Associazione Orange

01-03-2005 10:41
Click Here to See the Profile for No?Ya! Click Here to See the Blog of No?Ya! Click here to Send No?Ya! a Private Message Visit No?Ya!'s homepage! Find more posts by No?Ya! Add No?Ya! to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
yeah
.grande:maestro.

User info:
Registered: Nov 2003
Posts: 1644 (0.21 al dì)
Location: Cologno Monzese
Corso: Informatica Magistrale
Anno: II
Time Online: 12 Days, 21:36:41 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Perchè il costruttore accetta una Socket mentre gli passi una ServerSocket ;)

__________________
?

01-03-2005 22:00
Click Here to See the Profile for yeah Click here to Send yeah a Private Message Find more posts by yeah Add yeah to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
All times are GMT. The time now is 09:38.    Post New Thread    Post A Reply
  Last Thread   Next Thread
Show Printable Version | Email this Page | Subscribe to this Thread | Add to Bookmarks

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is ON
 

Powered by: vBulletin v2.3.1 - Copyright ©2000 - 2002, Jelsoft Enterprises Limited
Mantained by dsy crew (email) | Collabora con noi | Segnalaci un bug | Archive | Regolamento | Licenze | Thanks | Syndacate
Pagina generata in 0.191 seconds (60.47% PHP - 39.53% MySQL) con 25 query.