Originally posted by: Albert Bertilsson
I'm writing a client and a server using your great NDK, I have a problem. The server keeps a list of all the connected clients to store some associated data. When a client crashes, the server is not aware of it, and if it tries to send a message to the client it also crashes.
Is there a way to fix this so the SendMessage is always safe to call?
Originally posted by: Xiaojian Liu
I like this handy and easy to use stuff.
It may be used for lightweight client-server
development such as remote database manipulation.
Xiaojian Liu
Originally posted by: TEH KOK HOW
Can you please tell me what is the reason for that if you know!?
I am trying to combine both the client and server module together into one module in my application so that the user can select from the application menu as to configure it as either server or client application.
The problem is that in the client configuration, when the user click on the Connect button, the application failed in THRDCORE.CPP at ####### HERE ######### below:
do
{
// pump message, but quit on WM_QUIT
if (!PumpMessage()) ########## HERE ################
return ExitInstance();
// reset "no idle" state after dumping "normal" message
if (IsIdleMessage(&m_msgCur))
{
bIdle = TRUE;
lIdleCount = 0;
}
} while (::PeekMessage(&m_msgCur, NULL, NULL, NULL, PM_NOREMOVE));
Thank you.
Originally posted by: Frederic Hess
Is it a way to be notified in case of a socket failure ?
I'm using ndk from a client.
This works well ... until my Windows 95 host goes into power-save (hibernation) mode. After that, it isn't possible to send any message.
Is it a way to be notified that the CArchive isn't valid anymore, before trying to send a message ?
ReplyOriginally posted by: Hakkyu, Kim
Hi, all
I saw your work today and find it very simple and easy to use. However, I also found that NDK is based on MFC CSocket class, which is known to be not as fast as raw socket. As a game programmer, I wonder how NDK can perform for realtime gaming use. how do you think about it?
thanks in advance
Hakkyu
Originally posted by: Ernesto Surribas
The design of NDK is simple and nice. I share your design style (my slogan is "design is to create the illusion of simplicity" - Booch)
Good job!
I have two questions only.
1) NDK is based on MFC's CSocket. There are some well known CSocket limitations when running on a multithreading environment. Is NDK thread-safe or it "inherits" the CSocket problems?
For example, let's assume that you have two threads running. Each thread has a reference (pointer) to an NDK object (Client or Server). Is it safe to use the NDK object from both threads?
CSocket objects created in one thread cannot be EASILY used from another thread. You need to "play some tricks" to pass socket handles and ennvironments across thread boundaries.
2) Are there any limitations about the size of the messages? I mean "practical limitations" in terms of performance. For example, have you tried to use NDK to send big amounts of data (like a big file)? What is better: send the data in SEVERAL blocks or just send ONE big message?
Thanks,
Ernesto
Reply