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
1 answer

IOS: AsyncSocket - readData method's invoke mechanism

things are like this: I used AsyncSocket to connect with server. when the server send some bytes to client at a time, app will invoke (onSocket: didReadData: withTag:) method; Sometimes, because of the network or other reason, some bytes arrived and…
traximus
  • 177
  • 3
  • 15
0
votes
2 answers

Crash when sending via AsyncUDPSocket

I'm trying to broadcast via UDP. I included the CFNetworking framwork and added AsyncUDPSocket to my project. #import "AsyncUdpSocket.h" I then created a socket as: broadcastSocket = [[AsyncUdpSocket alloc] initWithDelegate:self]; and I send…
Beaker
  • 1,633
  • 13
  • 22
0
votes
2 answers

How to fix this error ("_OBJC_CLASS_$_AsyncSocket", referenced from:)

When I added AsyncSocket.hand .mto my project I got this error Undefined symbols for architecture i386: " _OBJC_CLASS_$_AsyncSocket", referenced from: objc-class-ref in ViewController.o ld: symbol(s) not found for architecture i386 clang: error:…
Husam
  • 8,149
  • 3
  • 38
  • 45
0
votes
0 answers

Stackoverflow in Socket.SendAsync C#

I have a problem where my application crashes what seems to be at random. It works for maybe up to 30 min, and then I just crashes, if I debug I get an error at the row mySocket.SendAsync(completeArgs) It's a stackoverflow error... I do the…
Nick3
  • 639
  • 1
  • 14
  • 40
0
votes
2 answers

AsyncCallBack - Does it have to be static / Does it have to return void?

My question is fairly simple, but I suspect the answer won't be. In my WP7 app, I am calling a REST web service to GET some data which I deserialize into class objects. My request method and its AsyncCallBack method live inside a class (an MVVM…
Andrew B Schultz
  • 1,512
  • 1
  • 23
  • 41
0
votes
1 answer

How do I use AsyncSocket in a worker thread instead of main Thread?

I have a iPhone app that connects to an IP camera and retrieve MJPEG data using GET method. Everything seems to work find on the simulator, but on the device the UI seems to be blocking: Whenever i receive an image data, I load it into uiimageview.…
Ben
  • 706
  • 1
  • 10
  • 20
0
votes
1 answer

Regarding Callback method used for BeginReceive method

Following is the callback method that I use in my socket programming at client side for async receiving of data from server:- Public Sub Connect() m_clientSocket = New Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp) …
0
votes
1 answer

metro style app asynchronous socket issue (send function call before connected)

i have created a metro style datagram server and a client using Windows.Networking.Sockets. i am doing code in c++ Than i tried to connect and send data from client to server. but the problem i am facing is that, as windows metro application is…
0
votes
1 answer

iPhone OS 3.x - background asyncsockets (if statement is not workable?)

I am trying to implement the background mode with async socket. The following are a few codes: CFReadStreamRef theReadStream; CFWriteStreamRef theWriteStream; if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 4.0) { …
0
votes
2 answers

Running async socket operations in order

What I need is a class that does async operations in order. class FooSocket { private Socket _Socket; // Message is a class that wraps a byte array. public Task Receive() { /*Bla...*/ }; public Task Send(Message…
Şafak Gür
  • 7,045
  • 5
  • 59
  • 96
0
votes
1 answer

Improper HTTP Content-Length in response from server causes different results on client side

Server I have a Boost::Asio based http WebService, which asynchronously processes client connections and replies with a JSON content preceded by HTTP headers: std::string response += "HTTP/1.0 200 OK\r\n"; response += "Content-Length: 2000\r\n"; …
schedar
  • 419
  • 6
  • 21
0
votes
1 answer

Simulate socket disconnect

I am trying to do exactly what the subject says for a test case, meaning when doing the check if(socket.Connected) you would get false, but the socket object remains and not get disposed. I know Polling test would be more precise but I'm not really…
Fylix
  • 2,551
  • 6
  • 45
  • 72
0
votes
0 answers

Socket's state changes from Connected to Disconnected

I have two applications, one connects to another via TCP Socket. I was having an issue and after a long troubleshooting I begun to think the root cause is due to the disconnection of the Socket, aka the Socket.state changes to Disconnected. The…
Fylix
  • 2,551
  • 6
  • 45
  • 72
0
votes
2 answers

Collection class for asynchronous access in a TCP server application

There is a TCP server project I'm working on. It asynchronously listens the specified port for connections, accepts new connections and begins to wait for data from them. Each new client sends its ID when it connects, this way I know which socket…
Şafak Gür
  • 7,045
  • 5
  • 59
  • 96
0
votes
2 answers

Different between none-blocking mode with async socket in C++ winsock server

In C++, I've read some tutorials to create a server which can accept connections from multiple clients. They suggest using async socket, but i don't really know why we should choose async over none-blocking mode. And what's about the ideas that use…
Kingfisher Phuoc
  • 8,052
  • 9
  • 46
  • 86