You can shutdown()
the socket for input. The recv()
will unblock and return zero and everybody will be happy.
More Related Contents:
- Send and Receive a file in socket programming in Linux with C/C++ (GCC/G++)
- How to link winsock.lib?
- How do you throttle the bandwidth of a socket connection in C?
- C++ Socket Error (new initializer expression list treated as compound expression)
- Windows threading: _beginthread vs _beginthreadex vs CreateThread C++
- How to make thread sleep less than a millisecond on Windows
- How can I get a process handle by its name in C++?
- What does “WINAPI” in main function mean?
- What is the easiest way to parse an INI File in C++? [closed]
- How to detect the current screen resolution?
- How to convert char* to wchar_t*?
- Cannot convert parameter from ‘const char[20]’ to ‘LPCWSTR’
- Creating a transparent window in C++ Win32
- SetupDiGetDeviceProperty usage example
- WaitForInputIdle doesn’t work for starting mspaint programmatically
- How to get the process name in C++
- How to query a running process for its parameters list? (Windows, C++)
- Best way to determine if two path reference to same file in Windows?
- Detecting simulated keyboard/mouse input
- How to programmatically create a shortcut using Win32
- Use CreateProcess to Run a Batch File
- How can I save HICON to an .ico file?
- Load the same dll multiple times [closed]
- Load resource as byte array programmaticaly in C++
- Breaking ReadFile() blocking – Named Pipe (Windows API)
- how to get process handle from process id?
- “APIENTRY _tWinMain” and “WINAPI WinMain” difference
- returning std::string/std::list from dll
- Authenticating users using Active Directory in Client-Server Application
- C++ Win32 keyboard events