Version: 1.1.1.0
Create multi-threaded servers and powerful Internet applications in .NET.

Tcp Server .NET Component

Use the Server component to quickly build any custom TCP server application. Features include:

  • Each new connection received from a client occurs on a new thread, resulting in a fully multithreaded server.
  • Each new connection is represented by a Tcp class, enabling advanced reading/writing capabilities.
  • Implement any protocol (FTP, SMTP, IMAP) to create a server, or create a server that implements a proprietary protocol.
  • Design-time editor assists in protocol testing.
  • C# and VB.NET sample projects included.
  • Includes a royalty-free license!

Looking for a secure or non-secure ActiveX version of this component?

Looking for the secure .NET version of this component?

Interface

Public Constructors
Server Overloaded. Initialize a new instance of the Server class.
Public Properties
Active Returns true when listening for connections.
Connections Returns an ArrayList containing Tcp objects representing active connections.
Editor In Visual Studio.NET, displays an interactive form to use to test real time protocol operations.
LocalEndPoint Returns the local address the Server object is bound to.
Socket Returns the instance of the System.Net.Sockets.Socket that is accepting connections.
SynchronizingObject Set this object to automatically control thread marshalling between worker threads and the main UI thread.
Tag Gets or sets an object reference that can be used to associate this instance with any other.
Public Methods
Abort Stops the server application and immediately closes all connections.
Close Stops listening on the server but does not close active connections.
Listen Overloaded. Begin listening on the specified port using using the default network interface.
Public Events
ActiveChanged Raised when the value of the Object.Active property changes.
Connection Raised when a connection is accepted.

Code Example

How easy is the Server component to use? The following code demonstrates a functional, multi-threaded echo server application.

VB.NET Example
' Begin listening on port 7 (the well-known port for echo)
Server1.Listen(7)

Private Sub Server1_Connection(ByVal sender As Object, ByVal e As 
Dart.PowerTCP.Sockets.ConnectionEventArgs) Handles Server1.Connection
   ' The Tcp instance used to communicate with the client is
   ' found in e.Tcp.
   Try
      ' Keep receiving and echoing until the client closes the connection
      Do While (e.Tcp.Connected) ' This is true until client closes the connection.
         ' Receive the data from the client.
         Dim s As String = e. Tcp.Receive().ToString()

         ' Send the data back to the client
         e.Tcp.Send(s)
      Loop
   Catch ex As Exception
      ' just eat any exceptions
   End Try
End Sub