Is it possible to initiate a TCP connection request with overlapped I/O, and cancel it before the connection has been completed in Windows? I need to support at least Windows XP SP2.
TCP connections with overlapped I/O
2.4k Views Asked by Jörgen Sigvardsson At
2
There are 2 best solutions below
0
LordDoskias
On
From here:
overlap
This directory contains a sample server program that uses overlapped I/O. The sample program uses the AcceptEx function and overlapped I/O to handle multiple asynchronous connection requests from clients effectively. The server uses the AcceptEx function to multiplex different client connections in a single-threaded Win32 application. Using overlapped I/O allows for greater scalability.
Related Questions in WINAPI
- Make screenshot of DirectX window that is hidden and doesn't have focus
- Is it valid to mutilayered a critical section?
- Implementing callback function for dialog-based application
- Where is the 'EnablePinning' property in the ribbon framework's recent items?
- Confusion about CTRL_SHUTDOWN_EVENT handling in DLLs and WM_QUERYENDSESSION
- Standard control transparency. Possible?
- Disable all power options from the Start menu
- call Win32 API in flex to set Window Display Affinity
- heap error after changing from new allocation to smartpointer
- Win API - Delete all files except some
- Finding the default application for a particular file name extension (Even when served by a metro app)
- How do I declare OutputDebugStringA without windows.h macros?
- WPF giving maximize,minimize,resize control to child window
- Can a dialog intercept drag'n'drop messages passed to its controls?
- WinApi and work with several domains
Related Questions in TCP
- having spring integration tcpserver to manage clients and send them messages
- psuedo TCP multicast with os.dup2() in python?
- Retrieve Data From EOC(Eithernet Over coxial) device
- Connecting a web client to a c++ server with TCP
- ECONNRESET on node.js RabbitMQ consumer in Azure
- how to respond from plain tcp client to MessagingTemplate's sendAndReceive
- Java Socket - how does the read() method know if the end of stream has been reached?
- Scala - TCP Packet frame using Akka
- Re-transmission concept in TCP
- Issues regarding multiplayer networking: input
- Getting and Sending Data between a Server and Client
- Jamod Slave Example, can not connect to slave
- Android Phone not sending data over TCP/ip
- Lot of TIME_WAIT connections while using RestTemplate?
- How do I use the windows service and WCF to update some record in database?
Related Questions in WINSOCK
- Is Winsock error 10054 (WSAECONNRESET) "normal" with UDP to/from localhost?
- Is it guaranteed that an RST packet will be sent when a process terminates?
- Should I close the sockets when my application closes?
- C++ - sending a modified file periodically
- recv function always gives me the same buffer
- Retrieve buffer with multiple overlapped I/O requests
- Client Not Acting Correctly
- Can We initilize Winsock in DLL_DETACH ? actulay i want to send some data when a process get terminated(DLL_DETACH)
- Should I use different WSAOVERLAPPED struct for WSASend and WSARecv?
- Winsock use system proxy settings
- Cannot send a bigger file
- Connect JavaScript WebSocket to C winsock
- Winsock Client - Connecting to a Network Camera via TCP/IP4
- Abort a call to getaddrinfo()
- Winsock looping until host comes online
Related Questions in OVERLAPPED-IO
- Read lines from file async using WINAPI ReadFile
- storage and management of overlapped structure in multithreaded IOCP server
- Is it OK to write with overlapped i/o from multiple threads and not using an event in the OVERLPAPPED structure?
- ReadFile always returns false. GetLastError reoprts ERROR_IO_PENDING. Waitforsingleobject passes
- Store a data stream on hard disk in Windows
- WIN32 Socket API: Canceling Send/Recv on socket using event-based completion notification
- Event triggered Window Message
- Potential kind of asynchronous (overlapped) I/O implementation in Windows
- Why CompletionKey in I/O completion port?
- TCP connections with overlapped I/O
- Why does overlapping I/O become slower on larger files with more I/O operations?
- How to use OVERLAPPED to write data at specific offset (win32 programming)
- When using WSASend in overlapped mode, when should I free the buffers?
- Named Pipes - Asynchronous Peeking
- C# and native overlapped I/O
Related Questions in REQUEST-CANCELLING
- Meteor - Requests randomly failing
- Are HTTP requests always cancelled by all browsers if originator iframe is destroyed before it completes?
- What is the Correct HTTP Status Code for a Cancelled Request
- AddScoped dependency with a CancellationToke
- Aborting previous requests of mutation function from useMutation of Apollo client in React causes request to never run
- TCP connections with overlapped I/O
- axios cancellation caught inside of then() instead of catch()
- background worker class cancellation, sets cancellation pending flag but doesn't quit
- How to cancel request in Http Interceptor in angular5?
- AFNetworking cancel post request
- How to detect if HttpClient.CancelPendingRequests was used to cancel pending requests?
- Handling cancelled request with Express/Node.js and Angular
- Axios cancel token cancelling every request
- jQuery - Cancel form submit (using "return false"?)?
- How can you tell if the user hit cancel during a download from a Java servlet?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
ConnectExallows an overlapped connection attempt.To cancel this one would need to use
CancelIopassing theSOCKETas if it were aHANDLE(it is really). But this must be done from the same thread that calledConnectEx. Managing things so you can achieve that thread specificity is unlikely to be easy.After XP/2003 (ie. Vista/2008/8/2008R2) you can use
CancelIoExfrom a different thread (theOVERLAPPEDinstance is used to fully identify the IO operation).