56 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
2
votes
0
answers
128
views
C# async TCP read/write synchronisation: how to? [closed]
I am trying to create a type capable of sending and receiving traffic on a socket for a real-time application.
I am envisioning a system where this type manages two concurrent queues: one for inbound ...
0
votes
0
answers
83
views
.NET Socket Listen backlog not working as expected
I am testing a simple TCP server in C# that I aim to be able to connect 10k clients concurrently:
Server
public class HighPerfTcpServer
{
private Socket? _listeningSocket;
private ILogger<...
0
votes
0
answers
280
views
C# Socket SocketAsyncEventArgs when client is disconnected
I have a problem, that I can not reproduce locally, but I can constantly reproduce on the server.
I have a TCP connection with the server and client. If I disconnect the client from the Wi-Fi TCP ...
1
vote
0
answers
358
views
c# Socket.AcceptAsync where is Socket.StopAcceptAsync?
There is AcceptAsync for Socket.
Code looks like this:
private Socket _listeningSocket;
private SocketAsyncEventArgs _socketEvent;
private Init()
{
_socketEvent = new SocketAsyncEventArgs();
...
1
vote
0
answers
384
views
C# SocketAsyncEventArgs: why does it consume so much CPU?
SocketAsyncEventArgs is used to past the buffer, offset and length into the ReceiveAsync and SendAsync method of Socket.
I had done tests which revealed that,
If I don't dispose SocketAsyncEventArgs, ...
user avatar
user788454
0
votes
0
answers
1k
views
SendAsync and SocketAsyncEventArgs correct usage with fixed tickrate
im currently working on a TCP Server using Sockets in C#.
I encountered a problem and i'm not able to solve it..
My Server accepts connections and creates a new NetEntity for each client.
These ...
user avatar
user7183273
0
votes
1
answer
843
views
using one port vs many in server with many clients?
I'm writing server code with C# and I'm thinking that is it good (or even possible) to serve all clients (say millions in my dreams) with one port or it is better to use for example 1000 ports and use ...
0
votes
1
answer
324
views
C#: How to send unmanaged memory via SocketAsyncEventArgs?
I have video data and am generating new frames for many clients regularly. I'm getting the frames from the library as an IntPtr and an int representing the size of the byte array. Currently I'm ...
2
votes
1
answer
426
views
How to cancel custom awaitable
I've read Stephen Toub's blog about making a custom awaitable for SocketAsyncEventArgs. This works all fine. But what I need is a cancellable awaitable and the blog doesn't cover this topic. Also ...
1
vote
1
answer
82
views
C# SocketAsyncEventHandler evaluate operation on Complete
How do you evaluate if a Socket operation was successful or not with SocketAsyncEventArgs?
Do you evaluate the SocketAsyncEventArgs you passed as parameter?
SocketasyncEventArgs saea = new ...
0
votes
1
answer
239
views
.Net SocketAsyncEventArgs reusability
I just want to make sure I understand the SocketAsyncEventArgs reusability feature. As I understand, the SocketAsyncEventArgs can be reused for one connection and different operations. So I would be ...
0
votes
1
answer
121
views
Is there any difference between TCP wrappers' GetStream().Read/Write and Socket's Receive/Send
If client Socket is defined like this:
args = new SocketAsyncEventArgs();
args.AcceptSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
await args.AcceptSocket....
user avatar
user6283344
0
votes
0
answers
142
views
Reading byte[] in Client/Server TCP app in a single call
Client app creates a List<Person> data from an ObservableCollection<Person>, then converts the data into a byte[] array and sends the Length of the array to the server before sending the ...
user avatar
user6283344
0
votes
1
answer
121
views
.Net , TCP vs UDP , async multiple messages/clients
I'm working with .Net I'm looking to create a service and looking between TCP or UDP. Service is supposed to support multiple clients so I'm making it async with .Net SocketAsyncEventArgs as I've seen ...
2
votes
1
answer
904
views
Why does SocketAsyncEventArgs.RemoteEndpoint returns null? c#
I am Trying to create a udp server which receives data from many clients.
When i try to get remote end point of client after receiving data in server from SocketAsyncEventArgs.RemoteEndpoint property.....