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

No threads to handle Socket.AsyncReceive because of concurrent requests to WCF service

I have a WCF service hosted in IIS that on request does a request to another server using asynchronous socket requests. The request has to be fast (5 seconds) or it times out. When a lot of users are sending requests at the same time (I guess about…
Ilya Chernomordik
  • 27,817
  • 27
  • 121
  • 207
0
votes
0 answers

C# Form. Changing a Client / Server chat room so clients can speak with one another

This question has probably been asked before. Okay so I am still learning how to program with sockets but I was wondering how you could change the client / server so that clients can talk amongst themselves as well as the server talking to the…
user3047041
  • 87
  • 2
  • 2
  • 11
0
votes
1 answer

AsynckTask in android

i want to use the same socket address for multiple calls for this task. i tried to get the address from different class but didn't work . please help !!! my call from different class is: new ConnectToServer().execute(ip, "2000", "br1"); my code for…
saddam
  • 11
  • 2
0
votes
1 answer

Using Async-Await in Socket

In Stefen Toub's code Awaiting Socket Operations : it doesn't mention about the usage of its async methods. I mean how the Server program will be calling the async methods using await? Ther isn't any main() also. Please elaborate over this. I tried…
Sunil Padhi
  • 371
  • 1
  • 8
  • 19
0
votes
0 answers

Asyncsocket crashes

Can anyone tell me why the code connects - (IBAction)connectBtn:(id)sender { socket = [[AsyncSocket alloc] initWithDelegate: self]; [socket connectToHost: @"127.0.0.1" onPort: 4321 error: nil]; } and the code below crashes on connecttohost -…
0
votes
1 answer

Why do asynchronous channels in Java's NIO.2 require these pauses?

I've written minimal example, but it's still too long, so let me know I should post the link to Pastebin instead. Server: import java.io.IOException; import java.net.InetSocketAddress; import java.net.StandardSocketOptions; import…
tkroman
  • 4,811
  • 1
  • 26
  • 46
0
votes
1 answer

CSocket doesn't receive OnClose or OnReceive when you disable network connection on the client side

I've created a client server application with c++ CSocket. when I connect the client to the server and after that I close the client with normal X button or end task it with taskmanager , server CSocket receives the OnClose event. The problem is…
EBAG
  • 21,625
  • 14
  • 59
  • 93
0
votes
2 answers

Python Non-blocking peer to peer chat socket.error: [Errno 32] Broken pipe

Hi i write simple chat program for peer to peer chat between server and client. This code is working for Client side and client can send message and server recives that messages. but for server side when i want to send a message i have error in line…
rezakamalifard
  • 1,289
  • 13
  • 24
0
votes
2 answers

Unable to read data correctly from .Net socket in C#

I have a client and server class in C# that uses socket communication. The Server looks like this: public class AsyncTcpServer { private Socket _server_socket; private Socket _client_socket; private byte[]…
Pat Mustard
  • 1,852
  • 9
  • 31
  • 58
0
votes
0 answers

Sending DatagramPacket on LAN using Datagram Sockets and threads in android

My Client Class is under with my log traces but my app. eventually stops with the error "client has stopped",I have created datagram socket with datagram packet to send on the receiving app. and I have specified the IP of the receiving…
Ameer Humza
  • 83
  • 1
  • 3
  • 13
0
votes
2 answers

java.lang.NullPointerException at sun.nio.ch.AsynchronousSocketChannelImpl.read

this is my code and i have below problem for reading ...when connection accepted it will happen! int port = 8080; try { final AsynchronousChannelGroup group = AsynchronousChannelGroup.withThreadPool(Executors …
user2659785
0
votes
1 answer

GCDAsyncUdpSocket Time out

In my application I am using GCDAsyncUdpSocket for UDP Packet communication... I have written the code like the below GCDAsyncUdpSocket* UDPSocket = [[GCDAsyncUdpSocket alloc] initWithDelegate:self delegateQueue:dispatch_get_main_queue()]; …
Palani Jacob
  • 226
  • 3
  • 7
0
votes
2 answers

Encrypting data from file and sending on a socket via MemoryStream( byte[] ) using C# / .Net

We have a sockets server that needs to transfer encrypted binary files to connected clients. The files need to be encrypted when requests for them arrive, preferably without making encrypted copies of files on disk first. Due to the fact that we use…
alexg
  • 653
  • 7
  • 29
0
votes
1 answer

CocoaAsyncSocket Apple Mach-O Linker Error

I need to receive TCP packets using CocoaAsyncSocket. When I'm importing that library to Xcode and trying to run my application, it gives me Apple Mach-O Linker Errors: Undefined symbols for architecture i386: "_kCFStreamErrorDomainMach", referenced…
user1996377
0
votes
2 answers

Android Async Task and TCP/IP Socket

I have a basic question about Async task. I'm a beginner in Android programming, sorry for this question. I'm going to open a socket in doinbackground. doInBackground(... ) { Socket socket = null; DataOutputStream dataOutputStream = null; …
snipor
  • 461
  • 1
  • 5
  • 5