-
CreateProcess() in C
Hi all, am new to this community. Am trying to implement a chat Program in C (windows).
where I need both the client and the server to communicate, without waiting for a reply from the other side, like the way we chat in any messenger.
Is there any way of accomplishing it? I tried out CreateProcess() function, but am not clear how to specify the location of the file as an argument. Can anyone help me out? If there are better techniques than CreateProcess(), then pls suggest that.
-
Firstly, CreateProcess() is a win32 function, not a C function. This post is in the wrong forum.
Second, you need to focus attention on how the client and server communicate (starting with how the server accepts new client connections and how the client establishes connection to the server).
The client should not need to start the server executing, or vice versa (which is all you can do with CreateProcess(), if you limit yourself to a scenario with client and server running on the same machine).
The client needs to cope if it can't establish a connection to the server. Once client and server have established a connection, both need to cope with the other dropping out.
-
@Grumpy:
In what way is your post related to my question? I could not understand, can u pls elaborate?
-
I get an error code 2 if I specify the location of the file as the second parameter. AND
I get an error code 123 if I specify the location of the file as the first parameter.
and both these codes stand for- "THE SYSTEM COULD NOT FIND THE FILE SPECIFIED."
So can anyone help me with the code as to how to specify the exact location of the file in the CreateProcess() function? PLS PLS.
-
The problem was with the blocking nature of the sockets. Used IOCTLSOCKET() and got it fixed!!!!