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