Autoren der Dateien Main Client und PipeTest korrigiert.
This commit is contained in:
parent
8ea1060c44
commit
2326dd6965
2 changed files with 17 additions and 29 deletions
|
@ -14,7 +14,6 @@
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package test;
|
package test;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
|
@ -22,40 +21,34 @@ import java.net.*;
|
||||||
import utils.Message;
|
import utils.Message;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author berdan
|
* Dies ist eine Test-Klasse
|
||||||
|
*
|
||||||
|
* @author berdan, eichehome
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
|
||||||
Dies ist eine Test-Klasse
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public class MainClient {
|
public class MainClient {
|
||||||
|
|
||||||
public MainClient() throws IOException, ClassNotFoundException {
|
public MainClient() throws IOException, ClassNotFoundException {
|
||||||
System.out.println("[CLIENT] START");
|
System.out.println("[CLIENT] START");
|
||||||
Socket socket = new Socket( "localhost", 1236 );
|
Socket socket = new Socket("localhost", 1236);
|
||||||
System.out.println("[CLIENT] Debug1");
|
System.out.println("[CLIENT] Debug1");
|
||||||
ObjectOutputStream oboust = new ObjectOutputStream(socket.getOutputStream());
|
ObjectOutputStream oboust = new ObjectOutputStream(socket.getOutputStream());
|
||||||
System.out.println("[CLIENT] Debug2");
|
System.out.println("[CLIENT] Debug2");
|
||||||
ObjectInputStream obinstr = new ObjectInputStream(socket.getInputStream());
|
ObjectInputStream obinstr = new ObjectInputStream(socket.getInputStream());
|
||||||
System.out.println("[CLIENT] START1");
|
System.out.println("[CLIENT] START1");
|
||||||
Message senden = new Message( "berdan", "test" );
|
Message senden = new Message("berdan", "test");
|
||||||
System.out.println(senden); //nickname=berdan, message=test
|
System.out.println(senden); //nickname=berdan, message=test
|
||||||
|
|
||||||
// Message senden
|
// Message senden
|
||||||
oboust.writeObject(senden);
|
oboust.writeObject(senden);
|
||||||
oboust.flush();
|
oboust.flush();
|
||||||
System.out.println("[CLIENT] NACHRICHT GESENDET");
|
System.out.println("[CLIENT] NACHRICHT GESENDET");
|
||||||
|
|
||||||
// Message erhalten
|
// Message erhalten
|
||||||
|
|
||||||
Object erhalten = null;
|
Object erhalten = null;
|
||||||
|
|
||||||
while(erhalten==null){
|
while (erhalten == null) {
|
||||||
erhalten = obinstr.readObject();
|
erhalten = obinstr.readObject();
|
||||||
System.out.println(erhalten);
|
System.out.println(erhalten);
|
||||||
}
|
}
|
||||||
System.out.println("[CLIENT] NACHRICHT ERHALTEN");
|
System.out.println("[CLIENT] NACHRICHT ERHALTEN");
|
||||||
System.out.println(erhalten); //nickname=berdan, message=test
|
System.out.println(erhalten); //nickname=berdan, message=test
|
||||||
|
|
|
@ -17,15 +17,10 @@
|
||||||
package test;
|
package test;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Dies ist eine Test-Klasse
|
||||||
* @author berdan
|
*
|
||||||
|
* @author berdan, eichehome
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
|
||||||
Dies ist eine Test-Klasse
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
public class PipeTest {
|
public class PipeTest {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
@ -66,7 +61,7 @@ public class PipeTest {
|
||||||
System.out.println("Letztes Element: " + pipe.lastElement);
|
System.out.println("Letztes Element: " + pipe.lastElement);
|
||||||
|
|
||||||
ArrayHelper test = new ArrayHelper();
|
ArrayHelper test = new ArrayHelper();
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue