The Tcp and Server Components
Tcp Component
The Tcp component makes communicating with servers quite easy. The Tcp component can be used in one of two ways to send and receive data:
- Use the high-level interface (Send, Receive, EndSend, BeginReceive).
- Use the stream-interface (Stream.Write, Stream.Read)
When the high-level interface is used, internally the stream-interface will be used, so both methods send and receive data in exactly the same way.
Reasons to use the high-level interface:
- If you have developed network applications using components in the past, this interface may be more familiar to use.
- If you wish to easily implement asynchronous sending and receiving, the high-level interface has fully implemented events.
Reasons to use the stream-interface:
- Provides much more power and flexibility in receiving data (for example, receiving until a delimiter is reached).
- Provides additional stream-based functionality (for example, the ability to do a byte-wise find/replace on data).
For more complex situations, we would recommend developing using the stream-interface.
Server Component
The Server component can be used to rapidly construct custom server applications. Whenever a new connection is made, a Tcp object representing the connection will be created and exposed. Use this TCP connection to communicate with the individually connected clients.
In This Section
- Basic Sending and Receiving of Data
- Demonstrates the simplest usage examples for the Tcp component.
- Receiving All Data
- Demonstrates how to receive all data from the server.
- Receiving Fixed Chunks of Data
- Demonstrates how to receive fixed size blocks of data from the server.
- Receiving to a Delimiter
- Demonstrates how to receive data from the server until a delimiter is reached.
- Asynchronous Use
- Demonstrates how to use the Tcp component to send or receive data asynchronously from the server.
- Creating a Simple Echo Server Application
- Provides a step-by-step walkthrough demonstrating how to create a simple server application which simply echoes back all data it receives.
- Creating a Server Which Handles Commands
- Provides a step-by-step walkthrough demonstrating how to create a simple server application which understands and replies to commands.
Sockets Tcp Menublock
Related Sections
- The Server and Tcp Components
- Examines use of the Server and Tcp components.
- The Udp Component
- Examines use of the Udp component.
- The Dns, Ping and Trace Components
- Examines use of the Dns, Ping and Trace components.
- Security
- Describes use of security.
- Synchronous vs Asynchronous Methods
- This topic discusses the benefits and uses for synchronous and asynchronous methods.
- Using EndXXX Events
- Describes how to use the EndXXX events that are raised upon the completion of a method.
- Using Editor Forms
- Describes how to use the component designer Editor Forms.
SSL Sockets Component Menublock
Send comments on this topic.
Documentation version 1.1.2.0.
© 2008 Dart Communications. All rights reserved.