Questions tagged [beginread]
27 questions
1
vote
1 answer
C# TcpClient losing packets
I'm having some issues when I really stress test my networking code. Essentially once the socket is set up it calls this:
NetworkStream networkStream = mClient.GetStream();
networkStream.BeginRead(buffer, 0, buffer.Length, ReadCallback,…

Ash
- 124
- 6
0
votes
1 answer
Windows CE 6.0 threading model for BeginRead/EndRead?
Just looking for confirmation or documentation regarding how threads are used for the async patterns on sockets under Windows CE, specifically for a socket's BeginRead. I've looked on MSDN's documentation, but I can only find vague references. …

Scott Pavetti
- 106
- 6
0
votes
0 answers
TCP GetStreatm().BeginRead() on Timer not updating C# Windows Form
I have a timer event that executes the following code. I'm trying to read from a TCP connection for a specific string, but it doesn't seem like the buffer gets updated on each passing timer tick event. The source that I'm getting this data from…

Justin
- 357
- 2
- 7
- 18
0
votes
1 answer
What is the proper use of SerialPort.BaseStream.BeginRead?
I am having issues with a program that is getting unreliable data from a serial port, and I believe https://www.sparxeng.com/blog/software/must-use-net-system-io-ports-serialport#comments
This article has some answers - the bytestoread value seems…

Plaje
- 65
- 9
0
votes
1 answer
Cannot access a disposed object : DataContext
I'm using TCPClient to connect to device and get some data as a strings, then I'm trying to save data to DB and getting
"Cannot access a disposed object" error."
Maybe problem is because I'm trying to save to DB from async callback function?…

Денис Пархоменко
- 1
- 1
- 3
0
votes
1 answer
How can you tell the source of the data when using the Stream.BeginRead Method?
When using the Stream.BeginRead Method, and you are reading from a stream into a memory, how is it determined where you are reading the data from?
See:
http://msdn.microsoft.com/en-us/library/system.io.stream.beginread.aspx
In the list of…

xarzu
- 8,657
- 40
- 108
- 160
0
votes
0 answers
TcpClient.BeginRead Method collision using asynchronous Callbacks
I am trying to create a Tcp socket server that accepts multiple clients. However, for the past couple of days, I haven't been able to overcome a certain obstacle. I believe I've isolated the problem to be in the TcpClient.BeginRead(callbackMethod)…

mmmFood
- 71
- 1
- 4
0
votes
0 answers
namedpipe async read calling without data
I am writing a windows service and a separate GUI program and i want them communicating with named pipes. The windows service is the pipe server and the GUI will be the client.
The problem is that when my client connects to the pipeServer my…

Christiaan Ven
- 1
- 2
0
votes
2 answers
Is there away to switch from a Worker Thread to the Main (UI) thread?
I apologize in advance if my question is too long-winded. I looked at the question “How to update data in GUI with messages that are being received by a thread of another class?” and it is very close to what I am trying to do but the answer was not…

serena
- 1
- 1
0
votes
2 answers
C# network stream fragmented data
My Context
I have a TCP networking program that sends large objects that have been serialized and encoded into base64 over a connection. I wrote a client library and a server library, and they both use NetworkStream's Begin/EndReadandBegin/EndWrite.…

Entity
- 7,972
- 21
- 79
- 122
0
votes
1 answer
Parsing non length delimited data asynchronously
I have a networked server that I switched to using synchronous Begin.. for handling short lived request, this was a huge improvement.
For the long lived ones two threads are created and with the increasing number of clients it is starting to become…

hultqvist
- 17,451
- 15
- 64
- 101
-3
votes
5 answers
Alternative for reading integer in C#
I know that for reading input by using Convert.To method,But is there any way to read other than this.
int k = Convert.ToInt16(Console.ReadLine());

zoho_deployment
- 137
- 2
- 19