Questions tagged [asyncsocket]

Asynchronous sockets allow for multiple simultaneous non-blocking socket connections.

Asynchronous sockets allow for multiple socket connections within a single thread. While more complicated than synchronous sockets, asyncsockets allow for more efficient use of cpu scheduling. These connections are non-blocking, which allows the main program thread to continue running, while a socket thread manages network traffic.

589 questions
0
votes
0 answers

How to separate recv from send in socket?

when using socket api to code like this: # client end send(string1) send(string2) # server end st1 = recv(4096) st2 = recv(4096) The problem is that st1 will receive both string1 and string2. How can I get st2 from string2?
0
votes
1 answer

c# ReceiveAsync lag

While trying to read data from a TCP socket using ReceiveAsync.Completed, I experience a few ms delay (1-5ms, once in a while) between the time the data arrives to my application and the time it arrives to the machine. I use Wireshark to compare…
0
votes
1 answer

client side application not working as intended while using AsyncSocket

I am using AsyncSocket class in a simple client-server application. As a first step I want that - as soon as connection is established between client and server, client transmit a welcome message - "connected to xyz server" to server and server…
Devarshi
  • 16,440
  • 13
  • 72
  • 125
0
votes
0 answers

Sending lots data disconnects the server

I'm building a network library to use in further projects, I know a bit of networking (in general and programming) but I still encounter problems when I want to transfer larger packets on a high frequency. How would this be possible in TCP? One…
joell
  • 396
  • 6
  • 17
0
votes
1 answer

C# Sockets BeginRecieve Async Callback not being called

I'm opening a UDP Socket for receiving udp packets. However sometimes It never gets to the point Do stuff with data. Data is being received, I can see it on Wireshark: but the callback only runs to close the socket when I run the Disconnect…
James
  • 9,774
  • 5
  • 34
  • 58
0
votes
1 answer

socket.connect() blocks other threads?

If I issue multiple socket.connect() in different threads - would a single socket.connect() make the current thread to wait for an ACK response, or meanwhile another thread would be able to issue a socket.connect()?
Dor
  • 7,344
  • 4
  • 32
  • 45
0
votes
1 answer

boost async_write: if it fails, how would track what didn't get sent and notify client/user what failed?

I'm looking for a design suggestion here. If we are using socket.async_write, the client code which is sending the message won't have a synchronous result to know if it succeeded or failed, and therefore doesn't know if it should retry sending (or…
Sam Goldberg
  • 6,711
  • 8
  • 52
  • 85
0
votes
1 answer

Wait until the complete message has arrived

I have to integrate 2 systems in a project with TCP communication - a custom protocol was developed. A message sent over the protocol will look as follows: MsgLength - 10 positions (in chars, not bytes) MessageType - 20 positions Message Number - 9…
msjonathan
  • 514
  • 2
  • 11
  • 26
0
votes
0 answers

SocketAsync, can't reconnect to server

I have a problem with my Socketasync application, I have a server, and a client (the code below), everything with the communication works great except when the server application is closed, then the client cant reconnect. If I restart the client,…
Nick3
  • 639
  • 1
  • 14
  • 40
0
votes
1 answer

Java Async I/O with NIO2: Does AsynchronousServerSocketChannel.accept give you an active AsynchronousSocketChannel

For server.accept I wrote a completion handler that has the parameters. When the handler is invoked via the accept method, does that mean the AsynchronousSocketChannel is now conneted? Or do I have to invoke the AsynchronousSocketChannel.connect…
0
votes
1 answer

ios Read data at fast rate in UDP

i am establishing a UDP connection using GCDAsyncSocket(ios device). Everything working fine and im able to send and receive messages, my problem is that i want to exchange data fast. I can send pretty fast data from my iphone to a pc but i cant get…
man_or_astroman
  • 648
  • 1
  • 17
  • 39
0
votes
1 answer

Python - Asyncore (client) socket - Can not determaine connection status

For some reason, self.connected of the asyncore.dispatcher class doesn't consider my socket to be connected on the client side. The server side sees the socket as connected and treats it as such, but the client doesn't know if it's connected or not…
Torxed
  • 22,866
  • 14
  • 82
  • 131
0
votes
1 answer

receving large file using Windows Phone socket

I am working on sendig file from desktop application to windows phone application using socket. I have developed desktop socket server app and windows phone app (socket client), both are working well with file less than 1MB means i can trasfer file…
0
votes
0 answers

Why doesn't AutoResetEvent work BeginSend?

I've written a serverside application that manages many clients using BeginSend() and EndSend() I'm struggling for the past hours to make sure no consequent BeginSend() calls are called for the same client. It seems that the following code snippet…
Daniel
  • 1,319
  • 14
  • 19
0
votes
0 answers

How to make sure there are no two subsequent BeginSend()s?

I've written a server side application that should manage many clients. Everything is done asynchronously using BeginSend() and EndSend() methods. In some cases I need to send two subsequent requests to one of the clients. I wish to make sure that…
Daniel
  • 1,319
  • 14
  • 19