Autoren der Dateien Main Client und PipeTest korrigiert.

This commit is contained in:
eichehome 2021-05-16 20:09:23 +02:00
parent 8ea1060c44
commit 2326dd6965
2 changed files with 17 additions and 29 deletions

View file

@ -14,7 +14,6 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package test;
import java.io.*;
@ -22,40 +21,34 @@ import java.net.*;
import utils.Message;
/**
* @author berdan
* Dies ist eine Test-Klasse
*
* @author berdan, eichehome
*/
/*
Dies ist eine Test-Klasse
*/
public class MainClient {
public MainClient() throws IOException, ClassNotFoundException {
System.out.println("[CLIENT] START");
Socket socket = new Socket( "localhost", 1236 );
System.out.println("[CLIENT] START");
Socket socket = new Socket("localhost", 1236);
System.out.println("[CLIENT] Debug1");
ObjectOutputStream oboust = new ObjectOutputStream(socket.getOutputStream());
System.out.println("[CLIENT] Debug2");
ObjectInputStream obinstr = new ObjectInputStream(socket.getInputStream());
System.out.println("[CLIENT] START1");
Message senden = new Message( "berdan", "test" );
ObjectInputStream obinstr = new ObjectInputStream(socket.getInputStream());
System.out.println("[CLIENT] START1");
Message senden = new Message("berdan", "test");
System.out.println(senden); //nickname=berdan, message=test
// Message senden
oboust.writeObject(senden);
oboust.flush();
System.out.println("[CLIENT] NACHRICHT GESENDET");
// Message erhalten
Object erhalten = null;
while(erhalten==null){
erhalten = obinstr.readObject();
System.out.println(erhalten);
while (erhalten == null) {
erhalten = obinstr.readObject();
System.out.println(erhalten);
}
System.out.println("[CLIENT] NACHRICHT ERHALTEN");
System.out.println(erhalten); //nickname=berdan, message=test

View file

@ -17,15 +17,10 @@
package test;
/**
*
* @author berdan
* Dies ist eine Test-Klasse
*
* @author berdan, eichehome
*/
/*
Dies ist eine Test-Klasse
*/
public class PipeTest {
public static void main(String[] args) {
@ -66,7 +61,7 @@ public class PipeTest {
System.out.println("Letztes Element: " + pipe.lastElement);
ArrayHelper test = new ArrayHelper();
*/
*/
}
}