mirror of
https://github.com/deavminet/dnetd
synced 2024-09-21 17:53:39 +02:00
Handle error
This commit is contained in:
parent
a246ef1d73
commit
d1e1297a26
@ -54,19 +54,23 @@ public final class DPlugin
|
|||||||
/* TODO: Error handling */
|
/* TODO: Error handling */
|
||||||
status = sendMessage(socket, data);
|
status = sendMessage(socket, data);
|
||||||
|
|
||||||
/* Get the reply */
|
|
||||||
/* TODO: Error handling */
|
|
||||||
byte[] reply;
|
|
||||||
receiveMessage(socket, reply);
|
|
||||||
|
|
||||||
/* Close the connetion to the plugin server */
|
|
||||||
socket.close();
|
|
||||||
|
|
||||||
/* Encode the status in the reply */
|
/* Encode the status in the reply */
|
||||||
response ~= [status];
|
response ~= [status];
|
||||||
|
|
||||||
/* Encode the response */
|
/* If the send succeeded */
|
||||||
response ~= reply;
|
if(status)
|
||||||
|
{
|
||||||
|
/* Get the reply */
|
||||||
|
/* TODO: Error handling */
|
||||||
|
byte[] reply;
|
||||||
|
receiveMessage(socket, reply);
|
||||||
|
|
||||||
|
/* Close the connetion to the plugin server */
|
||||||
|
socket.close();
|
||||||
|
|
||||||
|
/* Encode the response */
|
||||||
|
response ~= reply;
|
||||||
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user