Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

C 

Socket Programming in VS2013 MFC?

Hello HF,
Hope you are doing great, I made a client server program (console based). Now I am trying to develop a GUI for server side on Visual Studio's MFC.
So far I know that I can either use winsock library (same as in my console program) or use AFXsock (special wrapper for winsock on MFC).
I need guidance which is better way to go with.

Currently I am using same winsock library in MFC, but after Accept() my program hangs untill a client connects (understandable since Accept() is a blocking call). How do I go around it, since I want my program to act normal while it waits for clients instead of going in not responding mode because of Accept() call.

Any help is appreciated, thanks a lot.

PS: I saw this project that behaves like I want but they use "afxsock.h"
https://www.codeproject.com/Articles/122...h-MFC-Part
I +3 rep4rep <3
For website hacking, custom malware, private RAT source code, dumps etc contact me on TG: @yealink2
MFC is pretty old, why wouldn't you just use what you developed for the console version? Which is probably winsock. You need to use threading or use asynchronous calls..
Getting Started: C/C++
[C/C++/.NET/x86 ASM - Automation Programmer]
Tons... why do you think MFC is the only option for a Win32 GUI? :/
Getting Started: C/C++
[C/C++/.NET/x86 ASM - Automation Programmer]
(Jun 23, 2018 12:59 AM)stdio Wrote:  Let me rephrase, which better options do I have besides MFC?

Nearly all of them since MFC is old. Qt, you could use Win32 directly, lots of options.
Getting Started: C/C++
[C/C++/.NET/x86 ASM - Automation Programmer]


Possibly Related Threads...
Thread / Author Replies Views Last Post
[C] by LilDeepWebJan 29, 2022 10:06 AM 3 229 Jan 29, 2022 10:06 AM
Last Post: yuumi
[C] by mafiaboySep 6, 2019 11:37 AM 13 442 Sep 6, 2019 11:37 AM
Last Post: zp_city
[C] by Truth3356Jul 3, 2019 04:34 AM 12 400 Jul 3, 2019 04:34 AM
Last Post: m1n0r1tyrep0rt