Rusty Well-Known Member Licensed User Longtime User Jan 28, 2014 #1 I am using Prefix mode of AsyncStreams and my program sends messages to the server in various instances. Question, if I am using the same asyncstreams, same socket etc. and my program "sends" (issues a writestream or write) at the same time (or while a large file is being sent a small message is "sent"), does this cause conflict or does AsyncStreams "queue" up the requests? Or does this "overwrite" part or all of the messages? Thanks Rusty
I am using Prefix mode of AsyncStreams and my program sends messages to the server in various instances. Question, if I am using the same asyncstreams, same socket etc. and my program "sends" (issues a writestream or write) at the same time (or while a large file is being sent a small message is "sent"), does this cause conflict or does AsyncStreams "queue" up the requests? Or does this "overwrite" part or all of the messages? Thanks Rusty
Erel B4X founder Staff member Licensed User Longtime User Jan 28, 2014 #2 You can send and receive messages at the same time. Both Bluetooth and TCP / IP connections are full duplex connections. This means that they support sending and receiving data at the same time. Upvote 0
You can send and receive messages at the same time. Both Bluetooth and TCP / IP connections are full duplex connections. This means that they support sending and receiving data at the same time.
Rusty Well-Known Member Licensed User Longtime User Jan 28, 2014 #3 Thanks Erel, I understand it is duplex, what I was asking is, on my tablet, if I issue a send file for a large file and while the large file is sending, I issue a send of another file or message, will this cause the file(s) to fail in their transmission. Or will they be sent one at a time? Thanks, Rusty Upvote 0
Thanks Erel, I understand it is duplex, what I was asking is, on my tablet, if I issue a send file for a large file and while the large file is sending, I issue a send of another file or message, will this cause the file(s) to fail in their transmission. Or will they be sent one at a time? Thanks, Rusty
Erel B4X founder Staff member Licensed User Longtime User Jan 28, 2014 #4 They will be sent one after another. Upvote 0
A Asim A Baki Active Member Licensed User Longtime User Sep 21, 2015 #6 Erel, I'm trying the AsyncStreams but the duplex mode is not active, when I'm sending a large file from the server to the client, I write the progress back to the server but what I face is all the progress messages are queued and sent back to the server at once after the complete file is transferred, is it because of the server side or the client side? Upvote 0
Erel, I'm trying the AsyncStreams but the duplex mode is not active, when I'm sending a large file from the server to the client, I write the progress back to the server but what I face is all the progress messages are queued and sent back to the server at once after the complete file is transferred, is it because of the server side or the client side?
A Asim A Baki Active Member Licensed User Longtime User Sep 22, 2015 #7 [Solved] Found the solution, Actually it is server side issue, the issue is solved by using THREADING at server, because the server was waiting to finish sending the file and the thread stopped there Another simple solution is to move the receive processing after the BeginRead statement Code: Copy networkStream.BeginRead(client.Buffer, 0, client.Buffer.Length, AddressOf ReadCallback, client) RaiseEvent DataAvailable(client.TcpClient.Client.RemoteEndPoint.ToString, data.Substring(4).Replace("<EOF>", ""), client.Buffer) Last edited: Sep 22, 2015 Upvote 0
[Solved] Found the solution, Actually it is server side issue, the issue is solved by using THREADING at server, because the server was waiting to finish sending the file and the thread stopped there Another simple solution is to move the receive processing after the BeginRead statement Code: Copy networkStream.BeginRead(client.Buffer, 0, client.Buffer.Length, AddressOf ReadCallback, client) RaiseEvent DataAvailable(client.TcpClient.Client.RemoteEndPoint.ToString, data.Substring(4).Replace("<EOF>", ""), client.Buffer)