000
24.03.2007, 17:16 Uhr
Lehoanq
|
I'm using WindowsXP, wanna create a communication between C++ (C++ Borland - part of BDS2006) and Java. The client (java) will send a text to the server (C++), server shows it. That's all. It seems simple, coz people told me that TCP is OK for this communication. I have been trying for 4 days, but not succeeded yet. There're two problems:
1. On the same computer, they send a line of text successfully. But on different ones, the receiving process on server is invoked 2 times for each sending from client. For example, client sends "Hello", server gets "H" for the first time and later: "ello". Could you tell me why, please? And how to solve it. I gave up build-in TServerSocket (or something like that) in Borland C++ 2006, and moved to winsock32.
2. The accept function for the server to get connection from client makes my GUI (dialog...) not responsible, this function makes the server wait here until there's a client connecting to server. Is it related to "non-blocking" or "blocking" concept? And how to deal with it? I see MFC class (CAsyncSocket) is good at this aspect, but I'm using Borland, so only win32 standard is accepted.
Hope to hear from you geek soon. Thank in advance!
Nice weekend! |