Version: 3.2.5.0
Construct high quality server and custom server proxy applications using FTP, DNS, and TCP protocols.

Tcp Server ActiveX Control

Use the Server control to build any type of high-level TCP server application (such as FTP, HTTP, POP3, SMTP, or your own proprietary protocol). Features include:

  • The Server control uses an internal Daemon (listener) object and dynamically creates internal TCP objects as each passive connection is automatically accepted. Use this TCP object to send and receive data to that individual connection.
  • Active connections are available in a collection.
  • Events are raised notifying when a new connection occurs or an existing connection closes.
  • Create a server which implements an existing protocol such as an FTP, POP, IMAP, or HTTP server.
  • Create a server which implements your own custom protocol.

 

Looking for the .NET version of this control?

Development Environments

  • Visual Studio .NET (.NET Framework)
  • Visual Basic (VB)
  • VBScript
  • Visual C++ (VC++)
  • FoxPro
  • PowerBuilder
  • Delphi
  • C++ Builder
  • ASP
  • Office 97/2000

 

Interface

 

Public Properties
Children Returns a collection of TCP child connections accepted by the server.
LocalAddress Returns the address in use while the Daemon is active and an empty string when the Daemon socket is closed.
LocalPort Returns the port number in use while the Daemon is active and 0 when the Daemon is closed.
ReuseAddress When True, the REUSEADDR socket option is set to accept duplicate use of the same LocalAddress / LocalPort pair.
Public Methods
About Show the About Box.
Close Stop the server from accepting new connections and immediately close existing client connections.
Listen Start listening for passive connections.
Public Events
Count Fires to indicate the count of connected children has changed.
Error Fires when an error condition occurs.
Receive Fires when the ReceiveBufferCount changes.
Send Fires when the system accepts data for sending.
State Fires when the State property changes.

Code Example

How easy is the Server ActiveX control to use? Check out the VB example below, which demonstrates creating a functional echo server.

Private Sub StartServer()
    ' Start the server on port 7 (the well-known port for echo)
    Server1.Listen 7
End Sub

Private Sub Server1_Receive(ByVal Child As DartServerCtl.ITcp)
    ' Buffercount changed. Receive data from a connected client.
    Dim Data As String
    Dim ByteCount As Long
    ByteCount = Child.Receive(Data)

    ' Now echo the data back.
    Child.Send (Data)
End Sub