Questions tagged [beginreceive]
35 questions
16
votes
2 answers
BeginReceive / BeginRead timeouts
I'm using a NetworkStream & TcpClient to asynchronously receive data using BeginRead. I need to apply a time-out to this operation, such that after a specified amount of time the read will be aborted.
As far as I'm able to tell, this isn't…

Barg
- 2,968
- 7
- 26
- 28
11
votes
5 answers
C# Socket.BeginReceive/EndReceive
In what order is the Socket.BeginReceive/EndReceive functions called?
For instance, I call BeginReceive twice, once to get the message length and the second time to get the message itself. Now the scenario is like that, for every message I send, I…

akif
- 12,034
- 24
- 73
- 85
10
votes
5 answers
How to use UdpClient.BeginReceive in a loop
I want to do this
for (int i = 0; i < 100; i++ )
{
Byte[] receiveBytes = receivingUdpClient.Receive(ref RemoteIpEndPoint);
}
But instead of using UdpClient.Receive, I have to use UdpClient.BeginReceive. The problem is, how do I do that? There…

Syaiful Nizam Yahya
- 4,196
- 11
- 51
- 71
6
votes
1 answer
Cannot Append to Received String in UDP Listener C#
I have a Form that create a UDP object, in the UDP class a UDPClient is created and the received data is done in the BeginReceive Method using EndReceive.
When I print the string of the reveived data, after converting the byte[], to the console from…

Robert de Klerk
- 624
- 3
- 12
- 24
5
votes
3 answers
.NET asynchronous MSMQ
I don't understand where this is going wrong. Basically, I have a program which receives from a message queue and processes the messages. The program can be stopped at any time, in which case the message loop finished what it is doing before the…

Barguast
- 5,926
- 9
- 43
- 73
3
votes
1 answer
How receive a complete screenshot in Async socket?
I have a Java android code that sends data (image or text) to a C# application, to receive these data I'm using Async socket. But exists a problem that is relative to BeginReceive() function is not receiving the complete data when is sent an image..…

FLASHCODER
- 1
- 7
- 24
3
votes
0 answers
C#: Socket - Multicast, No Data received, BeginReceive/BeginReceiveFrom Callback is not called
I'm actually at a loss, I have this problem for some time now. I searched Stackoverflow and couldn't find a solution.
The Problem is as follows: I dont receive any data and the Callback from BeginReceive or BeginReceiveFrom, from the Socket…

Hirogen
- 71
- 1
- 5
3
votes
1 answer
BeginReceive/SocketAsyncEventArgs list of ArraySegments
What is the reasoning behind passing a list of ArraySegment to Socket.BeginReceive/SocketAsyncEventArgs?
MSDN for the Socket.BeginReceive constructor doesn't even correctly describe the first argument):
public IAsyncResult BeginReceive(
…

Lou
- 4,244
- 3
- 33
- 72
3
votes
3 answers
What happens with TCP packets between two Socket.BeginReceive calls?
I have a doubt about socket programming. I am developing a TCP packet sniffer. I am using Socket.BeginAccept, Socket.BeginReceive to capture every packet, but when a packet is received I have to process something. It is a fast operation, but would…

Rodrigo
- 31
- 1
2
votes
0 answers
Occasional drop of connection with Socket exception 0x80004005
I'm experiencing a problem of randomly getting cryptic errors when receiving data with the TCP server that I've written.
The exception is the following:
System.Net.Sockets.SocketException (0x80004005): An established connection was aborted by the…

nowave7
- 33
- 5
2
votes
0 answers
Send and receive using async client socket in c# forms
I am trying to connect to a remote server, log in, and then send data to it and receive data from it using a C# forms application. Originally I wrote a console application, which works fine, but I need to use forms. The problem is that my…

FelixEvauro10
- 21
- 1
- 3
2
votes
2 answers
Catch unhandled SocketException during asynchronous HttpWebResponse read
All the asynchronous calls to HttpWebRequest.BeginGetResponse/EndGetResponse and HttpWebResponse.GetResponseStream().BeginRead/EndRead are made from try/catch blocks, however, these exceptions propagate and do not leave a chance handle them and stop…

AlexMinza
- 85
- 2
- 9
2
votes
1 answer
Is Socket.BeginReceive(IList> buffers.. Not Asynchronous?
I have been looking to implement a custom class of :
IList>
this will be passed to a socket, and used as the buffer to receive data from that Socket.
Socket.BeginReceive(
IList>, SocketFlags, AsyncCallback,…

divinci
- 22,329
- 11
- 45
- 56
1
vote
2 answers
IOCP thread vs threadpool to process messages
When you're dealing with socket IO using BeginReceive/EndReceive, the callback is invoked by an IOCP thread.
Once you're done receiving you need to process the data.
Should you do it on the callback's calling thread?
Or should you run the task…

pablo
- 6,392
- 4
- 42
- 62
1
vote
1 answer
MessageQueue BeginReceive() method called twice
What will happen if I call the BeginReceive() method twice (one after the other)?
Example:
MessageQueue mq = new MessageQueue("strQueueConnectionhere");
mq.BeginReceive(); // first call
mq.BeginReceive(); // second call
Pls help
thnx :D

Bogs
- 15
- 7