Project DescriptionNetSockets is a .NET class library that provides easy-to-use, multi-threaded, event-based, client and server network communication.
Features
- Currently only supports TCP communication
- Multi-threaded
- Event-based
- Extensible base classes for streams, clients, and servers
- Several predefined ready-to-use clients and servers
- Utility methods (eg: ping)
- Fully commented
Base ClassesThe abstract generic base classes provide core functionality for easily implementing new streams, clients, and servers. The type parameter enables the derived implementations to provide better higher-level interaction when sending and receiving data. See
Object Classes below.
"Simple" ClassesThe "simple" classes provide the simplest implementations of a stream, client, and server, where all communication is in raw binary format. Sending and receiving is performed with byte arrays.
"Payload" ClassesThe "payload" classes provide a stream, client, and server that communicate using packets of data, or "payloads". The payload stream ensures that complete packets are received before raising an OnReceived event. This is done by adding a small header to the data sent, which contains the payload's length.
"Object" ClassesThe "object" classes provide a stream, client, and server that communicate using payloads of a specialized NetObject payload. This payload consists of a payload name and a .NET object. This is then serialized and sent as a binary payload. When the payload is received, it is deserialized back into a NetObject. This provides an extremely easy way of communicating with standard and custom .NET data types. However, performance requirements should be considered before using this method - as .NET serializing results in an overhead when in binary form.
UtilityA set of utility methods are also provided.