Remove nulls
This commit is contained in:
parent
0e1d0b4092
commit
393106be61
|
@ -4,9 +4,9 @@ import java.io.*;
|
|||
import java.net.*;
|
||||
|
||||
public class EchoClient {
|
||||
private Socket clientSocket = null;
|
||||
private PrintWriter out = null;
|
||||
private BufferedReader in = null;
|
||||
private Socket clientSocket;
|
||||
private PrintWriter out;
|
||||
private BufferedReader in;
|
||||
|
||||
public void startConnection(String ip, int port) {
|
||||
try {
|
||||
|
|
|
@ -4,7 +4,7 @@ import java.net.*;
|
|||
import java.io.*;
|
||||
|
||||
public class EchoMultiServer {
|
||||
private ServerSocket serverSocket = null;
|
||||
private ServerSocket serverSocket;
|
||||
|
||||
public void start(int port) {
|
||||
try {
|
||||
|
@ -32,8 +32,8 @@ public class EchoMultiServer {
|
|||
|
||||
private static class EchoClientHandler extends Thread {
|
||||
private Socket clientSocket;
|
||||
private PrintWriter out = null;
|
||||
private BufferedReader in = null;
|
||||
private PrintWriter out;
|
||||
private BufferedReader in;
|
||||
|
||||
public EchoClientHandler(Socket socket) {
|
||||
this.clientSocket = socket;
|
||||
|
|
|
@ -4,10 +4,10 @@ import java.net.*;
|
|||
import java.io.*;
|
||||
|
||||
public class EchoServer {
|
||||
private ServerSocket serverSocket = null;
|
||||
private Socket clientSocket = null;
|
||||
private PrintWriter out = null;
|
||||
private BufferedReader in = null;
|
||||
private ServerSocket serverSocket;
|
||||
private Socket clientSocket;
|
||||
private PrintWriter out;
|
||||
private BufferedReader in;
|
||||
|
||||
public void start(int port) {
|
||||
try {
|
||||
|
|
|
@ -7,9 +7,9 @@ import java.io.PrintWriter;
|
|||
import java.net.Socket;
|
||||
|
||||
public class GreetClient {
|
||||
private Socket clientSocket = null;
|
||||
private PrintWriter out = null;
|
||||
private BufferedReader in = null;
|
||||
private Socket clientSocket;
|
||||
private PrintWriter out;
|
||||
private BufferedReader in;
|
||||
|
||||
public void startConnection(String ip, int port) {
|
||||
try {
|
||||
|
|
|
@ -4,10 +4,10 @@ import java.net.*;
|
|||
import java.io.*;
|
||||
|
||||
public class GreetServer {
|
||||
private ServerSocket serverSocket = null;
|
||||
private Socket clientSocket = null;
|
||||
private PrintWriter out = null;
|
||||
private BufferedReader in = null;
|
||||
private ServerSocket serverSocket;
|
||||
private Socket clientSocket;
|
||||
private PrintWriter out;
|
||||
private BufferedReader in;
|
||||
|
||||
|
||||
public void start(int port) {
|
||||
|
|
|
@ -2,8 +2,8 @@ package com.baeldung.socket;
|
|||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
|
Loading…
Reference in New Issue