Questions tagged [beginreceive]
35 questions
1
vote
0 answers
.NET sockets: beginReceive vs dedicated thread with receive
From what I've read, beginReceive is considered superior to receive in almost all cases (or all?). This is because beginReceive is asynchronous and waits for data to arrive on a seperate thread, thereby allowing the program to complete other tasks…

MikeD
- 171
- 2
- 13
1
vote
2 answers
Ansychronous Socket Client ReceiveCallback not executing
Hi am am working on a C# Winforms Application using the sample code below:
https://msdn.microsoft.com/en-us/library/bbx2eya8(v=vs.110).aspx
It connects to the right IP address and port number but after sending a string command and waiting for a…

Julio Sanchez
- 11
- 3
1
vote
2 answers
Asynchronous socket unexpected packet with BeginReceive \ EndReceive
I need to receive an async message.
In all messages, first 2 byte indicate the length of next byte array. My problem is that in few case I receive unexpected packets.
If I use Thread.Sleep(200) this problems does't happen, or happens rarely.
Where…

StefanoM5
- 1,327
- 1
- 24
- 34
1
vote
1 answer
Why NO Callback from BeginReceive when I set ReuseAddress to true? UDP
I'm creating a C# socket for UDP receive and send capabilities with Asynchronous callback functions for the receive. Simple, right! It took a while to get all the wrinkles ironed out, but it works... Well, as long as you hog the port! I need to…

Dainon
- 23
- 3
1
vote
0 answers
An existing connection was forcibly closed by the remote host in udpClient.BiginReceive method
I am getting "An existing connection was forcibly closed by the remote host" error at UdpClient.BeginReceive method. what might be a problem ?
This code is working in some ip which is in network but in some ip it is not working
using…

Kevan
- 107
- 7
1
vote
1 answer
Messaging using BeginReceive and EndReceive on ServiceBus does not work for me
I need asynchronous messaging on the bus.
This is the code I'm using:
//set callback to get the message
MessageReceiver messageReceiver = MessagingFactory.CreateMessageReceiver(BaseTopicName + "/subscriptions/" + addressee,
…

Zeev Turchinsky
- 11
- 2
0
votes
1 answer
Problems with WebClient.Upload and Socket.BeginReceive
I'm currently writing a simple web server and some clients to use it. My customer wants to be able to extend the functionality of the upcoming solution to include web clients but we need to have minute control of the communication so a simple web…

Jonas Rembratt
- 1,550
- 3
- 17
- 39
0
votes
0 answers
Socket.BeginReceive question regarding loop vs recursive calling
When sniffing an IP on a NIC card, does Socket.BeginReceive not automatically signal a call to capture all incoming IP packets? Why does putting this in a while(true) loop yield more results vs. recursively calling it?
I mean BeginReceive is…

Peter Sung
- 1
- 2
0
votes
1 answer
c# Udp BeginReceive - Messages out of order
I'm currently trying to create an UDP client/server. It's quite simple, there's a send function which sends a byte and then the clients immediately respond with an message containing information which I listen for
I've been having trouble with…

André Nicolaysen
- 43
- 7
0
votes
1 answer
Python Twisted frameowrk transport.write to a c# socket BeginReceive reading length based message framing value
I'm using length based message framing with python twisted framework with a C# client running BeginRecieve async reads and I'm having trouble grabbing the value of the length of the message.
This is the twisted python…

Mat70x7
- 112
- 2
- 9
0
votes
1 answer
use asynchronus socket to receive data
I use 2 ways to receive data with a socket connected to an IP address.
Synchronous receive.
Asynchronous receive.
Using synchronous receive, I get all response from the server in less than 1 second. But by using asynchronous receive, it takes…

a avali
- 11
0
votes
1 answer
Socket not reading all the packets that arrive
I am working on a C# TCP client and monitoring my packets using Microsoft Network Monitor. There is a server that's basically a black box sends an N amount of packets (right now it's in the order of 10-20) with a delay of 0,1 ms to 1 ms between each…

Alex
- 41
- 8
0
votes
0 answers
Return data using BeginReceive to another method in different class
I'm using the following code to receive a datagram asynchronously in a class named UDPComm.
what I do is the following:
I have another class named Manager which sends a message over the UDP connection UPComm.send(byte[])
Then it calls…

newbieLinuxCpp
- 376
- 2
- 8
- 23
0
votes
2 answers
C# UdpSocket starts receiving after send and stops receiving after a few packages
I'm trying to receive data via an UdpSocket from a multicast address.
The Socket doesn't receive data, before I sent data over the socket. After sending, i can receive a few packages, and then i have to send again, before I can receive more…

Sven-Michael Stübe
- 14,560
- 4
- 52
- 103
0
votes
2 answers
Does UDP socket need to go through the Accept Process like TCP sockets?
I'm working with UDP and i was wondering about the Accept Method when multiple machine need to connect to a server. So far i was working with UDPCliente class, IPEndPoint class and BeginRecieve / EndRecieve Method to create a server where multiple…

Josker
- 5
- 3