Questions tagged [socketasynceventargs]

The SocketAsyncEventArgs class of the .Net framework is part of a set of enhancements to the System.Net.Sockets.Socket class that provide an alternative asynchronous pattern that can be used by specialized high-performance socket applications.

The SocketAsyncEventArgs class of is part of a set of enhancements to the System.Net.Sockets.Socket class that provide an alternative asynchronous pattern that can be used by specialized high-performance socket applications.

The main feature of these enhancements is the avoidance of the repeated allocation and synchronization of objects during high-volume asynchronous socket I/O.

54 questions
0
votes
0 answers

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 NetEntities handle Sending/Receive packets and are…
user7183273
0
votes
1 answer

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 less-used port or a random port for each client!…
Mokhabadi
  • 302
  • 2
  • 14
0
votes
1 answer

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 turning that into a "Memory" and sending it over a…
mczarnek
  • 1,305
  • 2
  • 11
  • 24
0
votes
1 answer

.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 able to use the same SocketAsyncEventArgs for…
Josh
  • 287
  • 1
  • 8
0
votes
1 answer

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.ConnectAsync(host, port); and server lets it get…
user6283344
0
votes
0 answers

Reading byte[] in Client/Server TCP app in a single call

Client app creates a List data from an ObservableCollection, then converts the data into a byte[] array and sends the Length of the array to the server before sending the actual array like this: void SendData(object o) { var data…
user6283344
0
votes
1 answer

.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 to have better performance and less memory…
jmayor
  • 2,725
  • 4
  • 29
  • 37
0
votes
1 answer

Are SocketAsyncEventArgs supported in Unity 5.6.3p2

I have created a networking api that I use in my applications. When compiling the unity project and running in the standalone windows player I receive the following exceptions which prevent my app from sending/receiving udp packets. …
devon t
  • 55
  • 2
  • 8
0
votes
1 answer

SocketAsyncEventArgs Send/Receive Order

I've been using SocketAsyncEventArgs for a project recently and I've come across issues where it appears that ReceiveAsync is occasionally getting data in a different order from what is being sent via SendAsync. Each block of data sent in the…
alex98101
  • 1
  • 1
0
votes
1 answer

SocketAsyncEventArgs with binary/byte[] streams

I'm new to C# and sockets so I apologize if my questions are out of line. I started building a socket interface using the example in this link: https://code.msdn.microsoft.com/High-Performance-NET-69c2df2f I want to be able to transfer binary files…
Cassova
  • 530
  • 1
  • 3
  • 20
0
votes
0 answers

Deadlocked when both endpoints do Socket.SendAsync

So I have written this client/server socket application that uses the SocketAsyncEventArgs "method" for doing async sockets. Using the same library I have used for many other applications, I now for the first time experience a situation that I never…
0
votes
1 answer

SocketAsyncEventArgs in a duplex server environment?

I am learning to use the SocketAsyncEventArgs stuff using the MSDN tutorial. I was just wondering a few things, namely how I could go about implementing the server with full-duplex capabilities. Currently, the MSDN example teaches you to create a…
Matthew Goulart
  • 2,873
  • 4
  • 28
  • 63
0
votes
0 answers

using SocketAsyncEventArgs to push data to C# TCP clients

I followed link to create an Async TCP server. However, all examples cover only sending data as a response to receive. My question is how to Push data to a certain TCP client. Let us say tat a byte[] needs to be sent/pushed to client Id 1. How can…
pats
  • 1,273
  • 2
  • 20
  • 43
0
votes
1 answer

SocketAsyncEventArgs fragment order

I am having an issue with receive socket packet ordering using SocketAsyncEventArgs. The crux of my problem is that that when a client sends a packet to the server, the server will receive the packet in non-standard sized fragments and they will be…
user3517331
0
votes
0 answers

Advice on a TCP/IP based server (C#)

I was looking for some advice on the best approach to a TCP/IP based server. I have done quite a bit of looking on here and other sites and cant help think what I have saw is overkill for the purpose I need it for. I have previously written one on a…