Posts

Showing posts with the label aqueduct

How to return Response.ok with socket data?

How to return Response.ok with socket data? I can connect my aqueduct to close network socket (listener and get the data) Problem is I can't return new Response.ok. It shows null... I am using Aqueduct 3.0. The most of the documentation looks like Snippets. I had difficulty to apply dart socket. But now I can get text from socket and I cannot sent the data over internet from my aqueduct web api. class LoginController extends Controller { String _xCustomerToken; String _xCustomerName; var list = ; @override Future handle(Request request) async { String reply; Socket.connect('192.168.1.22’, 1024).then((socket) async { socket.listen((data) async { reply = await new String.fromCharCodes(data).trim(); print("reply: $reply"); var list = reply.split(":_:"); print(list); _xCustomerToken = list[2]; _xCustomerName = list[3]; // CAN PRINT THE SOCKET DATA // EXAMPLE: ”Customer Token: 998877, CustomerName: NIYAZI TOROS” print( "Cu...