TCP operation of this class deals only with communication between two peers. You may want to use the smart addressing operation to control the destination of the data being transmitted (UDP only). Reliable communication between two peers is also supported with TCP/IP with error handling. This class also helps reduce coding needed to create chat-like applications and IPC (Inter-Process Communication) between two or more applications (processes). In the latter case, you will want to create two UDP server sockets (one for each application). You may still use this class to communicate between two applications without establishing a connection. A client socket is a socket that is connected to a server socket. A server socket can be referred as to a socket that can accept many connections. It supports both client and server sockets. It also features some options not yet found in any socket classes that I have seen so far. It also provides threading support automatically for you, which handles the socket connection and disconnection to a peer. So, this library doesn't have such a limitation. This limitation is bad if all you want is a simple console application. First of all, this class doesn't have any limitation like the need to provide a window handle to be used. It provides some advantages compared to other classes that you may find here or on some other Socket Programming articles. This article presents a new socket class which supports both TCP and UDP communication. It provides you with the following events detection: connection established, connection dropped, connection failed and data reception (including 0 byte packet). There are other Socket classes here and other places over the Internet, but none of them can provide feedback (event detection) to your application like this one does. The thread is optional since the developer/designer is still responsible for deciding if he/she needs it. This article is about a client/server multi-threaded socket class. Note: The demo can be started in Client or Server mode, executed with " /C" (or " /CLIENT") or " /S" (or " /SERVER", which is the default). Download ServerSocket demo project - 241.6 KB.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |