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
2
votes
3 answers

Does the SocketAsyncEventArgs "pooled byte[]" style help reduce memory requirements?

I can't see how the pooled SocketAsyncEventArgs style helps me reduce memory consumption for a server that serves many concurrent connections. Yes, it provides an alternative to MS' Begin/End style that aforementioned MSDN page describes as…
Evgeniy Berezovsky
  • 18,571
  • 13
  • 82
  • 156
2
votes
1 answer

Write high-scalable socket server using SocketAsyncEventArgs

Okay, I read many questions involving writing high scale-able servers but I never really came across a good answer. Anyway I want to create a high scale-able clients, which handles lots of data and connections. What I created was a simple client…
2
votes
1 answer

ReceiveFromAsync leaking SocketAsyncEventArgs?

I have a client application that receives video stream from a server via UDP or TCP socket. Originally, when it was written using .NET 2.0 the code was using BeginReceive/EndReceive and IAsyncResult. The client displays each video in it's own…
oferbar
  • 176
  • 2
  • 16
2
votes
1 answer

begin/end vs socketasynceventargs with 1000 clients

I'm wondering which of the async types would be the best in both development speed and stability. I'm writing a proof of concept network application which has to support 1000 concurent clients. Each client sends about 5 packets of 30 bytes each…
1
vote
1 answer

SocketAsyncEventArgs.UserToken not being updated?

I currently have a client-server application that involves a Silverlight client and a .NET server. The .NET portion uses the Tcp classes provided in System.Net.Sockets namespace whereas the Silverlight client uses raw sockets. I'm porting into this…
sohum
  • 3,207
  • 2
  • 39
  • 63
1
vote
0 answers

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, it will cause memory leak. Creating it,…
user788454
1
vote
1 answer

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…
Josh
  • 287
  • 1
  • 8
1
vote
1 answer

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... it retruns null. But all the messages are…
Crocodile
  • 43
  • 4
1
vote
2 answers

C# SocketAsyncEventArgsPool Stack Empty

Hy, I'm using the SocketAsyncEventArgsPool described on MSDN. For each TCP Client i have an own pool(Stack) of 50 SocketAsyncEventArgs to write from the server to the Client. So, this works fine, but on restart the Client or the Server i have a…
1
vote
0 answers

SocketAsyncEventArgs vs TcpListener/TcpClient

Consider this example scenario: Client 1. One data as message 2. send to server 10000 times the same one data message 3. at one time only connect to one server Server 1. receive message from 1000 client concurrently(if possible. if not, as much as…
1
vote
1 answer

SocketAsyncEventArgs and mixed Async and Sync calls to Socket

Is it possible to call saea.AcceptSocket.Send after a saea.AcceptSocket.ReceiveAsync has been completed? (saea == SocketAsyncEventArgs) Is it ok to call saea.AcceptSocket.ReceiveAsync again after calling saea.AcceptSocket.Send? Actually I want my…
Kaveh Shahbazian
  • 13,088
  • 13
  • 80
  • 139
1
vote
1 answer

SocketAsyncEventArgs and few accepts per second

I am using SocketAsyncEventArgs and I can perform only a few accepts per second (I do not know why). How can I maximize number of accepts per second? Should I call Accept(null) multiple times? Code: After calling Listen on the listening socket I…
Kaveh Shahbazian
  • 13,088
  • 13
  • 80
  • 139
1
vote
0 answers

How to use SocketAsyncEventArgs to relay data from client to the server via proxy?

I am developing a proxy which accepts connections from multiple clients. The proxy checks for a valid token from the clients and if the token is found it allows the clients to connect to the server. I am using SocketAsyncEventArgs, BufferManager and…
NewUnhandledException
  • 733
  • 2
  • 10
  • 34
1
vote
1 answer

Send function in SocketAsyncEventArgs

I'm working on a C# Client/Server application and using the SocketAsyncEventArgs class. I can send a message from the Client and I can receive with the server (and answer directly), but I can't send "at will" from the server. Here is some code that…
Nick3
  • 639
  • 1
  • 14
  • 40
0
votes
0 answers

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 connection should be closed and the server should do…
Anna Melashkina
  • 422
  • 2
  • 13