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?
- Visual Studio .NET (.NET Framework)
- Visual Basic (VB)
- Visual C++ (VC++)
- C++ Builder
- Office 97/2000
||Returns a collection of TCP child connections accepted by the server.
||Returns the address in use while the Daemon is active and an empty string when the Daemon socket is closed.
||Returns the port number in use while the Daemon is active and 0 when the Daemon is closed.
||When True, the REUSEADDR socket option is set to accept duplicate use of the same LocalAddress / LocalPort pair.
||Show the About Box.
||Stop the server from accepting new connections and immediately close existing client connections.
||Start listening for passive connections.
||Fires to indicate the count of connected children has changed.
||Fires when an error condition occurs.
||Fires when the ReceiveBufferCount changes.
||Fires when the system accepts data for sending.
||Fires when the State property changes.
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)
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.