use of FLI.StreamUtils.Feedback_OK in project abstools by abstools.
the class Socket method fli_connect.
@Override
public Feedback<ABSUnit> fli_connect(ABSString server, ABSInteger port, ABSInteger timeout) {
try {
client_socket = new java.net.Socket();
SocketAddress serverAddress = new InetSocketAddress(InetAddress.getByName(server.getString()), port.toInt());
client_socket.connect(serverAddress, timeout.toInt());
setupStream();
input.setStream(new DataInputStream(client_socket.getInputStream()));
output.setStream(new DataOutputStream(client_socket.getOutputStream()));
return new Feedback_OK<ABSUnit>();
} catch (Exception e) {
e.printStackTrace();
return new Feedback_Error<ABSUnit>(putil.convert(e.getMessage()));
}
}
use of FLI.StreamUtils.Feedback_OK in project abstools by abstools.
the class ServerSocket method fli_bind.
@Override
public Feedback<ABSUnit> fli_bind(ABSInteger port) {
try {
socket = new java.net.ServerSocket();
socket.bind(new InetSocketAddress(port.toInt()));
return new Feedback_OK<ABSUnit>();
} catch (Exception e) {
return new Feedback_Error<ABSUnit>(putil.convert(e.getMessage()));
}
}
Aggregations