Skip to content

Commit cc2f356

Browse files
github-actionsgithub-actions
github-actions
authored and
github-actions
committed
Formatted with Google Java Formatter
1 parent c571e02 commit cc2f356

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/com/examplehub/basics/network/HttpServerExample.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@ public class HttpServerExample {
99
public static void main(String[] args) throws IOException {
1010
ServerSocket ss = new ServerSocket(8080);
1111
System.out.println("server is running...");
12-
for (;;) {
12+
for (; ; ) {
1313
Socket sock = ss.accept();
1414
System.out.println("connected from " + sock.getRemoteSocketAddress());
1515
new Handler(sock).start();
1616
}
1717
}
1818
}
19+
1920
class Handler extends Thread {
2021
Socket sock;
2122

@@ -47,7 +48,7 @@ private void handle(InputStream input, OutputStream output) throws IOException {
4748
if (first.startsWith("GET / HTTP/1.")) {
4849
requestOk = true;
4950
}
50-
for (;;) {
51+
for (; ; ) {
5152
String header = reader.readLine();
5253
if (header.isEmpty()) { // 读取到空行时, HTTP Header读取完毕
5354
break;

0 commit comments

Comments
 (0)