Commit 16144fbc authored by mrsl2000's avatar mrsl2000

finish. sorry for late i have final exam of math

parent ae6c69ff
Pipeline #699 canceled with stages
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Lab11_server</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=11
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=11
import java.io.IOException;
import java.io.PrintStream;
import java.net.Socket;
import java.util.Scanner;
class ChatRoomServer{
ChatRoomServer(Socket s) throws IOException {
Scanner scan = new Scanner(s.getInputStream());
PrintStream pri = new PrintStream(s.getOutputStream());
pri.println(scan.next());
}
}
\ No newline at end of file
import java.io.IOException;
import java.net.Socket;
public class ClientHandler{
Socket socket = new Socket("0.0.0.0" , 1234);
public ClientHandler() throws IOException {
}
}
\ No newline at end of file
import java.io.IOException;
import java.net.ServerSocket;
public class While{
public static void main(String[] args) throws IOException {
ServerSocket serverSocket = new ServerSocket(1234);
while (true){
System.out.println("Server is listening");
new ChatRoomServer(serverSocket.accept());
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment