mirror of https://github.com/deavminet/libdnet.git
Finished OOP
This commit is contained in:
parent
33c01a53ed
commit
de3006ac35
|
@ -649,8 +649,11 @@ public final class DClient
|
||||||
|
|
||||||
/* Send the protocol data */
|
/* Send the protocol data */
|
||||||
DataMessage protocolDataMsg = new DataMessage(reqRepQueue.getTag(), protocolData);
|
DataMessage protocolDataMsg = new DataMessage(reqRepQueue.getTag(), protocolData);
|
||||||
bSendMessage(socket, protocolDataMsg.encode());
|
bool status = bSendMessage(socket, protocolDataMsg.encode());
|
||||||
|
|
||||||
|
/* If the send worked */
|
||||||
|
if(status)
|
||||||
|
{
|
||||||
/* Receive the server's response */
|
/* Receive the server's response */
|
||||||
byte[] resp = reqRepQueue.dequeue().getData();
|
byte[] resp = reqRepQueue.dequeue().getData();
|
||||||
|
|
||||||
|
@ -662,11 +665,17 @@ public final class DClient
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* TODO: Error handling */
|
throw new DClientException("Get motd error");
|
||||||
}
|
}
|
||||||
|
|
||||||
return motd;
|
return motd;
|
||||||
}
|
}
|
||||||
|
/* If the list failed */
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new DNetworkError("getmotd");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Disconnect from the server
|
* Disconnect from the server
|
||||||
|
|
Loading…
Reference in New Issue