NDK Standard

NDK in an Extension DLL

Introduction

With the success of NDK 1.0, I decided to improve the functionality. NDK represents Network Development Kit. The NDK is a set of classes that implements a client/server architecture. The NDK hides all the complexity of the connection, sending, and receiving of data over a network. You only have to deal with three classes: CNDKServer, CNDKClient, and CNDKMessage. With just a few methods to override, you obtain a complete robust client/server application. The NDK is based on the class CSocket from MFC, so you can run your application on a local network or on the Internet without any change. To easily understand the integration of the NDK in an application, you'll find at the end of this article a complete chat application.

The firewall is shut down. Yes, if i split the buffer in small size, the speed is more fast.
but it is not as fast as when i use my own computer and make the size of the buffer as 2.5MB..
How wired~
Thanks for replay.

I am a telescope control system developing engineer. I use NDK to achieve the communication between telescope control program and auto-guider program. Because of the requirement of real time performance, I modified NDK a little bit, adding TCP_NODELAY flag bit to the sockets. It works.

If you would like to add this mechanism to your NDK as a minor upgrade, I perfer using yours.

hello, Sebastien_Lachance i downloaded your NDK_demo project and tried to run with two different computer making one computer as server and other as client.....i made a peer to peer connection, giving a mannual ip of 192.168.1.2 to host computer which i used to run the "chatServer" and 192.168.1.3 to another computer which i used to run "chatClient"...but even though the computer are well connected connection of chat from one computer to another was not possible

in the ip field of chatClient when i gave the ip 192.168.1.3 it couldn't connect to the chatServer even though it was running in next computer with ip 192.168.1.2

Please help me with this i really want to learn how client/server application really work

There is probably a Firewall problem, check your settings and disable the firewall on both computers during the test. Under the NDK, CSocket is used, so there is nothing fancy hidden. The NDK works for about 10 years.

Dear Sebastien,
Your work is very good.
Now I want to use it to receive the data from a experiment unit.The unit just uses an Ethernet interface in the board.It is just send out the data via TCP/IP and can not receive the message from server.I want to know how can I modify the codes to receive the data from unit?Can I receive the data automatic?Can you gei me some suggest?
Thanks a lot.Thank you.

I'm sure that it is technicaly possible. The NDK is build on top of CSocket from the MFC library. I would suggest to you that you dive into the MFC classes. The CSocket hides the complexity of the TCP/IP.

Hi there,
Would it be possible that the bugs discovered so far in the comments could be patched and the latest source code be updated in the article. I am having a trouble also when suddenly my client application crashes for no apparent reason (its a lan based chat client connected to a single server).
If anyone can do the fixes in the source and publish it, that would be great...