Hi Devs,
I have a big problem with AStreams or Sockets.
When printing on a receipt printer over port 9100 i use
Socket1.Connect(printer_ip,9100,4000)
..
This code works. Most of the time. But sometimes the Astream.Write doesnt finish, or doesnt get started at all before the Astream.Close event happens, or the socket close.
If i don´t close the stream/socket it works, but i have to close the stream/socket, because the printer
can´t reach from another station, if the connection is online !!
What can i do ????
Thx
Use b4a 4.30, network(1.25), randomaccessfile(2.00)
I have a big problem with AStreams or Sockets.
When printing on a receipt printer over port 9100 i use
Socket1.Connect(printer_ip,9100,4000)
..
B4X:
sub socket1_Connected (Successful As Boolean)
if successful=true then
astream.initialize(....)
Astream.Write(data)
Astream.close
Socket1.Close
end if
end sub
This code works. Most of the time. But sometimes the Astream.Write doesnt finish, or doesnt get started at all before the Astream.Close event happens, or the socket close.
If i don´t close the stream/socket it works, but i have to close the stream/socket, because the printer
can´t reach from another station, if the connection is online !!
What can i do ????
Thx
Use b4a 4.30, network(1.25), randomaccessfile(2.00)
Last edited: