Merge remote-tracking branch 'origin/Jonas_Stuff' into Jonas_Stuff
This commit is contained in:
commit
55a5fe50b7
@ -31,12 +31,13 @@ public class ClientPinger implements Runnable {
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
|
Thread.sleep(2000);
|
||||||
while (socket.isConnected()) {
|
while (socket.isConnected()) {
|
||||||
gotPingBack = false;
|
gotPingBack = false;
|
||||||
out.write("CPING");
|
out.write("CPING");
|
||||||
out.newLine();
|
out.newLine();
|
||||||
out.flush();
|
out.flush();
|
||||||
Thread.sleep(5000);
|
Thread.sleep(4000);
|
||||||
if (gotPingBack) {
|
if (gotPingBack) {
|
||||||
if (!isConnected) { //if !isConnected, then the connection had been lost before.
|
if (!isConnected) { //if !isConnected, then the connection had been lost before.
|
||||||
isConnected = true;
|
isConnected = true;
|
||||||
|
|||||||
@ -31,12 +31,13 @@ public class ServerPinger implements Runnable {
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
|
Thread.sleep(2000);
|
||||||
while (socket.isConnected()) {
|
while (socket.isConnected()) {
|
||||||
gotPingBack = false;
|
gotPingBack = false;
|
||||||
out.write("SPING");
|
out.write("SPING");
|
||||||
out.newLine();
|
out.newLine();
|
||||||
out.flush();
|
out.flush();
|
||||||
Thread.sleep(5000);
|
Thread.sleep(4000);
|
||||||
if (gotPingBack) {
|
if (gotPingBack) {
|
||||||
if (!isConnected) { //if !isConnected, then the connection had been lost before.
|
if (!isConnected) { //if !isConnected, then the connection had been lost before.
|
||||||
isConnected = true;
|
isConnected = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user