PowerTCP Sockets for .NET
See Also Send comments on this topic

Glossary Item Box

Welcome!

Welcome and thank you for choosing PowerTCP Sockets for .NET. You have selected what we feel is the most sophisticated and complete .NET Sockets package available on the market. We know you have a choice in software vendors and we will do our best to exceed your expectations.

Overview

PowerTCP Sockets for .NET fills the missing piece of socket communications in the .NET Framework by providing Stream-based SSL encryption and authentication that can be plugged into any Stream-based Framework 2.0, 3.0, 3.5, 4.0 or 4.5 technology, regardless of whether it is network-, file- or buffer-based. This latest version of the venerable PowerTCP product line gets a re-design that leverages the power of the latest .NET environments to provide the most advanced Internet Communications components available.

All components include a Start method for implemented multi-threaded applications, and Marshal methods for cross-threading marshaling support.

The easy-to-use Tcp component sends and receives data over a TCP connection and includes the option of securing data with SSL.

The Server component is two servers in one. First, the Start method permits handling of each connection on a dedicated worker thread, providing streamlined coding without the need to track state. Second, the StartAsync method provides a high performance option, utilizing IO completion threads as needed to execute the delegate provided.

The Udp component eases construction of UDP-based applications with socket options such as broadcasting and multicasting available through specialized properties.

The Ping component sends echoes using ICMP and allows for comprehensive trace route capabilities.

The Dns class resolves host names to addresses and vice versa, MX-record lookups, can use a specified DNS server, and permits binding to a specified local endpoint.

About Us

Quality!

Dart Communications, located in upstate New York, has been designing and developing Internet communication components since 1994. More than a decade later, PowerTCP, PowerSNMP and PowerWEB for ASP.NET are International bestsellers to small businesses, consultants, and Fortune 500 companies.

Each targeted protocol is extensively researched by Dart and each product is tested and supported by consistent processes and customer feedback. Developers using our products can focus on creating the unique features they require rather than wasting weeks on research and unnecessary code writing.

Added Value

Dart Communications is committed to creating products that are of high quality, flexible, and easily implemented into a project. This process means maintaining meticulous documentation and a readily available support staff. In addition, Dart consistently processes feedback and requests, using this information for new product and feature development.

Dart's development team is also available for custom development projects relating to their product line. A customer may lack the time or background to complete a particular project as needed. Dart's team will draw on their protocol knowledge and experience to supply a quality solution within the timeframe required.

Expertise

Building components is about reliability. Developers need products that can stand up to use, that work as intended, and that go beyond original expectations. Our research tells us that users often change the scope of a project once it is underway. PowerTCP products are designed to scale to those increased expectations. To give you time to evaluate this claim prior to purchase, Dart supplies a fully functional trial for all of its products. See for yourself how a component can have both high-level functionality for quick and easy solutions, and also provide a low-level interface for customization.

In today's world, software developers are routinely asked to produce solutions using unfamiliar technologies, with little time allowed for research. When Internet Communications is part of your project, consider leveraging Dart's proven components to connect, encode, compress, encrypt and transfer data. Our goal is to help you build applications that work the first time, every time.

See Also

Reference
Dns Component
Ping Component
Server Component
Tcp Component
Udp Component

Documentation Version 4.5
© 2016 Dart Communications. All Rights Reserved.


Getting Started

Getting Started
See Also Send comments on this topic

Glossary Item Box

PowerTCP Sockets for .NET is a complete suite of objects that integrates security, TCP, TCP Server, UDP, Ping and DNS functionality into any .NET application. We highly recommend the user read this documentation and examine the sample applications included in the distribution in order to become familiar with the Sockets for .NET classes. For the most basic quick-start, create a new Windows Application project in Visual Studio, and see the Code Examples page for accessible examples to try.

Show Sample Applications

All samples include C#, VB.NET and VC++/CLI versions.

Sample | Description
DNS Client | Resolves domain names, IP addresses and email address hosts.
Ping Client | Checks if remote hosts are reachable.
Proxy Server | Implements a test proxy that supports SSL tunneling, as well as Socks and HttpConnect proxies.
Server | Server implements a variety of protocols with two modes of operation ("sync" using dedicated worker threads and "async" using on-demand IO completion threads).
Server Windows Service | Server that is run as a windows service.
TCP Client | A fully-functional client which can be used to connect to, communicate with, and test server applications. Includes SSL option.
TraceRoute Client | Traces a route to a host using the Ping component.
UDP Chat Client | Utilizes UDP multicasting or broadcasting to chat with other users on the network.
UDP Time | Server and Client Network Time Protocol implementation.
Ping Web Client | Checks if remote hosts are reachable in a web application.
TCP Echo Web Client | Uses the Tcp component in ASP.NET to communicate with an echo server.

Download the Sockets for .NET Sample Applications

Show Support Options

Our mission at Dart is to deliver high quality Internet connectivity solutions to Internet application developers. Our goal is to supplement these solutions with timely support resources that can help at many different levels.

You must have an active connection to the Internet to view these links.

Paid Support Options
Discusses the paid support options available.
Free Support Options
Provides access to free materials to help your development, including FAQS, online help files, tutorials, code snippets, online asp samples, and a free support forum.
Support Forum
Provides access to our support forum, monitored by our own development staff as time permits.
Dart Solutions
Discusses the custom development support offered by Dart Solutions.

Show Authenticode Signing

Dart installation executables are authenticode signed with a "Dart Communications" digital certificate to ensure against tampering during distribution.

Dart dlls included in the installation bin directory are .NET strong name signed, but not authenticode signed. These dlls are used by the sample applications and typically referenced in users' products.

For those users who require dlls signed by the author company (for example, for Windows logo compliance), dlls that have been signed with the "Dart Communications" digital certificate are also included in the product. These dlls are contained in the "Signed Distributables" sub-folder under the installation bin folder.

In accordance with the End-User Licensing Agreement, pre-compiled Dart dlls may NOT be signed with a user's own certificate. However, for users who wish to independently sign these dlls, Dart offers Enterprise licenses which allow for this. Please contact sales@dart.com for more information.

Show Requirements

Target Platforms: Microsoft .NET Framework 2.0 SP1

See Also

Dns Component
Ping Component
Server Component
Tcp Component
Udp Component


Licensing and Trial Operation

Licensing and Trial Operation
See Also Send comments on this topic

Glossary Item Box

Show Application Licensing

The licenses.licx File

All Dart classes require a licenses.licx file in the executing assembly’s project, containing an entry for each licensed class. Without the licenses.licx, a runtime license will not be generated and compiled into the assembly, and a license exception will be thrown at runtime.

When a licensed control or component is added to a project using the Visual Studio designer, a licenses.licx file will be automatically generated if one does not already exist, and an entry for the class added.

When developing an assembly with no design surface such as a console application, or when instantiating a licensed class in code, the licenses.licx file must be added manually. If a licenses.licx file is not present in the project, add a new text file named "licenses.licx" to the project (not the solution) from the Solution Explorer. Add a single line to the licenses.licx that includes the fully-specified class name and the assembly name, separated by a comma. For example:

Dart.Sockets.Tcp, Dart.Sockets

Web Site Projects

Web Site projects include an App_Licenses.dll that must be rebuilt when changes are made to the licenses.licx file or when migrating from trial to licensed operation. The App_Licenses.dll can be rebuilt by right-clicking on the licenses.licx file in the Solution Explorer and selecting the "Rebuild Runtime Licenses" option.

Powershell and other Scripting Environments

Because PowerShell does not execute compiled code and its scripts are generally modifiable by end users, a development or trial license is required on any machine executing scripts. If an environment other than PowerShell is being used or another distribution method is desired, please contact support@dart.com for additional options.

Other Development Environments

For compilation environments that do not recognize the licenses.licx file, a license resource may be generated with the .NET or MONO lc.exe utility on a licensed machine and added to the project as an embedded resource, or linked during compilation using the appropriate resource switch. For specific instructions, check with the environment's manufacturer.

Show Development Platform Licensing

Trial Operation

Dart components include a 30-day introductory trial period. With the exception of trial messages and trial runtime license expiration exceptions, runtime trial operation is the same as licensed operation.

A 7-day runtime license will be embedded in assemblies compiled during the trial period. After 7 days, Dart classes will throw an exception and the assembly will no longer function. The 7-day runtime license can be reset within the 30-day trial period by recompiling the project.

A trial installation can be licensed by purchasing and activating a Product Key.

Licensed Operation

A Developer License is required to compile licensed assemblies. A valid Product Key is required to generate a Developer License. Each Developer License is machine and version specific; major and minor version increments (for example, 4.0, 4.1 and 5.0) require separate Product Keys and Developer Licenses, build and revision do not.

Product and license upgrades are available through the Customer Center to developers with an active subscription.

Obtaining a Developer License

Run the included license activation utility from the Activate PowerTCP Sockets for .NET 4.5 shortcut in the product's Start Menu program group. The utility will guide you through the registration and activation process. Once complete, the Developer License file will be emailed to you. Copy the dartlic file attached to the email to the following location:

Program Files (x86) \ Dart \ PowerTCP Sockets for .NET \ 4.5 \ bin

This location is also accessible from the 'Binaries Folder' shortcut in the product's Start Menu program group.

Note: On UAC-enabled operating systems, the dartlic file may need to be saved to a non-UAC-protected location before copying it to the aforementioned location.

If Internet access is not available on the development machine, the activation utility provides a URL for activating the license on a machine with Internet access so that the Developer License can be retrieved and copied to the development machine.

Note: All licensing messages and exceptions are logged to the Application Event Log with "Dart Components" as the event source. If the "Dart Components" event source could not be created, messages are logged under the ".NET Components" event source. The Application Event Log can be examined for licensing messages and exceptions in situations where message boxes cannot be displayed or no GUI is present.

Show Deployment

Dart components support xcopy deployment and do not require any files other than the component dll and compiled project assemblies.

See Also

Dns Component
Ping Component
Server Component
Tcp Component
Udp Component


Code Examples

Code Examples
See Also Send comments on this topic

Glossary Item Box

The following lists direct links to pages in this help file that contain easy-to-follow code examples.

Use Start and Marshal to execute functions without blocking the User Interface.

Connect to a remote host then send and receive data using TCP.

Post a looping Read to continuously receive data (or wait until data is available) without blocking the UI.

Authenticate a connection to a server to establish secure communication.

Log received and sent data.

Update the UI when the component's state changes (for example, from connected to closed).

Create a high-performance server using IO completion ports.

Create a server using a dedicated thread for each connection.

Authenticate a connected client to establish a secure connection.

Query a DNS server for an email address's mail servers, and a hostname's IP.

Ping a remote host.

Send and receive data between two UDP objects.

Join and leave a multicast group, send data to and receive data from a multicast group.

See Also

Dns Component
Ping Component
Server Component
Tcp Component
Udp Component


Designed for Modern Applications

Designed for Modern Applications
See Also Send comments on this topic

Glossary Item Box

PowerTCP Sockets for .NET exposes a modern multi-threaded design with technical advantages over competing products.

Async Methods

The async methods (BeginXXX) seen in competing products reflect an antiquated single-threaded design model that denies the benefits of multi-threaded power. Please read on to see how PowerTCP Sockets for .NET delivers multi-threaded power to your application without adding the complexity that is often associated with multi-threading techniques.

Operation on the client side of the client/server model is inherently command driven, so Sockets for .NET provides a simple Start(delegate) method that executes the body of your delegate on a worker thread. This straight-forward concept provides a flexible technique for using PowerTCP in any application environment.

This design eliminates the need for BeginXXX methods and EndXXX events. There is a clean interface with one method for each function and several advantages are immediately realized:

Efficiency. Methods are designed to efficiently block on socket receive operations (the thread sleeps until bytes are received). This results in the most robust and efficient design possible.

Reusable code. Your delegate(s) can be used in applications both with and without a UI. It is no longer necessary to use BeginFoo for Windows Forms applications, and (the blocking) Foo for services, web applications and console applications.

Lower life-cycle cost. Code is written sequentially because there is no UI message pump to consider. It is not necessary to write code for numerous event handlers. Your code is self-documenting, easier to debug and maintain, and has a lower life-cycle cost.

Easy-to-implement parallel operation. Worker threads are easily spawned, supporting intensively parallel operations. Alternatively, serial operation is easily implemented by using just one thread. Flexibility of design is key.

No more state machine. It is not necessary to track state in event handlers. Take the simple case where the following sequence takes place:

  • Receive data R1
  • Send data S1
  • Receive data R2
  • Send data S2

Using BeginXXX, an event is raised when data is received and a state machine is required (if R1 is received then send S1, else if R2 is received then send S2). Using a single worker thread, the operation is coded in simple, declarative steps (Receive R1, Send S1, Receive R2, Send S2).

No More Pseudo-Blocking

Competing products use "pseudo-blocking" to process UI events while the method blocks. Without pseudo-blocking overhead methods are faster and more efficient. Also, re-entrancy problems (caused when UI messages are processes while a communication method is in progress) are no longer possible.

Developing Applications Without a UI

Developing console applications, web applications, services and other applications without a UI is as easy as ever. Sequential code performs efficiently. If parallel operation is desired, Start(delegate) can be used to execute code in any delegate body in parallel.

Developing Applications With a UI

Developing Windows Forms applications is now just as easy as writing applications without a UI. One method (the delegate) can be used in both types of applications. The only difference is that a UI app uses Start(delegate) to spawn a worker thread upon which the method executes, and any data needed by the UI must be marshaled to the UI thread. To this end, PowerTCP components include Start() and Marshal() convenience methods.

The Start Method

Use the Start method to execute one or more functions on a new worker thread, so the UI is not blocked during operation. The syntax for this method is simple (C# and VB code snippets follow):

C# Copy Code
tcp1.Start(myBlockingFunction, myObject);

private void myBlockingFunction(object myObject)
{
   ...
}
Visual Basic Copy Code
tcp1.Start(AddressOf myBlockingFunction, myObject)

Private Sub myBlockingFunction(ByVal myObject As Object)
   ...
End Sub

Marshaling Data

It is often necessary to pass information from a worker thread to update an element on the UI thread. Use the Marshal method for this purpose. Each Marshal overload is paired with an event that is raised on the UI thread. For example (C# and VB code snippets follow):

C# Copy Code
//Read data, marshal to the UI thread
byte [] buffer = new byte [1024];
tcp1.Marshal(tcp1.Read(buffer), "", null);

private void tcp1_Data(object sender, DataEventArgs e)
{
    //Display received data
    //This event is raised on the UI thread
    displayData(e.Data);
}
Visual Basic Copy Code
'Read data, marshal to the UI thread
Private buffer(1023) As Byte
tcp1.Marshal(tcp1.Read(buffer), "", Nothing)

Private Sub tcp1_Data(ByVal sender As Object, ByVal e As DataEventArgs)
    'Display received data
    'This event is raised on the UI thread
    displayData(e.Data)
End Sub

Typical Use

The developer wants to execute a series of functions without interfering with the user-interface. A button, textbox, and the PowerTCP component are added to the form. Pressing the button will initiate a session with communication displayed in the textbox. The automateSession function, which could be reused in a non-UI application, is passed to Start and executes on a worker thread (C# and VB code snippets follow).

C# Copy Code
private void button1_Click(object sender, EventArgs e)
{
    //Event handlers were added in the designer
    //Start the process on a worker thread so the UI is not blocked
    tcp1.Start(automateSession, null);
}

private void automateSession(object notUsed)
{
    //This function executes on a worker thread
    try
    {
        //Connect to an echo server
        tcp1.Connect(new TcpSession(new IPEndPoint("myServer", 7)));

        //Send data
        tcp1.Write("hello world\r\n");

        //Read data to the expected delimiter, marshal to the UI thread
        tcp1.Marshal(tcp1.ReadToDelimiter("\r\n"), "", null);

        //Close the connection
        tcp1.Close();
    }
    catch (Exception ex)
    {
        //Report errors to the UI thread
        tcp1.Marshal(ex);
    }
}

void tcp1_Data(object sender, DataEventArgs e)
{
    //Add data received to the textbox
    textBox1.AppendText(e.Data.ToString());
}

void tcp1_Error(object sender, ErrorEventArgs e)
{
    //Add error messages to the textbox
    textBox1.AppendText(e.GetException().Message);
}

void tcp1_StateChanged(object sender, EventArgs e)
{
    //Change appearance of textbox when connected
    textBox1.BackColor = (tcp1.State == Dart.Sockets.ConnectionState.Closed)
        ? SystemColors.ControlDark
        : SystemColors.ControlLight;
}
Visual Basic Copy Code
Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles button1.Click
    'Event handlers were added in the designer
    'Start the process on a worker thread so the UI is not blocked
    tcp1.Start(AddressOf automateSession, Nothing)
End Sub

Private Sub automateSession(ByVal notUsed As Object)
    'This function executes on a worker thread
    Try
        'Connect to an echo server
        tcp1.Connect(new TcpSession(new IPEndPoint("myServer", 7)))

        'Send data
        tcp1.Write("hello world" & Constants.vbCrLf)

        'Read data to the expected delimiter, marshal to the UI thread
        tcp1.Marshal(tcp1.ReadToDelimiter(Constants.vbCrLf), "", Nothing)

        'Close the connection
        tcp1.Close()
    Catch ex As Exception
        'Report errors to the UI thread
        tcp1.Marshal(ex)
    End Try
End Sub

Private Sub tcp1_Data(ByVal sender As Object, ByVal e As DataEventArgs) Handles tcp1.Data
    'Add data received to the textbox
    textBox1.AppendText(e.Data.ToString())
End Sub

Private Sub tcp1_Error(ByVal sender As Object, ByVal e As ErrorEventArgs) Handles tcp1.Error
    'Add error messages to the textbox
    textBox1.AppendText(e.GetException().Message)
End Sub

Private Sub tcp1_StateChanged(ByVal sender As Object, ByVal e As EventArgs) Handles tcp1.StateChanged
    'Change appearance of textbox when connected
    If (tcp1.State = Dart.Sockets.ConnectionState.Closed) Then
        textBox1.BackColor = SystemColors.ControlDark
    Else
        textBox1.BackColor = SystemColors.ControlLight
    End If
End Sub

In the second example, the developer wants to receive data whenever it is available, again, without interfering with the ongoing processes of the application. Event handlers (not shown) are implemented as in the first example (C# and VB code snippets follow).

C# Copy Code
private void button1_Click(object sender, EventArgs e)
{
   //Start the process on a worker thread (no state info passed in)
   tcp1.Start(receiveData, null);
}

private void receiveData(object notUsed)
{
   //This function executes on a worker thread, providing multi-threaded, asynchronous operation
   try
   {
       //Connect to the server, marshal data to the UI thread
       tcp1.Connect(new TcpSession(new IPEndPoint("myServer", 19)));

       //Receive data when it is sent by the remote host
       byte[] buffer = new byte[1024];
       while (tcp1.State == Dart.Sockets.ConnectionState.Connected)
           tcp1.Marshal(tcp1.Read(buffer), "", null);
   }
   catch (Exception ex)
   {
       //Report errors to the UI thread
       tcp1.ReportError(ex);
   }
}
Visual Basic Copy Code
Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles button1.Click
   'Start the process on a worker thread (no state info passed in)
   tcp1.Start(AddressOf receiveData, Nothing)
End Sub

Private Sub receiveData(ByVal notUsed As Object)
   'This function executes on a worker thread, providing multi-threaded, asynchronous operation
   Try
      'Connect and login to the server, marshal data to the UI thread
      tcp1.Connect(new TcpSession(new IPEndPoint("myServer", 19)))

      'Receive data when it is sent by the remote host
      Dim buffer() As Byte = New Byte(1023){}
      Do While tcp1.State = Dart.Sockets.ConnectionState.Connected
         tcp1.Marshal(tcp1.Read(buffer), "", Nothing)
      Loop
   Catch ex As Exception
      'Report errors to the UI thread
      tcp1.Marshal(ex)
   End Try
End Sub

See Also

Dns Component
Ping Component
Server Component
Tcp Component
Udp Component


MVC Design in Applications

MVC Design in Applications
See Also Send comments on this topic

Glossary Item Box

Extending the Model-View-Controller Design Philosophy to Applications

One feature of the new version 4 components is the ease with which applications can be developed using a Model-View-Controller (MVC) design. MVC is a design philosophy that isolates application business logic from the user interface. The following white paper offers a detailed discussion of this design and its application to the PowerTCP and PowerSNMP components:

http://www.dart.com/articles_mvc.aspx

MVC design has been incorporated into some of the more sophisticated PowerTCP and PowerSNMP sample applications, providing two key benefits:

Separation of protocol logic from the user interface

Encapsulating protocol logic in a class separates it from any user interface, providing clean code that can be reused in other projects, with other interfaces.

The Proxy Server sample provides a nice demonstration of this separation. The sample implements several different proxy types; each in its own ProxyModel class. The sample can easily be extended to support additional proxy types by adding additional classes. Encapsulating data and logic pertaining to each different proxy in its own class provides a cleaner project that is easier to digest and maintain.

Simplified storage of runtime state information

Saving runtime state information and persisting this information when the application is terminated is a key feature of many applications. Model classes can be used to facilitate this.

The Tcp Client sample is a typical example.

First, the sample's TcpModel class provides properties for storing runtime data, including session data, security settings, and whether the application should echo data received. This class provides a "ground truth" for the state of the application, instead of the interface itself holding this information. The interface provides a means for updating the model, but is itself "dumb." Also, the encapsulated data can be easily passed to objects such as Settings and Connection forms, which are implemented as interfaces for updating the information contained within the model.

Second, as a serializable class, the model provides a means for easily persisting settings when the application is terminated. In the past, PowerTCP and PowerSNMP samples dedicated large chunks of code for saving and loading application settings, usually in the registry. PowerTCP 4 components have taken a different approach, focusing instead on providing help for serialization. This includes helper functions for Serializing and Deserializing objects to and from streams, as well as providing state information in serializable objects that can be easily stored. The TcpModel class stores two such objects - TcpSession (LocalEndPoint, RemoteEndPoint and Proxy information), and ClientSecurity (TargetHost, Certificates, Protocol, etc).

The sample applications are available as an option during the product installation, and can also be downloaded by clicking on the "Download Samples" link in the Start Menu.

See Also

Reference
Dns Component
Ping Component
Server Component
Tcp Component
Udp Component


TCP Protocol Overview

TCP Protocol Overview
See Also Send comments on this topic

Glossary Item Box

Transmission Control Protocol (TCP) is a data communications protocol and provides a reliable stream of data between two connected computers.

TCP is the base protocol for Telnet, FTP, SMTP, HTTP, POP, IMAP and other upper-layer protocols that use stream-based communications. In other words, any of these more complicated protocols can be implemented using TCP. In fact, PowerTCP does exactly this, as it uses the Tcp component's base classes for all TCP-related communications.

Features

TCP is built upon IP (Internet Protocol), which provides an unreliable transfer of data. In order to provide a reliable data stream, TCP uses the following methods:

  • When one end of a connection receives data, it sends an acknowledgement message. The sender continues to send the data until it receives this acknowledgement or times out.
  • Checksums are used to ensure no data corruption occurs. If data received does not match data sent, the host discards the data and does not acknowledge.
  • Both ends use buffering to store data before it is used by the application, and ensures the buffer will not overflow. This is known as flow control.
  • Data may be split up or combined into segments of any size. Bytes sent from one end of a connection arrive at the other end in the same order, but not necessarily in identically sized segments.
  • TCP is built upon the unreliable IP and therefore may change the order of received data and delete duplicate data to ensure reliability.
  • TCP is a stream-oriented protocol; data flows without predictable breaks. It is up to the application to define meaningful record blocks.
  • TCP provides simultaneous two-way (full-duplex) data transfer. Data can flow both ways simultaneously, although most protocols use half-duplex communication (each side stops while the other sends) to maintain sequential operation.

Connections

TCP is a connection-oriented protocol, meaning a connection is established between two hosts before data is exchanged:

  1. A client sends a message to a server requesting a connection. The server has a Daemon process running on a port that handles this request.
  2. The server responds, acknowledging the connect request.
  3. The client in turn acknowledges the server's message.

The server must listen for connections before the client can connect. The following two actions occurred:

  • The server made a passive connection—it listened for clients trying to connect.
  • The client made an active connection.

While the connection is active, it is uniquely defined by four TCP packet values:

  1. Two port numbers that identify the source and destination TCP port. Port numbers are used by the operating system to route the data to the application "bound" to that port.
  2. Two 4-byte addresses that identify the source and destination host interface. For example, a notebook computer may have one IP address for a LAN card and one IP address for RAS connections using COM3. This would be considered a "multi-homed host," and applications can bind to either port.

Closing a connection works similarly to establishing a connection. One end makes an active close and the other end performs a passive close.

See Also

Reference
Dns Component
Ping Component
Server Component
Tcp Component
Udp Component


UDP Protocol Overview

UDP Protocol Overview
See Also Send comments on this topic

Glossary Item Box

UDP is a simpler protocol than TCP. The Udp component sends and receives datagrams. UDP differs from TCP:

  • UDP is connection-less and therefore unreliable. The receiving side does not acknowledge the receipt of data on the transport layer. Error checking, if required, occurs at the application-layer.
  • UDP sends distinct blocks of data. If three datagrams are sent, three identical datagrams are received.
  • UDP allows for broadcasting (sending data to all hosts on a network) and multicasting (sending data to all hosts receiving data at a particular IP address).

Protocol Overview

UDP provides basic datagram service between two TCP/IP hosts. UDP sends and receives datagrams or blocks of data (unlike TCP which provides a reliable stream of data). UDP is used as transport for the Trivial File Transfer Protocol (TFTP), Simple Network Management Protocol (SNMP), Network Time Protocol (NTP), and others.

UDP enhances IP by providing a header that routes packet data to the application that binds itself to the addressed port number. UDP routes data between matching applications on TCP/IP hosts.

UDP provides an unreliable transfer of data. Unlike TCP, it is not guaranteed that packets will find their way to their ultimate destination. For this reason, most protocols that use UDP utilize acknowledgments.

UDP is a datagram-oriented protocol. A block of data, if successfully sent and received, arrives as a block of data exactly the same size as that sent. The IP layer takes care of reassembling any packets that may have been fragmented into smaller packets during its transmission. A checksum is used for packet data and corrupted packets are discarded.

UDP system buffering provides simultaneous two-way (full-duplex) data transfer.

Broadcasting and Multicasting

Unlike TCP, UDP can broadcast and multicast data. Broadcasting occurs when a host sends a datagram to all other hosts on the network. Multicasting occurs when a host sends a datagram to all hosts that are members of a particular multicast group. Since TCP is connection-oriented, sending data to multiple hosts is impossible.

Broadcasting

A broadcasted datagram is sent to the specially designated broadcast address "255.255.255.255". All hosts listening on the wire will receive the datagram. A router will not forward a broadcast datagram, so it will be limited to the local network.

Multicasting

Often broadcasting can provide unnecessary overhead. Consider a network with 30 hosts. One host on this network broadcasts information that only 10 of the hosts on the network are interested in. This means 20 uninterested hosts must process the datagram up the protocol stack to the transport layer before discarding the data.

Alternatively, the interested hosts can join a multicast group. Multicasting uses a range of addresses from 224.0.0.0 to 239.255.255.255, known as class D addresses. The 10 participating hosts can simply join a multicast group in this range, and send datagrams that will only be received by hosts who have joined the same multicast group.

Typical Applications

UDP is quick to set up, easy to use, light on system resources, and simple to program. UDP also can broadcast packets to all computers on a network segment, something TCP cannot do. For these reasons UDP is often used for:

  • Software licensing applications.
  • Communications with network devices like routers (that have no need to support TCP).
  • Applications that use packet broadcasting techniques to discover information.
  • Simple request/reply protocols, such as Simple Network Management Protocol and Network Time Protocol.
  • Applications that require maximum speed such as network gaming or chat applications.
  • Applications that wish to broadcast or multicast data.

See Also

Reference
Dns Component
Ping Component
Server Component
Tcp Component
Udp Component


PowerTCP in Partial Trust Environments

PowerTCP in Partial Trust Environments
Send comments on this topic

Glossary Item Box

Partial Trust

Partial Trust environments such as shared hosting in ASP.NET limit access to potentially harmful .NET framework classes and methods. Because of this, some additional configuration is required in order to use Dart's components in these restricted environments. When developing a system service, console application, windows forms application, or web application that will run with Full Trust, no additional configuration is necessary.

Background

The Windows API can access system services that a system administrator may not want to expose. For example, a web hosting service may not want hosted code to access the file system. Microsoft calls limiting such access “Code Access Security”, well-documented in the MSDN article Using Code Access Security with ASP.NET.

Dart assemblies are marked with the 'AllowPartiallyTrustedCallers' assembly attribute for use in Partial Trust Environments. Using Dart's components in a Partial Trust environment requires additional configuration such as installing the component dll into the GAC or creating a custom security policy.

Installation into the GAC

When a Dart assembly is installed into the GAC, the component is granted full trust and asserts the required permissions at runtime so that no custom Security Policy is required. This is the preferred technique for using Dart components in Partial Trust environments.

Custom Security Policies

Security policy files are used to define a permission set that applications running under them can be granted. Under ASP.NET the web.config file can be used to specify which Security Policy should be used. Custom Security Policy files can be used to explicitly grant permissions that are required by the application and its references. However, some .NET Framework features are restricted regardless of Security Policy settings and will typically result in System.Security.SecurityException when used. Because of this, some components may have limited functionality in partial trust environments; if full functionality is required then the Dart component must be installed into the GAC.

Defining a Custom Security Policy

A custom Security Policy should only be used if an application using a Dart component is not run in Full Trust or the Dart component's assembly is not installed into the GAC.

Note: Version numbers mentioned in the following instructions reflect the version of the .NET Framework that permissions are being requested for; if .NET 2.0 is targeted then the appropriate version number should be substituted.

To define a custom Security Policy:

  1. Copy and paste the default web_mediumtrust.config file located at C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web_mediumtrust.config
  2. Rename the copied config file, ex: web_mediumtrust_custom.config

  3. Add the SocketPermission class definition to the SecurityClasses section:

    <SecurityClass
        Name="SocketPermission"
        Description="System.Net.SocketPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>

  4. Add SocketPermission to the ASP.NET NamedPermissionSet section:

    <Ipermission
         class="SocketPermission"
         version="1"
         Unrestricted="true" />

  5. Add the UnmanagedCode flag to the SecurityPermision definition:

    <Ipermission
         class="SecurityPermission"
         version="1"
         Flags="UnmanagedCode, Execution, ControlThread, ControlPrincipal, RemotingConfiguration" />

  6. Save the file

Configuring the Security Policy in web.config

To direct an ASP.NET application to use medium trust add the following to the system.web section:

<trust level="Medium"/>

To use a custom Security Policy, add the following to the system.web section:

<securityPolicy>
     <trustLevel name="CustomMedium" policyFile="C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web_mediumtrust_custom.config" />
</securityPolicy>
<trust level="CustomMedium"/>

Alternatively, an assembly that requires full trust can be added to the application's web.config securityPolicy section:

<securityPolicy>
   <fullTrustAssemblies>
     <add assemblyName="Dart.Snmp" version="4.7.0.0" publicKey="00240000048000009400000006020000002400005253413100040000010001003fc01cbb4168cbdbb48a763283bd3a3e48dba81e06c4179db0bf20ba775a188f5c06c7bc1d7f39c22d63a04e3c16b424da9174dc28a019097458bcbea3e0e5184854a07382e3329cf82ce6004731b25eb7b9d56d9682df5606806b894974d0d42b960a2498a756f38904a1cac14e41a9b5debb62276e94e37934d5f1cc9838dd"/>
   </fullTrustAssemblies>
</securityPolicy>

Update the assemblyName, version and publicKey as needed for the product in use. To extract the public key from an assembly, use the 'sn' utility with the '-Tp' option from the Visual Studio command prompt.


Security Overview

Security Overview
See Also Send comments on this topic

Glossary Item Box

What is a digital certificate?

Authentication is important for secure communications. Users must be able to prove their identity to the entities they are communicating with. In addition they must be able to verify the identity of the entity communicating with them. This is accomplished by presenting or verifying some form of trusted credentials.

A digital certificate is a common credential that provides authentication. A trusted organization, called a Certificate Authority (CA), assigns a certificate to a user or entity and the user or entity then uses the certificate to prove itself to the other side. A system may be configured your to accept any number of Certificate Authorities. Complete the following steps to access the Certificates dialog box:

  1. In the Control Panel, select Internet Options.
  2. Select the Content tab, and then click Certificates.

Where do I get a certificate?

Certificates must come from a trusted CA. A user submits a certificate request to a CA and the CA returns a certificate for the user to use. Listed below are some Certificate Authorities:

  • Microsoft Certificate Server - used for internal corporate Certificate delegation
  • VeriSign - (www.verisign.com) provides certificates for Internet users and servers

A digital certificate is always required for an application to operate as a secure server. A digital certificate is only required on the client if the server requests authentication.

How does the authentication process work?

  1. The client normally initiates the TCP connection. PowerTCP components make this connection, send a "client hello" message, and automatically respond to authentication requests received from the server.
  2. The server accepts the connection initiated by the client, constructs its digital credentials, and sends its credentials to the client.
  3. Optionally, the server may send an authentication request to the client.
  4. The client receives the server's credentials, verifies them against the CAs it is configured to trust, and responds with its own credentials if an authentication request is received.
  5. If the client and server cannot negotiate a mutually acceptable security protocol, an error is generated and the connection is closed.
  6. If the client cannot validate the server's credentials, an error is generated and the client closes the connection.
  7. If the server cannot validate the client's credentials (if requested), an error is generated and the server closes the connection.
  8. Once protocol negotiation and authentication is successful, secure encryption/decryption is performed on all data passing over the connection.
  9. The session is terminated when one side closes the connection.

What is a certificate store?

A certificate store is a location on the system (memory, disk, registry, etc.) where certificates are stored for use. There are three major system stores and other minor stores. The three major stores are:

  • MY - personal certificates go here
  • ROOT - certificates for Trusted Root Certificate Authorities
  • CA - all other certificates

There are other certificate stores. For example, the store "SPC" contains software publisher's certificates.

What are the system store and the machine store?

The system store is the certificate store located in the HKEY_CURRENT_USER registry key. The machine store is the certificate store located in the HKEY_LOCAL_MACHINE registry key. Applications installed as a service should store their certificates in the machine store since there is no current user when running as a service.

What is the X500 naming convention?

This is a format for creating a distinguished name. The different parts of the name are described below:

  • C - country you are in (ex. US)
  • S - state you are in (ex. New York)
  • L - locality value or city (ex. Syracuse)
  • O - your organization (ex. Dart)
  • OU - organizational unit (ex. Development)
  • CN - common name; typically the name of the system or user (Ex. MyMachine)

Here are some examples of X500 names:

  • C=US, S=New York, L=Syracuse, O=Dart, OU=Development, CN=My Machine
  • C=US, S=Georgia, L=Atlanta, O=MyOrg, OU=Toy Department, CN=John Doe

See Also

Reference
Dns Component
Ping Component
Server Component
Tcp Component
Udp Component


Security Implementation

Security Implementation
Send comments on this topic

Glossary Item Box

Client Security

AuthenticateAsClient() is used by client components to perform authentication after connecting to a server. For our Tcp component, this must be called directly, while for our application-layer protocol components, it will be called automatically after the connection is established when SSL is enabled.

When AuthenticateAsClient() is called (either directly, or through top-level methods that will utilize it), two things may occur:

The server presents a certificate:

This will raise the RemoteCertificateValidationCallback specified by Tcp.Session.Security.ValidationCallback. This callback must be in the format:

C# Copy Code
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
bool RemoteCertificateValidation(
    Object sender,
    X509Certificate remoteCertificate,
    X509Chain chain,
    SslPolicyErrors sslPolicyErrors)
{
    ...
}
Visual Basic Copy Code
Imports System.Net.Security
Imports System.Security.Cryptography.X509Certificates
Function RemoteCertificateValidation( _
    ByVal sender As Object, _
    ByVal remoteCertificate As X509Certificate, _
    ByVal chain As X509Chain, _
    ByVal sslPolicyErrors As SslPolicyErrors) As Boolean
    ...
End Function

Return true to accept the certificate, and false to refuse it. A value other than SslPolicyErrors.None for sslPolicyErrors indicates an issue with the certificate that the server presented. A flag of SslPolicyErrors.RemoteCertificateChainErrors indicates that chain.ChainStatus should be checked; enumerate through chain.ChainStatus, and check the value of chain.ChainStatus[index].Status for additional details.

During authentication, the remote certificate's common name (CN) (usually the server's fully qualified domain name) is compared to the value of ClientSecurity.TargetHost. If the values do not match, sslPolicyErrors will contain the SslPolicyErrors.RemoteCertificateNameMismatch flag. When ClientSecurity.TargetHost is left empty, Tcp.Session.RemoteEndPoint.HostNameOrAddress will be used instead.

The server requests a certificate:

AuthenticateAsClient() first checks if Tcp.Session.Security.SelectionCallback is null. If it is not null, that LocalCertificateSelectionCallback will be raised. This callback must be in the format:

C# Copy Code
using System.Security.Cryptography.X509Certificates;
X509Certificate LocalCertificateSelection(
    Object sender,
    string targetHost,
    X509CertificateCollection localCertificates,
    X509Certificate remoteCertificate,
    string[] acceptableIssuers)
{
    ...
}
Visual Basic Copy Code
Imports System.Security.Cryptography.X509Certificates
Function LocalCertificateSelection( _
    ByVal sender As Object, _
    ByVal targetHost As String, _
    ByVal localCertificates As X509CertificateCollection, _
    ByVal remoteCertificate As X509Certificate, _
    ByVal acceptableIssuers() As String) As X509Certificate
    ...
End Function

Return a certificate within the callback, and that certificate will be used for authentication. Certificates may be accessed from the certificate store with the System.Security.Cryptography.X509Certificates.X509Store class:

C# Copy Code
using System.Security.Cryptography.X509Certificates;
//The X509Store constructor overloads may be used to access different certificate stores
X509Store certificateStore = new X509Store();
certificateStore.Open(OpenFlags.ReadOnly);
X509Certificate2 cert = certificateStore.Certificates[0];
Visual Basic Copy Code
Imports System.Security.Cryptography.X509Certificates
'The X509Store constructor overloads may be used to access different certificate stores
Dim certificateStore As New X509Store()
certificateStore.Open(OpenFlags.ReadOnly)
Dim cert As X509Certificate2 = certificateStore.Certificates(0)

For a demonstration of selecting a certificate from the certificate store interactively, please see the CertificateListForm included with our samples.

If Tcp.Session.Security.SelectionCallback is null, AuthenticateAsClient() will examine Tcp.Session.Security.Certificates for a valid certificate; the first certificate in the collection that passes Microsoft's validation checks will be used for authentication.

Server Security

For our server component, Tcp.AuthenticateAsServer(ServerSecurity) may be called after the client connects. ServerSecurity.ValidationCallback is identical to the client ValidationCallback, and will be raised when the client presents a certificate.

Set the ServerSecurity.Certificate property to specify the certificate to use for authentication.

Security Protocol

The security protocol used will be automatically negotiated; to specify the protocols available for negotiation, Security.Protocols may be set to any combination of the SslProtocols enumeration.

Explicit/Implicit

Explicit security means that the initial connection to the server is not encrypted. After connecting, a command such as STARTTLS or STLS is sent by the client to the server per the protocol, and a secure connection is negotiated. Because explicit security is initiated after the STARTTLS command is sent, servers are able to accept explicit connections on the same port that accepts non-secure connections.

Implicit security means that the client and server will negotiate a secure connection when the connection is established. Because of this, a port is typically dedicated for implicit connections.

Explicit/Implicit implementation is protocol-specific; application-layer protocols such as Ftp, Imap, Smtp and Pop implement it, while upper-layer protocols such as Tcp and Udp do not. The method of encryption may be configured on our components with a property on Session.Security. The property's name may vary between components, but will always start with 'Encrypt'; for Ftp, this property is Session.Security.EncryptControl, and for our Email components, Session.Security.Encrypt.


Manage Certificates with MMC

Manage Certificates with MMC
See Also Send comments on this topic

Glossary Item Box

This document explains how to use the Microsoft Management Console (MMC) to import and export SSL Certificates. This is only one use for the MMC. Please see the MMC Documentation for more info.

Note: This document assumes the existing certificate is functional on the machine where the exporting takes place.

Start the MMC

The Microsoft Management Console (MMC) is part of Windows 2000 and later. It does not exist in NT or 9x. You may be able to do similar functions using IE, but IE versions vary so it will not be discussed here.

To start the MMC:

  1. Start -> Run -> MMC
  2. Choose File | Add/Remove Snap-in ...
  3. Click Add
  4. Select Certificates from the list and click the Add button
  5. Choose Computer account
  6. Choose Local Computer
  7. Click Close
  8. Click OK
  9. Repeat steps 2-8, substituting 'My user account' in step 5 and skipping step 6
  10. Choose File | Save As ... and save the settings to an .MSC file

In the future you can skip these steps by double-clicking the MSC file or by choosing the MSC from the history under the File menu.

Export an Existing Certificate

Follow these steps to save a certificate to a file. The file can then be used to import the certificate to another machine.

To export an existing certificate:

  1. Start the MMC by following the steps above or by clicking the MSC file saved previously
  2. Locate the Certificate that you wish to export. Certificates are using installed under the Personal ("MY") store in either the Local Machine or Current User stores
  3. Right Click on the certificate and choose All Tasks | Export
  4. Click Next
  5. Check 'Yes, export the private key' (If it's grayed out, the certificate can't be moved to another machine)
  6. Click Next
  7. Leave the Default setting at "Enable Strong Protection"
  8. Click Next
  9. Choose a password and click next
  10. Save the PFX file using a filename
  11. Click Next and you should see the "Completing the Certificate Export Wizard" screen
  12. Click Finish and you are done

The file you just saved can now be moved to another machine.

Import a Certificate

Follow these steps to move a certificate from one machine to another.

To import an existing certificate:

  1. Start the MMC by following the steps above or by clicking the MSC file saved previously
  2. Choose the store that you want to import to (EXAMPLE: Local Computer -> Personal)
  3. Right Click on the store and choose All Tasks | Import
  4. Click Next
  5. Browse to the PFX file that was previously saved
  6. Click Next
  7. Enter the password. If you want to allow the certificate to be exported again, check 'Mark this key as exportable'
  8. Click Next
  9. Check 'Place all certificates in the following store'
  10. Click Browse
  11. Check 'Show physical stores'
  12. Choose 'Personal' to store to the Current User store or 'Personal -> Registry' to store to the Local Machine store
  13. Click OK
  14. Click Finish

The certificate is now usable. However, unless the CA is already trusted (which is the case for major Certificate providers), users will be notified that the certificate itself is not trusted. To resolve this, go to the Website of the Certificate Authority that originally issued the certificate to obtain the CA's root certificate.

Note about importing certificates: PowerTCP requires that a certificate be properly imported into a valid Microsoft Certificate Store. If a certificate was created from a non-MS source (such as OpenSSL) , please be sure to export the certificate properly before importing it into an MS Certificate store. Check the help for whatever SSL system you are using for more information.

See Also

Reference
Dns Component
Ping Component
Server Component
Tcp Component
Udp Component


Dart.Sockets Namespace (Dart.Sockets)

Dart.Sockets Namespace (Dart.Sockets)
See Also Inheritance Hierarchy Send comments on this topic

Glossary Item Box

Classes

 | Class | Description
Class | ClientSecurity | Holds the configuration used to establish an SSL client session.
Class | ComponentBase | Base class for PowerTCP Components.
Class | ConnectionsChangedEventArgs | Provides data for the ConnectionsChanged event.
Class | DartLicenseException | The base class for all Dart component license exceptions.
Class | Data | Encapsulates data read or written.
Class | DataEventArgs | Provides data for reporting events.
Class | DataException | Thrown when the expected data could not be read.
Class | Datagram | Encapsulates a datagram read into a buffer.
Class | Dns | Supplements System.Net.Dns with the ability to retrieve MX records for any email address or mail server. Supports socket binding to a specified local IPEndPoint.
Class | DnsSlave | Used to perform DNS resolutions.
Class | Echo | Encapsulates an echo response from a server.
Class | EchoEventArgs | Provides data for the Echo event.
Class | ErrorEventArgs | Provides data for the Error event.
Class | IPEndPoint | Allows user to specify a range of IPEndPoints for local binding. Also resolves hostnames and saves them for future use.
Class | MxHostEntry | Provides the HostName and Preference provided by an MX record lookup.
Class | Ping | Provides classes and methods for Pinging (sending ICMP Echo requests).
Class | PingSlave | Used on each worker thread to provide a series of ICMP Echo (Ping) requests.
Class | ProtocolException | Thrown when an upper-layer protocol like FTP, SMTP or POP3 receives a negative response from the server.
Class | Proxy | Describes the server proxy, if any, to connect to.
Class | PtyBase | This class provides support for interactive on-line terminal access using controls derived from TextBoxBase.
Class | Security | Holds the configuration used to establish an SSL session.
Class | Segment | Used to describe a byte[] segment that holds data.
Class | Server | The Server component provides a framework for building non-secure and secure server applications.
Class | ServerSecurity | Holds the configuration used to establish an SSL server session.
Class | Session | Holds the configuration common to UDP and TCP.
Class | SocketBase | Base class for PowerTCP Components.
Class | SocketOption | Contains socket options that may be set by TCP and UDP sockets. These options are automatically applied to the connection used.
Class | Tcp | The Tcp component simplifies the use of secure Tcp communications within any .NET application.
Class | TcpBase | Base class for components utilizing protocols built upon the TCP protocol.
Class | TcpSession | Holds the configuration used by TCP.
Class | TcpSocketOption | Contains socket options that may be set by TCP sockets.
Class | Udp | The Udp component provides comprehensive User Datagram Protocol support.
Class | UdpBase | Base class for upper-layer protocols based on UDP.
Class | UdpSocketOption | Contains socket options that may be set by UDP sockets.
Class | UserStateEventArgs | Provides data for ComponentBase.UserState. Base class for EventArgs that have Message and UserState properties.

Delegates

 | Delegate | Description
Delegate | ConnectThreadStart | Represents the method that will execute on a worker thread after each TCP connection is accepted.
Delegate | DnsThreadStart | Represents the method that will execute on a worker thread when Start is used.
Delegate | PingThreadStart | Represents the method that will execute on a worker thread when Start is used.
Delegate | TcpAsyncCallback | References the method to invoke on an IO completion thread when the corresponding asynchronous operation completes.
Delegate | UdpAsyncCallback | References the method to invoke on an IO completion thread when the corresponding asynchronous operation completes.

Enumerations

 | Enumeration | Description
Enumeration | ConnectionState | Enumerates the possible values of the connection state.
Enumeration | DataDirection | Enumerates the direction of data flow.
Enumeration | Ping.Status | Enumerates the status of the ICMP echo request.
Enumeration | Ping.Type | Controls the software technology used to create the Ping.
Enumeration | ProxyType | Enumerates the provided proxy support that can be used.

See Also

Reference

Dart.Sockets Assembly


ClientSecurity Class

[image]
PowerTCP Sockets for .NET
ClientSecurity Class
Members See Also Send comments on this topic
Dart.Sockets Namespace : ClientSecurity Class

Glossary Item Box

Holds the configuration used to establish an SSL client session.

Object Model

ClientSecurity Class

Syntax

Visual Basic (Declaration)
<SerializableAttribute()>
Public Class ClientSecurity
   Inherits Security
Visual Basic (Usage) Copy Code
Dim instance As ClientSecurity
C#
[Serializable()]
public class ClientSecurity : Security
Managed Extensions for C++
[Serializable()]
public __gc class ClientSecurity : public Security
C++/CLI
[Serializable()]
public ref class ClientSecurity : public Security

Inheritance Hierarchy

System.Object
Dart.Sockets.Security
Dart.Sockets.ClientSecurity

See Also

Reference

ClientSecurity Members
Dart.Sockets Namespace


ClientSecurity Class Members

[image]
PowerTCP Sockets for .NET
ClientSecurity Class Members
See Also Fields Properties Send comments on this topic
Dart.Sockets Namespace : ClientSecurity Class

Glossary Item Box

The following tables list the members exposed by ClientSecurity.

Public Constructors

 | Name | Description
Public Constructor | ClientSecurity Constructor | The default constructor for ClientSecurity
Top

Public Fields

 | Name | Description
Public Field | SelectionCallback | The delegate that executes to permit selection of a cient certificate.
Public Field | ValidationCallback | The delegate that executes after the server provides its certificate to the client. (Inherited from Dart.Sockets.Security)
Top

Public Properties

 | Name | Description
Public Property | Certificates | Gets or sets a collection of client certificates to use during authentication.
Public Property | CheckCertificateRevocation | Indicates whether the certificate revocation list is checked during authentication. (Inherited from Dart.Sockets.Security)
Public Property | Protocols | Gets or sets the SSLProtocols available. (Inherited from Dart.Sockets.Security)
Public Property | TargetHost | Gets or sets the remote host to be authenticated.
Top

See Also

Reference

ClientSecurity Class
Dart.Sockets Namespace


ClientSecurity Constructor

[image]
PowerTCP Sockets for .NET
ClientSecurity Constructor
See Also Send comments on this topic
Dart.Sockets Namespace > ClientSecurity Class : ClientSecurity Constructor

Glossary Item Box

The default constructor for ClientSecurity

Syntax

Visual Basic (Declaration)
Public Function New()
Visual Basic (Usage) Copy Code
Dim instance As New ClientSecurity()
C#
public ClientSecurity()
Managed Extensions for C++
public: ClientSecurity();
C++/CLI
public:
ClientSecurity();

See Also

Reference

ClientSecurity Class
ClientSecurity Members


ClientSecurity Class Properties

[image]
PowerTCP Sockets for .NET
ClientSecurity Class Properties
See Also Send comments on this topic
Dart.Sockets Namespace : ClientSecurity Class

Glossary Item Box

For a list of all members of this type, see ClientSecurity members.

Public Properties

 | Name | Description
Public Property | Certificates | Gets or sets a collection of client certificates to use during authentication.
Public Property | CheckCertificateRevocation | Indicates whether the certificate revocation list is checked during authentication. (Inherited from Dart.Sockets.Security)
Public Property | Protocols | Gets or sets the SSLProtocols available. (Inherited from Dart.Sockets.Security)
Public Property | TargetHost | Gets or sets the remote host to be authenticated.
Top

See Also

Reference

ClientSecurity Class
Dart.Sockets Namespace


Certificates Property

[image]
PowerTCP Sockets for .NET
Certificates Property
See Also Send comments on this topic
Dart.Sockets Namespace > ClientSecurity Class : Certificates Property

Glossary Item Box

Gets or sets a collection of client certificates to use during authentication.

Syntax

Visual Basic (Declaration)
Public Property Certificates As X509CertificateCollection
Visual Basic (Usage) Copy Code
Dim instance As ClientSecurity
Dim value As X509CertificateCollection

instance.Certificates = value

value = instance.Certificates
C#
public X509CertificateCollection Certificates {get; set;}
Managed Extensions for C++
public: __property X509CertificateCollection* get_Certificates();
public: __property void set_Certificates(
   X509CertificateCollection* value
);
C++/CLI
public:
property X509CertificateCollection^ Certificates {
   X509CertificateCollection^ get();
   void set (    X509CertificateCollection^ value);
}

Remarks

If SelectionCallback is not null, the certificate chosen in the delegate will supercede any certificate present in this collection.

The first certificate in this collection that passes Microsoft's validation checks will be used during authentication.

See Also

Reference

ClientSecurity Class
ClientSecurity Members


TargetHost Property

[image]
PowerTCP Sockets for .NET
TargetHost Property
See Also Send comments on this topic
Dart.Sockets Namespace > ClientSecurity Class : TargetHost Property

Glossary Item Box

Gets or sets the remote host to be authenticated.

Syntax

Visual Basic (Declaration)
<DefaultValueAttribute()>
Public Property TargetHost As String
Visual Basic (Usage) Copy Code
Dim instance As ClientSecurity
Dim value As String

instance.TargetHost = value

value = instance.TargetHost
C#
[DefaultValue()]
public string TargetHost {get; set;}
Managed Extensions for C++
[DefaultValue()]
public: __property string* get_TargetHost();
public: __property void set_TargetHost(
   string* value
);
C++/CLI
[DefaultValue()]
public:
property String^ TargetHost {
   String^ get();
   void set (    String^ value);
}

Remarks

Used internally as the first parameter for SslStream.AuthenticateAsClient(), it will typically match the common name of the server-side certificate. .NET also uses this value to maintain an internal cache of SSL sessions that can be re-used.

If left empty, the value of the configured RemoteEndPoint.HostNameOrAddress will be used for authentication when available.

See Also

Reference

ClientSecurity Class
ClientSecurity Members


ClientSecurity Class Fields

[image]
PowerTCP Sockets for .NET
ClientSecurity Class Fields
See Also Send comments on this topic
Dart.Sockets Namespace : ClientSecurity Class

Glossary Item Box

For a list of all members of this type, see ClientSecurity members.

Public Fields

 | Name | Description
Public Field | SelectionCallback | The delegate that executes to permit selection of a cient certificate.
Public Field | ValidationCallback | The delegate that executes after the server provides its certificate to the client. (Inherited from Dart.Sockets.Security)
Top

See Also

Reference

ClientSecurity Class
Dart.Sockets Namespace


SelectionCallback Field

[image]
PowerTCP Sockets for .NET
SelectionCallback Field
See Also Send comments on this topic
Dart.Sockets Namespace > ClientSecurity Class : SelectionCallback Field

Glossary Item Box

The delegate that executes to permit selection of a cient certificate.

Syntax

Visual Basic (Declaration)
Public SelectionCallback As LocalCertificateSelectionCallback
Visual Basic (Usage) Copy Code
Dim instance As ClientSecurity
Dim value As LocalCertificateSelectionCallback

value = instance.SelectionCallback

instance.SelectionCallback = value
C#
public LocalCertificateSelectionCallback SelectionCallback
Managed Extensions for C++
public: LocalCertificateSelectionCallback* SelectionCallback
C++/CLI
public:
LocalCertificateSelectionCallback^ SelectionCallback

Remarks

If null, the Certificates collection will be examined for a valid certifiate.

The certificate returned in this delegate will supercede any certificate present in the Certificates collection.

See Also

Reference

ClientSecurity Class
ClientSecurity Members


ComponentBase Class

[image]
PowerTCP Sockets for .NET
ComponentBase Class
Members See Also Send comments on this topic
Dart.Sockets Namespace : ComponentBase Class

Glossary Item Box

Base class for PowerTCP Components.

Object Model

ComponentBase Class

Syntax

Visual Basic (Declaration)
Public Class ComponentBase
   Inherits System.ComponentModel.Component
Visual Basic (Usage) Copy Code
Dim instance As ComponentBase
C#
public class ComponentBase : System.ComponentModel.Component
Managed Extensions for C++
public __gc class ComponentBase : public System.ComponentModel.Component
C++/CLI
public ref class ComponentBase : public System.ComponentModel.Component

Inheritance Hierarchy

System.Object
System.MarshalByRefObject
System.ComponentModel.Component
Dart.Sockets.ComponentBase
Dart.Sockets.Dns
Dart.Sockets.Ping
Dart.Sockets.SocketBase

See Also

Reference

ComponentBase Members
Dart.Sockets Namespace


ComponentBase Class Members

[image]
PowerTCP Sockets for .NET
ComponentBase Class Members
See Also Properties Methods Events Send comments on this topic
Dart.Sockets Namespace : ComponentBase Class

Glossary Item Box

The following tables list the members exposed by ComponentBase.

Public Properties

 | Name | Description
Public Property | Container | (Inherited from System.ComponentModel.Component)
Public Property | Encoding | Character encoding used by the component.
Public Property | Site | (Inherited from System.ComponentModel.Component)
Public Property | SynchronizingObject | Gets or sets the object used to marshal data to the UI thread (for raising events).
Public Property | SyncRoot | Gets an object that is used to synchronize access to the upper layer protocol in use.
Public Property | Tag | Gets or sets an object that stores any user data.
Top

Protected Properties

 | Name | Description
Protected Property | CanRaiseEvents | (Inherited from System.ComponentModel.Component)
Protected Property | DesignMode | (Inherited from System.ComponentModel.Component)
Protected Property | Events | (Inherited from System.ComponentModel.Component)
Top

Public Methods

 | Name | Description
Public Method | CreateObjRef | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from System.MarshalByRefObject)
Public Method | Deserialize | Deserialize a previously serialized object.
Public Method | Dispose | Overloaded. (Inherited from System.ComponentModel.Component)
Public Method | GetLifetimeService | Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | InitializeLifetimeService | Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | Marshal | Overloaded. Marshals a string and/or object to the UI thread and raises the UserState event.
Public Method | Serialize | Serialize an object to the provided destination stream.
Public Method | ToString | (Inherited from System.ComponentModel.Component)
Top

Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from System.ComponentModel.Component)
Protected Method | GetService | (Inherited from System.ComponentModel.Component)
Protected Method | MemberwiseClone | Overloaded. Creates a shallow copy of the current System.MarshalByRefObject object. (Inherited from System.MarshalByRefObject)
Protected Method | OnError | Raises the Error event.
Protected Method | OnUserState | Raises the UserState event.
Top

Public Events

 | Name | Description
Public Event | Disposed | (Inherited from System.ComponentModel.Component)
Public Event | Error | Raised when Marshal(Exception) is used or an unhandled Exception is thrown in a worker thread created using Start.
Public Event | UserState | Raised when Marshal(String,Object) is used.
Top

See Also

Reference

ComponentBase Class
Dart.Sockets Namespace


ComponentBase Class Methods

[image]
PowerTCP Sockets for .NET
ComponentBase Class Methods
See Also Send comments on this topic
Dart.Sockets Namespace : ComponentBase Class

Glossary Item Box

For a list of all members of this type, see ComponentBase members.

Public Methods

 | Name | Description
Public Method | CreateObjRef | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from System.MarshalByRefObject)
Public Method | Deserialize | Deserialize a previously serialized object.
Public Method | Dispose | Overloaded. (Inherited from System.ComponentModel.Component)
Public Method | GetLifetimeService | Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | InitializeLifetimeService | Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | Marshal | Overloaded. Marshals a string and/or object to the UI thread and raises the UserState event.
Public Method | Serialize | Serialize an object to the provided destination stream.
Public Method | ToString | (Inherited from System.ComponentModel.Component)
Top

Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from System.ComponentModel.Component)
Protected Method | GetService | (Inherited from System.ComponentModel.Component)
Protected Method | MemberwiseClone | Overloaded. Creates a shallow copy of the current System.MarshalByRefObject object. (Inherited from System.MarshalByRefObject)
Protected Method | OnError | Raises the Error event.
Protected Method | OnUserState | Raises the UserState event.
Top

See Also

Reference

ComponentBase Class
Dart.Sockets Namespace


Deserialize Method

[image]
PowerTCP Sockets for .NET
Deserialize Method
See Also Send comments on this topic
Dart.Sockets Namespace > ComponentBase Class : Deserialize Method

serializedObject
A stream containing the serialized data to deserialize.

Glossary Item Box

Deserialize a previously serialized object.

Syntax

Visual Basic (Declaration)
Public Function Deserialize( _
   ByVal serializedObject As Stream _
) As Object
Visual Basic (Usage) Copy Code
Dim instance As ComponentBase
Dim serializedObject As Stream
Dim value As Object

value = instance.Deserialize(serializedObject)
C#
public object Deserialize(
   Stream serializedObject
)
Managed Extensions for C++
public: Object* Deserialize(
   Stream* serializedObject
)
C++/CLI
public:
Object^ Deserialize(
   Stream^ serializedObject
)

Parameters

serializedObject
A stream containing the serialized data to deserialize.

Return Value

The deserialized object.

Remarks

Provides a simple mechanism for restoring a previously serialized state. For example, the state (all runtime parameters) of a Session object could be saved. The provided serializedObject is read from its current position.

See Also

Reference

ComponentBase Class
ComponentBase Members


Marshal Method

[image]
PowerTCP Sockets for .NET
Marshal Method
See Also Send comments on this topic
Dart.Sockets Namespace > ComponentBase Class : Marshal Method

Glossary Item Box

Marshals a string and/or object to the UI thread and raises the UserState event.

Overload List

Overload | Description
Marshal(String,Object) | Marshals a string and/or object to the UI thread and raises the UserState event.
Marshal(Exception) | Marshals an exception to the UI thread and raises the Error event.

See Also

Reference

ComponentBase Class
ComponentBase Members


Marshal(String,Object) Method

[image]
PowerTCP Sockets for .NET
Marshal(String,Object) Method
See Also Send comments on this topic
Dart.Sockets Namespace > ComponentBase Class > Marshal Method : Marshal(String,Object) Method

message
Message to pass into the UserState event.
state
Object to pass to the UserState event; can be null.

Glossary Item Box

Marshals a string and/or object to the UI thread and raises the UserState event.

Syntax

Visual Basic (Declaration)
Public Overloads Sub Marshal( _
   ByVal message As String, _
   ByVal state As Object _
)
Visual Basic (Usage) Copy Code
Dim instance As ComponentBase
Dim message As String
Dim state As Object

instance.Marshal(message, state)
C#
public void Marshal(
   string message,
   object state
)
Managed Extensions for C++
public: void Marshal(
   string* message,
   Object* state
)
C++/CLI
public:
void Marshal(
   String^ message,
   Object^ state
)

Parameters

message
Message to pass into the UserState event.
state
Object to pass to the UserState event; can be null.

Remarks

Used to marshal a string and/or object from a worker thread to the UI thread for typical display purposes. It calls OnUserState, which raises the UserState event.

See the SynchronizingObject property for information on updating UI controls in your event handler. Internally, SynchronizingObject.BeginInvoke is used to marshal data when the SynchronizingObject is not null, and Delegate.DynamicInvoke is used when SynchronizingObject is null. This method is provided for convenience; the developer may use alternative methods for marshaling data as required.

See Also

Reference

ComponentBase Class
ComponentBase Members
Overload List


Marshal(Exception) Method

[image]
PowerTCP Sockets for .NET
Marshal(Exception) Method
See Also Send comments on this topic
Dart.Sockets Namespace > ComponentBase Class > Marshal Method : Marshal(Exception) Method

exception
The Exception to be marshaled.

Glossary Item Box

Marshals an exception to the UI thread and raises the Error event.

Syntax

Visual Basic (Declaration)
Public Overloads Sub Marshal( _
   ByVal exception As Exception _
)
Visual Basic (Usage) Copy Code
Dim instance As ComponentBase
Dim exception As Exception

instance.Marshal(exception)
C#
public void Marshal(
   Exception exception
)
Managed Extensions for C++
public: void Marshal(
   Exception* exception
)
C++/CLI
public:
void Marshal(
   Exception^ exception
)

Parameters

exception
The Exception to be marshaled.

Remarks

Used to marshal exceptions from a worker thread to the UI thread for typical display purposes. It calls OnError, which raises the Error event.

When Start is used, unhandled exceptions generated on worker threads are marshaled to the UI thread by this method.

See the SynchronizingObject property for information on updating UI controls in your event handler. Internally, SynchronizingObject.BeginInvoke is used to marshal data when the SynchronizingObject is not null, and Delegate.DynamicInvoke is used when SynchronizingObject is null. This method is provided for convenience; the developer may use alternative methods for marshaling data as required.

See Also

Reference

ComponentBase Class
ComponentBase Members
Overload List


OnError Method

[image]
PowerTCP Sockets for .NET
OnError Method
See Also Send comments on this topic
Dart.Sockets Namespace > ComponentBase Class : OnError Method

e
A ErrorEventArgs object that contains the exception.

Glossary Item Box

Raises the Error event.

Syntax

Visual Basic (Declaration)
Protected Overridable Sub OnError( _
   ByVal e As ErrorEventArgs _
)
Visual Basic (Usage) Copy Code
Dim instance As ComponentBase
Dim e As ErrorEventArgs

instance.OnError(e)
C#
protected virtual void OnError(
   ErrorEventArgs e
)
Managed Extensions for C++
protected: virtual void OnError(
   ErrorEventArgs* e
)
C++/CLI
protected:
virtual void OnError(
   ErrorEventArgs^ e
)

Parameters

e
A ErrorEventArgs object that contains the exception.

Remarks

If the Synchronizing property is set, this method invokes Error asynchronously on the UI thread. If the Synchronizing property is null, this method invokes the Error event on the executing thread.

OnError allows derived classes to handle the Error event without attaching a delegate, but marshaling is not provided. This is the preferred technique for handling the event in a derived class.

Note to Inheritors: When overriding OnError in a derived class, be sure to call the base class OnError method, so that registered delegates receive the event.

See the SynchronizingObject property for information on updating UI controls in your event handler.

See Also

Reference

ComponentBase Class
ComponentBase Members


OnUserState Method

[image]
PowerTCP Sockets for .NET
OnUserState Method
See Also Send comments on this topic
Dart.Sockets Namespace > ComponentBase Class : OnUserState Method

e
A UserStateEventArgs object that contains the user information.

Glossary Item Box

Raises the UserState event.

Syntax

Visual Basic (Declaration)
Protected Overridable Sub OnUserState( _
   ByVal e As UserStateEventArgs _
)
Visual Basic (Usage) Copy Code
Dim instance As ComponentBase
Dim e As UserStateEventArgs

instance.OnUserState(e)
C#
protected virtual void OnUserState(
   UserStateEventArgs e
)
Managed Extensions for C++
protected: virtual void OnUserState(
   UserStateEventArgs* e
)
C++/CLI
protected:
virtual void OnUserState(
   UserStateEventArgs^ e
)

Parameters

e
A UserStateEventArgs object that contains the user information.

Remarks

If the Synchronizing property is set, this method invokes UserState asynchronously on the UI thread. If the Synchronizing property is null, this method invokes UserState on the executing thread.

OnUserState allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class, but marshaling is not provided.

Note to Inheritors: When overriding OnUserState in a derived class, be sure to call the base class OnUserState method, so that registered delegates receive the event.

See the SynchronizingObject property for information on updating UI controls in your event handler.

See Also

Reference

ComponentBase Class
ComponentBase Members


Serialize Method

[image]
PowerTCP Sockets for .NET
Serialize Method
See Also Send comments on this topic
Dart.Sockets Namespace > ComponentBase Class : Serialize Method

objectToSerialize
Object to serialize.
destination
Stream destination for the serialized data.

Glossary Item Box

Serialize an object to the provided destination stream.

Syntax

Visual Basic (Declaration)
Public Sub Serialize( _
   ByVal objectToSerialize As Object, _
   ByVal destination As Stream _
)
Visual Basic (Usage) Copy Code
Dim instance As ComponentBase
Dim objectToSerialize As Object
Dim destination As Stream

instance.Serialize(objectToSerialize, destination)
C#
public void Serialize(
   object objectToSerialize,
   Stream destination
)
Managed Extensions for C++
public: void Serialize(
   Object* objectToSerialize,
   Stream* destination
)
C++/CLI
public:
void Serialize(
   Object^ objectToSerialize,
   Stream^ destination
)

Parameters

objectToSerialize
Object to serialize.
destination
Stream destination for the serialized data.

Remarks

Can be used at runtime to persist the state of an object. For example, all runtime parameters of a Session object could be saved.

See Also

Reference

ComponentBase Class
ComponentBase Members


ComponentBase Class Properties

[image]
PowerTCP Sockets for .NET
ComponentBase Class Properties
See Also Send comments on this topic
Dart.Sockets Namespace : ComponentBase Class

Glossary Item Box

For a list of all members of this type, see ComponentBase members.

Public Properties

 | Name | Description
Public Property | Container | (Inherited from System.ComponentModel.Component)
Public Property | Encoding | Character encoding used by the component.
Public Property | Site | (Inherited from System.ComponentModel.Component)
Public Property | SynchronizingObject | Gets or sets the object used to marshal data to the UI thread (for raising events).
Public Property | SyncRoot | Gets an object that is used to synchronize access to the upper layer protocol in use.
Public Property | Tag | Gets or sets an object that stores any user data.
Top

Protected Properties

 | Name | Description
Protected Property | CanRaiseEvents | (Inherited from System.ComponentModel.Component)
Protected Property | DesignMode | (Inherited from System.ComponentModel.Component)
Protected Property | Events | (Inherited from System.ComponentModel.Component)
Top

See Also

Reference

ComponentBase Class
Dart.Sockets Namespace


Encoding Property

[image]
PowerTCP Sockets for .NET
Encoding Property
See Also Send comments on this topic
Dart.Sockets Namespace > ComponentBase Class : Encoding Property

Glossary Item Box

Character encoding used by the component.

Syntax

Visual Basic (Declaration)
Public Overridable Property Encoding As Encoding
Visual Basic (Usage) Copy Code
Dim instance As ComponentBase
Dim value As Encoding

instance.Encoding = value

value = instance.Encoding
C#
public virtual Encoding Encoding {get; set;}
Managed Extensions for C++
public: __property virtual Encoding* get_Encoding();
public: __property virtual void set_Encoding(
   Encoding* value
);
C++/CLI
public:
virtual property Encoding^ Encoding {
   Encoding^ get();
   void set (    Encoding^ value);
}

See Also

Reference

ComponentBase Class
ComponentBase Members


SynchronizingObject Property

[image]
PowerTCP Sockets for .NET
SynchronizingObject Property
See Also Send comments on this topic
Dart.Sockets Namespace > ComponentBase Class : SynchronizingObject Property

Glossary Item Box

Gets or sets the object used to marshal data to the UI thread (for raising events).

Syntax

Visual Basic (Declaration)
<DefaultValueAttribute()>
Public Property SynchronizingObject As ISynchronizeInvoke
Visual Basic (Usage) Copy Code
Dim instance As ComponentBase
Dim value As ISynchronizeInvoke

instance.SynchronizingObject = value

value = instance.SynchronizingObject
C#
[DefaultValue()]
public ISynchronizeInvoke SynchronizingObject {get; set;}
Managed Extensions for C++
[DefaultValue()]
public: __property ISynchronizeInvoke* get_SynchronizingObject();
public: __property void set_SynchronizingObject(
   ISynchronizeInvoke* value
);
C++/CLI
[DefaultValue()]
public:
property ISynchronizeInvoke^ SynchronizingObject {
   ISynchronizeInvoke^ get();
   void set (    ISynchronizeInvoke^ value);
}

Remarks

This property determines the thread on which the component's event handlers are raised. If set to a UI control, events are raised on the UI thread. If null, events are raised on the current thread.

This property is automatically set to the containing control when used in the Windows Forms designer. When a derived class is dynamically created this property must be set if marshaling to the UI thread is desired.

See Also

Reference

ComponentBase Class
ComponentBase Members


SyncRoot Property

[image]
PowerTCP Sockets for .NET
SyncRoot Property
See Also Send comments on this topic
Dart.Sockets Namespace > ComponentBase Class : SyncRoot Property

Glossary Item Box

Gets an object that is used to synchronize access to the upper layer protocol in use.

Syntax

Visual Basic (Declaration)
Public ReadOnly Property SyncRoot As Object
Visual Basic (Usage) Copy Code
Dim instance As ComponentBase
Dim value As Object

value = instance.SyncRoot
C#
public object SyncRoot {get;}
Managed Extensions for C++
public: __property Object* get_SyncRoot();
C++/CLI
public:
property Object^ SyncRoot {
   Object^ get();
}

Remarks

Upper layer protocols typically send a command and wait for it to complete. Use of this object in a C# "lock" statement can allow your code to wait until any ongoing command has completed.

See Also

Reference

ComponentBase Class
ComponentBase Members


Tag Property

[image]
PowerTCP Sockets for .NET
Tag Property
See Also Send comments on this topic
Dart.Sockets Namespace > ComponentBase Class : Tag Property

Glossary Item Box

Gets or sets an object that stores any user data.

Syntax

Visual Basic (Declaration)
<DefaultValueAttribute()>
Public Property Tag As Object
Visual Basic (Usage) Copy Code
Dim instance As ComponentBase
Dim value As Object

instance.Tag = value

value = instance.Tag
C#
[DefaultValue()]
public object Tag {get; set;}
Managed Extensions for C++
[DefaultValue()]
public: __property Object* get_Tag();
public: __property void set_Tag(
   Object* value
);
C++/CLI
[DefaultValue()]
public:
property Object^ Tag {
   Object^ get();
   void set (    Object^ value);
}

See Also

Reference

ComponentBase Class
ComponentBase Members


ComponentBase Class Events

[image]
PowerTCP Sockets for .NET
ComponentBase Class Events
See Also Send comments on this topic
Dart.Sockets Namespace : ComponentBase Class

Glossary Item Box

For a list of all members of this type, see ComponentBase members.

Public Events

 | Name | Description
Public Event | Disposed | (Inherited from System.ComponentModel.Component)
Public Event | Error | Raised when Marshal(Exception) is used or an unhandled Exception is thrown in a worker thread created using Start.
Public Event | UserState | Raised when Marshal(String,Object) is used.
Top

See Also

Reference

ComponentBase Class
Dart.Sockets Namespace


Error Event

[image]
PowerTCP Sockets for .NET
Error Event
See Also Send comments on this topic
Dart.Sockets Namespace > ComponentBase Class : Error Event

Glossary Item Box

Raised when Marshal(Exception) is used or an unhandled Exception is thrown in a worker thread created using Start.

Syntax

Visual Basic (Declaration)
Public Event Error As EventHandler(Of ErrorEventArgs)
Visual Basic (Usage) Copy Code
Dim instance As ComponentBase
Dim handler As EventHandler(Of ErrorEventArgs)

AddHandler instance.Error, handler
C#
public event EventHandler<ErrorEventArgs> Error
Managed Extensions for C++
public: __event EventHandler<ErrorEventArgs*>* Error
C++/CLI
public:
event EventHandler<ErrorEventArgs^>^ Error

Remarks

See the SynchronizingObject property for information on updating UI controls in your event handler.

See Also

Reference

ComponentBase Class
ComponentBase Members


UserState Event

[image]
PowerTCP Sockets for .NET
UserState Event
See Also Send comments on this topic
Dart.Sockets Namespace > ComponentBase Class : UserState Event

Glossary Item Box

Raised when Marshal(String,Object) is used.

Syntax

Visual Basic (Declaration)
Public Event UserState As EventHandler(Of UserStateEventArgs)
Visual Basic (Usage) Copy Code
Dim instance As ComponentBase
Dim handler As EventHandler(Of UserStateEventArgs)

AddHandler instance.UserState, handler
C#
public event EventHandler<UserStateEventArgs> UserState
Managed Extensions for C++
public: __event EventHandler<UserStateEventArgs*>* UserState
C++/CLI
public:
event EventHandler<UserStateEventArgs^>^ UserState

Event Data

The event handler receives an argument of type UserStateEventArgs containing data related to this event. The following UserStateEventArgs properties provide information specific to this event.

Property | Description
Message | Returns the message argument provided by the Marshal method.
UserState | Returns the user state argument provided by the Marshal method.

Remarks

See the SynchronizingObject property for information on updating UI controls in your event handler.

See Also

Reference

ComponentBase Class
ComponentBase Members


ConnectionsChangedEventArgs Class

[image]
PowerTCP Sockets for .NET
ConnectionsChangedEventArgs Class
Members See Also Send comments on this topic
Dart.Sockets Namespace : ConnectionsChangedEventArgs Class

Glossary Item Box

Provides data for the ConnectionsChanged event.

Object Model

ConnectionsChangedEventArgs ClassTcp Class

Syntax

Visual Basic (Declaration)
Public Class ConnectionsChangedEventArgs
   Inherits System.EventArgs
Visual Basic (Usage) Copy Code
Dim instance As ConnectionsChangedEventArgs
C#
public class ConnectionsChangedEventArgs : System.EventArgs
Managed Extensions for C++
public __gc class ConnectionsChangedEventArgs : public System.EventArgs
C++/CLI
public ref class ConnectionsChangedEventArgs : public System.EventArgs

Inheritance Hierarchy

System.Object
System.EventArgs
Dart.Sockets.ConnectionsChangedEventArgs

See Also

Reference

ConnectionsChangedEventArgs Members
Dart.Sockets Namespace


ConnectionsChangedEventArgs Class Members

[image]
PowerTCP Sockets for .NET
ConnectionsChangedEventArgs Class Members
See Also Properties Send comments on this topic
Dart.Sockets Namespace : ConnectionsChangedEventArgs Class

Glossary Item Box

The following tables list the members exposed by ConnectionsChangedEventArgs.

Public Properties

 | Name | Description
Public Property | Connection | Gets the Tcp object provided by the ConnectionsChanged event.
Top

See Also

Reference

ConnectionsChangedEventArgs Class
Dart.Sockets Namespace


ConnectionsChangedEventArgs Class Properties

[image]
PowerTCP Sockets for .NET
ConnectionsChangedEventArgs Class Properties
See Also Send comments on this topic
Dart.Sockets Namespace : ConnectionsChangedEventArgs Class

Glossary Item Box

For a list of all members of this type, see ConnectionsChangedEventArgs members.

Public Properties

 | Name | Description
Public Property | Connection | Gets the Tcp object provided by the ConnectionsChanged event.
Top

See Also

Reference

ConnectionsChangedEventArgs Class
Dart.Sockets Namespace


Connection Property

[image]
PowerTCP Sockets for .NET
Connection Property
See Also Send comments on this topic
Dart.Sockets Namespace > ConnectionsChangedEventArgs Class : Connection Property

Glossary Item Box

Gets the Tcp object provided by the ConnectionsChanged event.

Syntax

Visual Basic (Declaration)
Public ReadOnly Property Connection As Tcp
Visual Basic (Usage) Copy Code
Dim instance As ConnectionsChangedEventArgs
Dim value As Tcp

value = instance.Connection
C#
public Tcp Connection {get;}
Managed Extensions for C++
public: __property Tcp* get_Connection();
C++/CLI
public:
property Tcp^ Connection {
   Tcp^ get();
}

See Also

Reference

ConnectionsChangedEventArgs Class
ConnectionsChangedEventArgs Members


DartLicenseException Class

[image]
PowerTCP Sockets for .NET
DartLicenseException Class
Members See Also Send comments on this topic
Dart.Sockets Namespace : DartLicenseException Class

Glossary Item Box

The base class for all Dart component license exceptions.

Object Model

DartLicenseException Class

Syntax

Visual Basic (Declaration)
<SerializableAttribute()>
Public Class DartLicenseException
   Inherits System.Exception
Visual Basic (Usage) Copy Code
Dim instance As DartLicenseException
C#
[Serializable()]
public class DartLicenseException : System.Exception
Managed Extensions for C++
[Serializable()]
public __gc class DartLicenseException : public System.Exception
C++/CLI
[Serializable()]
public ref class DartLicenseException : public System.Exception

Remarks

Use the DartLicenseException class to catch runtime licensing exceptions. These exceptions are thrown at component creation time and during access of select properties or methods. The Message property will provide a description of the specific licensing problem encountered. The InnerException property should also be examined for additional details.

Inheritance Hierarchy

System.Object
System.Exception
Dart.Sockets.DartLicenseException

See Also

Reference

DartLicenseException Members
Dart.Sockets Namespace


DartLicenseException Class Members

[image]
PowerTCP Sockets for .NET
DartLicenseException Class Members
See Also Properties Methods Events Send comments on this topic
Dart.Sockets Namespace : DartLicenseException Class

Glossary Item Box

The following tables list the members exposed by DartLicenseException.

Public Properties

 | Name | Description
Public Property | Data | Gets a collection of key/value pairs that provide additional user-defined information about the exception. (Inherited from System.Exception)
Public Property | HelpLink | Gets or sets a link to the help file associated with this exception. (Inherited from System.Exception)
Public Property | HResult | Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception. (Inherited from System.Exception)
Public Property | InnerException | Gets the System.Exception instance that caused the current exception. (Inherited from System.Exception)
Public Property | Message | Gets a message that describes the current exception. (Inherited from System.Exception)
Public Property | Source | Gets or sets the name of the application or the object that causes the error. (Inherited from System.Exception)
Public Property | StackTrace | Gets a string representation of the immediate frames on the call stack. (Inherited from System.Exception)
Public Property | TargetSite | Gets the method that throws the current exception. (Inherited from System.Exception)
Top

Public Methods

 | Name | Description
Public Method | GetBaseException | When overridden in a derived class, returns the System.Exception that is the root cause of one or more subsequent exceptions. (Inherited from System.Exception)
Public Method | GetObjectData | When overridden in a derived class, sets the System.Runtime.Serialization.SerializationInfo with information about the exception. (Inherited from System.Exception)
Public Method | GetType | Gets the runtime type of the current instance. (Inherited from System.Exception)
Public Method | ToString | Creates and returns a string representation of the current exception. (Inherited from System.Exception)
Top

Protected Events

 | Name | Description
Protected Event | SerializeObjectState | Occurs when an exception is serialized to create an exception state object that contains serialized data about the exception. (Inherited from System.Exception)
Top

See Also

Reference

DartLicenseException Class
Dart.Sockets Namespace


Data Class

[image]
PowerTCP Sockets for .NET
Data Class
Members See Also Send comments on this topic
Dart.Sockets Namespace : Data Class

Glossary Item Box

Encapsulates data read or written.

Object Model

Data Class

Syntax

Visual Basic (Declaration)
Public Class Data
   Inherits Segment
Visual Basic (Usage) Copy Code
Dim instance As Data
C#
public class Data : Segment
Managed Extensions for C++
public __gc class Data : public Segment
C++/CLI
public ref class Data : public Segment

Inheritance Hierarchy

System.Object
Dart.Sockets.Segment
Dart.Sockets.Data
Dart.Sockets.Datagram

See Also

Reference

Data Members
Dart.Sockets Namespace


Data Class Members

[image]
PowerTCP Sockets for .NET
Data Class Members
See Also Properties Methods Send comments on this topic
Dart.Sockets Namespace : Data Class

Glossary Item Box

The following tables list the members exposed by Data.

Public Properties

 | Name | Description
Public Property | Buffer | Gets the buffer that holds data. (Inherited from Dart.Sockets.Segment)
Public Property | Count | Byte count of data. (Inherited from Dart.Sockets.Segment)
Public Property | Delimiter | Gets the delimiter byte array used by TcpBase.ReadToDelimiter.
Public Property | Direction | Indicates whether data is inbound or outbound.
Public Property | Encoding | Gets the character encoding used by the object.
Public Property | Offset | The offset into the buffer where the data starts. (Inherited from Dart.Sockets.Segment)
Top

Public Methods

 | Name | Description
Public Method | ToString | Gets the data as a decoded string.
Top

See Also

Reference

Data Class
Dart.Sockets Namespace


Data Class Methods

[image]
PowerTCP Sockets for .NET
Data Class Methods
See Also Send comments on this topic
Dart.Sockets Namespace : Data Class

Glossary Item Box

For a list of all members of this type, see Data members.

Public Methods

 | Name | Description
Public Method | ToString | Gets the data as a decoded string.
Top

See Also

Reference

Data Class
Dart.Sockets Namespace


ToString Method

[image]
PowerTCP Sockets for .NET
ToString Method
See Also Send comments on this topic
Dart.Sockets Namespace > Data Class : ToString Method

Glossary Item Box

Gets the data as a decoded string.

Syntax

Visual Basic (Declaration)
Public Overrides Function ToString() As String
Visual Basic (Usage) Copy Code
Dim instance As Data
Dim value As String

value = instance.ToString()
C#
public override string ToString()
Managed Extensions for C++
public: string* ToString(); override
C++/CLI
public:
String^ ToString(); override

Return Value

The System.Buffer decoded into a string using Encoding.

See Also

Reference

Data Class
Data Members


Data Class Properties

[image]
PowerTCP Sockets for .NET
Data Class Properties
See Also Send comments on this topic
Dart.Sockets Namespace : Data Class

Glossary Item Box

For a list of all members of this type, see Data members.

Public Properties

 | Name | Description
Public Property | Buffer | Gets the buffer that holds data. (Inherited from Dart.Sockets.Segment)
Public Property | Count | Byte count of data. (Inherited from Dart.Sockets.Segment)
Public Property | Delimiter | Gets the delimiter byte array used by TcpBase.ReadToDelimiter.
Public Property | Direction | Indicates whether data is inbound or outbound.
Public Property | Encoding | Gets the character encoding used by the object.
Public Property | Offset | The offset into the buffer where the data starts. (Inherited from Dart.Sockets.Segment)
Top

See Also

Reference

Data Class
Dart.Sockets Namespace


Delimiter Property

[image]
PowerTCP Sockets for .NET
Delimiter Property
See Also Send comments on this topic
Dart.Sockets Namespace > Data Class : Delimiter Property

Glossary Item Box

Gets the delimiter byte array used by TcpBase.ReadToDelimiter.

Syntax

Visual Basic (Declaration)
Public ReadOnly Property Delimiter As Byte()
Visual Basic (Usage) Copy Code
Dim instance As Data
Dim value() As Byte

value = instance.Delimiter
C#
public byte[] Delimiter {get;}
Managed Extensions for C++
public: __property byte[]* get_Delimiter();
C++/CLI
public:
property array<byte>^ Delimiter {
   array<byte>^ get();
}

Property Value

Null if no delimiter was used or no delimiter was found. Otherwise, the delimiter byte array.

See Also

Reference

Data Class
Data Members


Direction Property

[image]
PowerTCP Sockets for .NET
Direction Property
See Also Send comments on this topic
Dart.Sockets Namespace > Data Class : Direction Property

Glossary Item Box

Indicates whether data is inbound or outbound.

Syntax

Visual Basic (Declaration)
Public ReadOnly Property Direction As DataDirection
Visual Basic (Usage) Copy Code
Dim instance As Data
Dim value As DataDirection

value = instance.Direction
C#
public DataDirection Direction {get;}
Managed Extensions for C++
public: __property DataDirection get_Direction();
C++/CLI
public:
property DataDirection Direction {
   DataDirection get();
}

See Also

Reference

Data Class
Data Members


Encoding Property

[image]
PowerTCP Sockets for .NET
Encoding Property
See Also Send comments on this topic
Dart.Sockets Namespace > Data Class : Encoding Property

Glossary Item Box

Gets the character encoding used by the object.

Syntax

Visual Basic (Declaration)
Public ReadOnly Property Encoding As Encoding
Visual Basic (Usage) Copy Code
Dim instance As Data
Dim value As Encoding

value = instance.Encoding
C#
public Encoding Encoding {get;}
Managed Extensions for C++
public: __property Encoding* get_Encoding();
C++/CLI
public:
property Encoding^ Encoding {
   Encoding^ get();
}

See Also

Reference

Data Class
Data Members


DataEventArgs Class

[image]
PowerTCP Sockets for .NET
DataEventArgs Class
Members See Also Send comments on this topic
Dart.Sockets Namespace : DataEventArgs Class

Glossary Item Box

Provides data for reporting events.

Object Model

DataEventArgs ClassData Class

Syntax

Visual Basic (Declaration)
Public Class DataEventArgs
   Inherits UserStateEventArgs
Visual Basic (Usage) Copy Code
Dim instance As DataEventArgs
C#
public class DataEventArgs : UserStateEventArgs
Managed Extensions for C++
public __gc class DataEventArgs : public UserStateEventArgs
C++/CLI
public ref class DataEventArgs : public UserStateEventArgs

Inheritance Hierarchy

System.Object
System.EventArgs
Dart.Sockets.UserStateEventArgs
Dart.Sockets.DataEventArgs

See Also

Reference

DataEventArgs Members
Dart.Sockets Namespace


DataEventArgs Class Members

[image]
PowerTCP Sockets for .NET
DataEventArgs Class Members
See Also Properties Methods Send comments on this topic
Dart.Sockets Namespace : DataEventArgs Class

Glossary Item Box

The following tables list the members exposed by DataEventArgs.

Public Properties

 | Name | Description
Public Property | Data | Gets data provided by Data and Log events.
Public Property | Message | Returns the message argument provided by the Marshal method. (Inherited from Dart.Sockets.UserStateEventArgs)
Public Property | UserState | Returns the user state argument provided by the Marshal method. (Inherited from Dart.Sockets.UserStateEventArgs)
Top

Public Methods

 | Name | Description
Public Method | ToString | Gets the Data property as a decoded string.
Top

See Also

Reference

DataEventArgs Class
Dart.Sockets Namespace


DataEventArgs Class Methods

[image]
PowerTCP Sockets for .NET
DataEventArgs Class Methods
See Also Send comments on this topic
Dart.Sockets Namespace : DataEventArgs Class

Glossary Item Box

For a list of all members of this type, see DataEventArgs members.

Public Methods

 | Name | Description
Public Method | ToString | Gets the Data property as a decoded string.
Top

See Also

Reference

DataEventArgs Class
Dart.Sockets Namespace


ToString Method

[image]
PowerTCP Sockets for .NET
ToString Method
See Also Send comments on this topic
Dart.Sockets Namespace > DataEventArgs Class : ToString Method

Glossary Item Box

Gets the Data property as a decoded string.

Syntax

Visual Basic (Declaration)
Public Overrides Function ToString() As String
Visual Basic (Usage) Copy Code
Dim instance As DataEventArgs
Dim value As String

value = instance.ToString()
C#
public override string ToString()
Managed Extensions for C++
public: string* ToString(); override
C++/CLI
public:
String^ ToString(); override

Return Value

The Data.Buffer decoded into a string using the Data.Encoding specified.

See Also

Reference

DataEventArgs Class
DataEventArgs Members


DataEventArgs Class Properties

[image]
PowerTCP Sockets for .NET
DataEventArgs Class Properties
See Also Send comments on this topic
Dart.Sockets Namespace : DataEventArgs Class

Glossary Item Box

For a list of all members of this type, see DataEventArgs members.

Public Properties

 | Name | Description
Public Property | Data | Gets data provided by Data and Log events.
Public Property | Message | Returns the message argument provided by the Marshal method. (Inherited from Dart.Sockets.UserStateEventArgs)
Public Property | UserState | Returns the user state argument provided by the Marshal method. (Inherited from Dart.Sockets.UserStateEventArgs)
Top

See Also

Reference

DataEventArgs Class
Dart.Sockets Namespace


Data Property

[image]
PowerTCP Sockets for .NET
Data Property
See Also Send comments on this topic
Dart.Sockets Namespace > DataEventArgs Class : Data Property

Glossary Item Box

Gets data provided by Data and Log events.

Syntax

Visual Basic (Declaration)
Public ReadOnly Property Data As Data
Visual Basic (Usage) Copy Code
Dim instance As DataEventArgs
Dim value As Data

value = instance.Data
C#
public Data Data {get;}
Managed Extensions for C++
public: __property Data* get_Data();
C++/CLI
public:
property Data^ Data {
   Data^ get();
}

See Also

Reference

DataEventArgs Class
DataEventArgs Members


DataException Class

[image]
PowerTCP Sockets for .NET
DataException Class
Members See Also Send comments on this topic
Dart.Sockets Namespace : DataException Class

Glossary Item Box

Thrown when the expected data could not be read.

Object Model

DataException Class

Syntax

Visual Basic (Declaration)
<SerializableAttribute()>
Public Class DataException
   Inherits System.ApplicationException
Visual Basic (Usage) Copy Code
Dim instance As DataException
C#
[Serializable()]
public class DataException : System.ApplicationException
Managed Extensions for C++
[Serializable()]
public __gc class DataException : public System.ApplicationException
C++/CLI
[Serializable()]
public ref class DataException : public System.ApplicationException

Inheritance Hierarchy

System.Object
System.Exception
System.ApplicationException
Dart.Sockets.DataException

See Also

Reference

DataException Members
Dart.Sockets Namespace


DataException Class Members

[image]
PowerTCP Sockets for .NET
DataException Class Members
See Also Fields Properties Methods Events Send comments on this topic
Dart.Sockets Namespace : DataException Class

Glossary Item Box

The following tables list the members exposed by DataException.

Public Fields

 | Name | Description
Public Field | DataRead | Data read from the socket before a failure generated this exception.
Top

Public Properties

 | Name | Description
Public Property | Data | Gets a collection of key/value pairs that provide additional user-defined information about the exception. (Inherited from System.Exception)
Public Property | HelpLink | Gets or sets a link to the help file associated with this exception. (Inherited from System.Exception)
Public Property | HResult | Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception. (Inherited from System.Exception)
Public Property | InnerException | Gets the System.Exception instance that caused the current exception. (Inherited from System.Exception)
Public Property | Message | Gets a message that describes the current exception. (Inherited from System.Exception)
Public Property | Source | Gets or sets the name of the application or the object that causes the error. (Inherited from System.Exception)
Public Property | StackTrace | Gets a string representation of the immediate frames on the call stack. (Inherited from System.Exception)
Public Property | TargetSite | Gets the method that throws the current exception. (Inherited from System.Exception)
Top

Public Methods

 | Name | Description
Public Method | GetBaseException | When overridden in a derived class, returns the System.Exception that is the root cause of one or more subsequent exceptions. (Inherited from System.Exception)
Public Method | GetObjectData | When overridden in a derived class, sets the System.Runtime.Serialization.SerializationInfo with information about the exception. (Inherited from System.Exception)
Public Method | GetType | Gets the runtime type of the current instance. (Inherited from System.Exception)
Public Method | ToString | Creates and returns a string representation of the current exception. (Inherited from System.Exception)
Top

Protected Events

 | Name | Description
Protected Event | SerializeObjectState | Occurs when an exception is serialized to create an exception state object that contains serialized data about the exception. (Inherited from System.Exception)
Top

See Also

Reference

DataException Class
Dart.Sockets Namespace


DataException Class Fields

[image]
PowerTCP Sockets for .NET
DataException Class Fields
See Also Send comments on this topic
Dart.Sockets Namespace : DataException Class

Glossary Item Box

For a list of all members of this type, see DataException members.

Public Fields

 | Name | Description
Public Field | DataRead | Data read from the socket before a failure generated this exception.
Top

See Also

Reference

DataException Class
Dart.Sockets Namespace


DataRead Field

[image]
PowerTCP Sockets for .NET
DataRead Field
See Also Send comments on this topic
Dart.Sockets Namespace > DataException Class : DataRead Field

Glossary Item Box

Data read from the socket before a failure generated this exception.

Syntax

Visual Basic (Declaration)
Public ReadOnly DataRead As Data
Visual Basic (Usage) Copy Code
Dim instance As DataException
Dim value As Data

value = instance.DataRead
C#
public readonly Data DataRead
Managed Extensions for C++
public: readonly Data* DataRead
C++/CLI
public:
readonly Data^ DataRead

See Also

Reference

DataException Class
DataException Members


Datagram Class

[image]
PowerTCP Sockets for .NET
Datagram Class
Members See Also Send comments on this topic
Dart.Sockets Namespace : Datagram Class

Glossary Item Box

Encapsulates a datagram read into a buffer.

Object Model

Datagram Class

Syntax

Visual Basic (Declaration)
Public Class Datagram
   Inherits Data
Visual Basic (Usage) Copy Code
Dim instance As Datagram
C#
public class Datagram : Data
Managed Extensions for C++
public __gc class Datagram : public Data
C++/CLI
public ref class Datagram : public Data

Inheritance Hierarchy

System.Object
Dart.Sockets.Segment
Dart.Sockets.Data
Dart.Sockets.Datagram

See Also

Reference

Datagram Members
Dart.Sockets Namespace


Datagram Class Members

[image]
PowerTCP Sockets for .NET
Datagram Class Members
See Also Fields Properties Methods Send comments on this topic
Dart.Sockets Namespace : Datagram Class

Glossary Item Box

The following tables list the members exposed by Datagram.

Public Fields

 | Name | Description
Public Field | Origin | The origin of the datagram sent or received.
Top

Public Properties

 | Name | Description
Public Property | Buffer | Gets the buffer that holds data. (Inherited from Dart.Sockets.Segment)
Public Property | Count | Byte count of data. (Inherited from Dart.Sockets.Segment)
Public Property | Delimiter | Gets the delimiter byte array used by TcpBase.ReadToDelimiter. (Inherited from Dart.Sockets.Data)
Public Property | Direction | Indicates whether data is inbound or outbound. (Inherited from Dart.Sockets.Data)
Public Property | Encoding | Gets the character encoding used by the object. (Inherited from Dart.Sockets.Data)
Public Property | Offset | The offset into the buffer where the data starts. (Inherited from Dart.Sockets.Segment)
Top

Public Methods

 | Name | Description
Public Method | ToString | Gets the data as a decoded string. (Inherited from Dart.Sockets.Data)
Top

See Also

Reference

Datagram Class
Dart.Sockets Namespace


Datagram Class Fields

[image]
PowerTCP Sockets for .NET
Datagram Class Fields
See Also Send comments on this topic
Dart.Sockets Namespace : Datagram Class

Glossary Item Box

For a list of all members of this type, see Datagram members.

Public Fields

 | Name | Description
Public Field | Origin | The origin of the datagram sent or received.
Top

See Also

Reference

Datagram Class
Dart.Sockets Namespace


Origin Field

[image]
PowerTCP Sockets for .NET
Origin Field
See Also Send comments on this topic
Dart.Sockets Namespace > Datagram Class : Origin Field

Glossary Item Box

The origin of the datagram sent or received.

Syntax

Visual Basic (Declaration)
Public ReadOnly Origin As IPEndPoint
Visual Basic (Usage) Copy Code
Dim instance As Datagram
Dim value As IPEndPoint

value = instance.Origin
C#
public readonly IPEndPoint Origin
Managed Extensions for C++
public: readonly IPEndPoint* Origin
C++/CLI
public:
readonly IPEndPoint^ Origin

See Also

Reference

Datagram Class
Datagram Members


Dns Class

[image]
PowerTCP Sockets for .NET
Dns Class
Members Example See Also Send comments on this topic
Dart.Sockets Namespace : Dns Class

Glossary Item Box

Supplements System.Net.Dns with the ability to retrieve MX records for any email address or mail server. Supports socket binding to a specified local IPEndPoint.

Object Model

Dns Class

Syntax

Visual Basic (Declaration)
Public Class Dns
   Inherits ComponentBase
Visual Basic (Usage) Copy Code
Dim instance As Dns
C#
public class Dns : ComponentBase
Managed Extensions for C++
public __gc class Dns : public ComponentBase
C++/CLI
public ref class Dns : public ComponentBase

Example

The following example demonstrates performing a DNS lookup of a provided hostname, and an MX record lookup of a provided email address.
C# Copy Code
private void button1_Click(object sender, EventArgs e)
{
    dns1.Start(doMxLookup, EmailToResolveTextbox.Text);
}

private void button2_Click(object sender, EventArgs e)
{
    dns1.Start(doHostLookup, HostToResolveTextbox.Text);
}

/// <summary>
/// Performs an MX record lookup of the provided email address.
/// </summary>
/// <param name="slave">Object used to perform DNS lookup</param>
/// <param name="state">Passed in from the 2nd parameter of Dns.Start(). Email address to lookup.</param>
private void doMxLookup(DnsSlave slave, object state)
{
    MxHostEntry[] hostEntries = slave.GetMxHostEntries(state.ToString());
    string results = "The following mail servers were returned for " + state.ToString() + ":" + Environment.NewLine;
    foreach (MxHostEntry hostEntry in hostEntries)
        results += hostEntry.HostName + " : Preference: " + hostEntry.Preference.ToString() + Environment.NewLine;
    //Marshal result to the UI for display
    dns1.Marshal(results, null);
}

/// <summary>
/// Performs a DNS lookup of the provided hostname.
/// </summary>
/// <param name="slave">Object used to perform DNS lookup</param>
/// <param name="state">Passed in from the 2nd parameter of Dns.Start(). Hostname to lookup.</param>
private void doHostLookup(DnsSlave slave, object state)
{
    System.Net.IPHostEntry hostEntry = slave.GetHostEntry(state.ToString());
    string results = "The following IP addresses were returned for " + state.ToString() + ":" + Environment.NewLine;
    foreach (System.Net.IPAddress address in hostEntry.AddressList)
        results += address.ToString() + Environment.NewLine;
    //Marshal result to the UI for display
    dns1.Marshal(results, null);
}

/// <summary>
/// Raised when Dns.Marshal(string, object) is called.
/// </summary>
private void dns1_UserState(object sender, UserStateEventArgs e)
{
    textBox1.AppendText(e.Message + Environment.NewLine);
}
Visual Basic Copy Code
Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs)
    dns1.Start(AddressOf doMxLookup, EmailToResolveTextbox.Text)
End Sub

Private Sub button2_Click(ByVal sender As Object, ByVal e As EventArgs)
    dns1.Start(AddressOf doHostLookup, HostToResolveTextbox.Text)
End Sub

''' <summary>
''' Performs an MX record lookup of the provided email address.
''' </summary>
''' <param name="slave">Object used to perform DNS lookup</param>
''' <param name="state">Passed in from the 2nd parameter of Dns.Start(). Email address to lookup.</param>
Private Sub doMxLookup(ByVal slave As DnsSlave, ByVal state As Object)
    Dim hostEntries() As MxHostEntry = slave.GetMxHostEntries(state.ToString())
    Dim results As String = "The following mail servers were returned for " & state.ToString() & ":" & Environment.NewLine
    For Each hostEntry As MxHostEntry In hostEntries
        results &= hostEntry.HostName & " : Preference: " & hostEntry.Preference.ToString() & Environment.NewLine
    Next hostEntry
    'Marshal result to the UI for display
    dns1.Marshal(results, Nothing)
End Sub

''' <summary>
''' Performs a DNS lookup of the provided hostname.
''' </summary>
''' <param name="slave">Object used to perform DNS lookup</param>
''' <param name="state">Passed in from the 2nd parameter of Dns.Start(). Hostname to lookup.</param>
Private Sub doHostLookup(ByVal slave As DnsSlave, ByVal state As Object)
    Dim hostEntry As System.Net.IPHostEntry = slave.GetHostEntry(state.ToString())
    Dim results As String = "The following IP addresses were returned for " & state.ToString() & ":" & Environment.NewLine
    For Each address As System.Net.IPAddress In hostEntry.AddressList
        results &= address.ToString() & Environment.NewLine
    Next address
    'Marshal result to the UI for display
    dns1.Marshal(results, Nothing)
End Sub

''' <summary>
''' Raised when Dns.Marshal(string, object) is called.
''' </summary>
Private Sub dns1_UserState(ByVal sender As Object, ByVal e As UserStateEventArgs)
    textBox1.AppendText(e.Message & Environment.NewLine)
End Sub

Inheritance Hierarchy

System.Object
System.MarshalByRefObject
System.ComponentModel.Component
Dart.Sockets.ComponentBase
Dart.Sockets.Dns

See Also

Reference

Dns Members
Dart.Sockets Namespace


Dns Class Members

[image]
PowerTCP Sockets for .NET
Dns Class Members
See Also Fields Properties Methods Events Send comments on this topic
Dart.Sockets Namespace : Dns Class

Glossary Item Box

The following tables list the members exposed by Dns.

Public Constructors

 | Name | Description
Public Constructor | Dns Constructor | Overloaded.
Top

Public Fields

 | Name | Description
Public Field | DefaultPort | The default DNS server port; 53.
Top

Public Properties

 | Name | Description
Public Property | Container | (Inherited from System.ComponentModel.Component)
Public Property | Encoding | Character encoding used by the component. (Inherited from Dart.Sockets.ComponentBase)
Public Property | Servers | A list of DNS servers known to the local system.
Public Property | Site | (Inherited from System.ComponentModel.Component)
Public Property | SynchronizingObject | Gets or sets the object used to marshal data to the UI thread (for raising events). (Inherited from Dart.Sockets.ComponentBase)
Public Property | SyncRoot | Gets an object that is used to synchronize access to the upper layer protocol in use. (Inherited from Dart.Sockets.ComponentBase)
Public Property | Tag | Gets or sets an object that stores any user data. (Inherited from Dart.Sockets.ComponentBase)
Top

Protected Properties

 | Name | Description
Protected Property | CanRaiseEvents | (Inherited from System.ComponentModel.Component)
Protected Property | DesignMode | (Inherited from System.ComponentModel.Component)
Protected Property | Events | (Inherited from System.ComponentModel.Component)
Top

Public Methods

 | Name | Description
Public Method | CreateObjRef | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from System.MarshalByRefObject)
Public Method | Deserialize | Deserialize a previously serialized object. (Inherited from Dart.Sockets.ComponentBase)
Public Method | Dispose | Overloaded. (Inherited from System.ComponentModel.Component)
Public Method | GetLifetimeService | Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | InitializeLifetimeService | Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | Marshal | Overloaded. Marshals a string and/or object to the UI thread and raises the UserState event. (Inherited from Dart.Sockets.ComponentBase)
Public Method | Serialize | Serialize an object to the provided destination stream. (Inherited from Dart.Sockets.ComponentBase)
Public Method | Start | Overloaded. Starts a worker thread on which the specified delegate method executes.
Public Method | ToString | (Inherited from System.ComponentModel.Component)
Top

Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from System.ComponentModel.Component)
Protected Method | GetService | (Inherited from System.ComponentModel.Component)
Protected Method | MemberwiseClone | Overloaded. Creates a shallow copy of the current System.MarshalByRefObject object. (Inherited from System.MarshalByRefObject)
Protected Method | OnError | Raises the Error event. (Inherited from Dart.Sockets.ComponentBase)
Protected Method | OnUserState | Raises the UserState event. (Inherited from Dart.Sockets.ComponentBase)
Top

Public Events

 | Name | Description
Public Event | Disposed | (Inherited from System.ComponentModel.Component)
Public Event | Error | Raised when Marshal(Exception) is used or an unhandled Exception is thrown in a worker thread created using Start. (Inherited from Dart.Sockets.ComponentBase)
Public Event | UserState | Raised when Marshal(String,Object) is used. (Inherited from Dart.Sockets.ComponentBase)
Top

See Also

Reference

Dns Class
Dart.Sockets Namespace


Dns Constructor

[image]
PowerTCP Sockets for .NET
Dns Constructor
See Also Send comments on this topic
Dart.Sockets Namespace > Dns Class : Dns Constructor

Glossary Item Box

Overload List

Overload | Description
Dns Constructor() | Deafault constuctor for Dns class.
Dns Constructor(IContainer) | Initializes a new Dns object.

See Also

Reference

Dns Class
Dns Members


Dns Constructor()

[image]
PowerTCP Sockets for .NET
Dns Constructor()
See Also Send comments on this topic
Dart.Sockets Namespace > Dns Class > Dns Constructor : Dns Constructor()

Glossary Item Box

Deafault constuctor for Dns class.

Syntax

Visual Basic (Declaration)
Public Function New()
Visual Basic (Usage) Copy Code
Dim instance As New Dns()
C#
public Dns()
Managed Extensions for C++
public: Dns();
C++/CLI
public:
Dns();

See Also

Reference

Dns Class
Dns Members
Overload List


Dns Constructor(IContainer)

[image]
PowerTCP Sockets for .NET
Dns Constructor(IContainer)
See Also Send comments on this topic
Dart.Sockets Namespace > Dns Class > Dns Constructor : Dns Constructor(IContainer)

container
The IContainer which contains the object.

Glossary Item Box

Initializes a new Dns object.

Syntax

Visual Basic (Declaration)
Public Function New( _
   ByVal container As IContainer _
)
Visual Basic (Usage) Copy Code
Dim container As IContainer

Dim instance As New Dns(container)
C#
public Dns(
   IContainer container
)
Managed Extensions for C++
public: Dns(
   IContainer* container
)
C++/CLI
public:
Dns(
   IContainer^ container
)

Parameters

container
The IContainer which contains the object.

See Also

Reference

Dns Class
Dns Members
Overload List


Dns Class Methods

[image]
PowerTCP Sockets for .NET
Dns Class Methods
See Also Send comments on this topic
Dart.Sockets Namespace : Dns Class

Glossary Item Box

For a list of all members of this type, see Dns members.

Public Methods

 | Name | Description
Public Method | CreateObjRef | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from System.MarshalByRefObject)
Public Method | Deserialize | Deserialize a previously serialized object. (Inherited from Dart.Sockets.ComponentBase)
Public Method | Dispose | Overloaded. (Inherited from System.ComponentModel.Component)
Public Method | GetLifetimeService | Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | InitializeLifetimeService | Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | Marshal | Overloaded. Marshals a string and/or object to the UI thread and raises the UserState event. (Inherited from Dart.Sockets.ComponentBase)
Public Method | Serialize | Serialize an object to the provided destination stream. (Inherited from Dart.Sockets.ComponentBase)
Public Method | Start | Overloaded. Starts a worker thread on which the specified delegate method executes.
Public Method | ToString | (Inherited from System.ComponentModel.Component)
Top

Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from System.ComponentModel.Component)
Protected Method | GetService | (Inherited from System.ComponentModel.Component)
Protected Method | MemberwiseClone | Overloaded. Creates a shallow copy of the current System.MarshalByRefObject object. (Inherited from System.MarshalByRefObject)
Protected Method | OnError | Raises the Error event. (Inherited from Dart.Sockets.ComponentBase)
Protected Method | OnUserState | Raises the UserState event. (Inherited from Dart.Sockets.ComponentBase)
Top

See Also

Reference

Dns Class
Dart.Sockets Namespace


Start Method

[image]
PowerTCP Sockets for .NET
Start Method
See Also Send comments on this topic
Dart.Sockets Namespace > Dns Class : Start Method

Glossary Item Box

Starts a worker thread on which the specified delegate method executes.

Overload List

Overload | Description
Start(DnsThreadStart,Object) | Starts a worker thread on which the specified delegate method executes.
Start(DnsThreadStart,IPEndPoint,Object) | Starts a worker thread on which the specified delegate method executes.

See Also

Reference

Dns Class
Dns Members


Start(DnsThreadStart,Object) Method

[image]
PowerTCP Sockets for .NET
Start(DnsThreadStart,Object) Method
See Also Example Send comments on this topic
Dart.Sockets Namespace > Dns Class > Start Method : Start(DnsThreadStart,Object) Method

worker
DnsThreadStart delegate specifies the method to execute.
state
Information to pass to the worker delegate method; can be null.

Glossary Item Box

Starts a worker thread on which the specified delegate method executes.

Syntax

Visual Basic (Declaration)
Public Overloads Sub Start( _
   ByVal worker As DnsThreadStart, _
   ByVal state As Object _
)
Visual Basic (Usage) Copy Code
Dim instance As Dns
Dim worker As DnsThreadStart
Dim state As Object

instance.Start(worker, state)
C#
public void Start(
   DnsThreadStart worker,
   object state
)
Managed Extensions for C++
public: void Start(
   DnsThreadStart* worker,
   Object* state
)
C++/CLI
public:
void Start(
   DnsThreadStart^ worker,
   Object^ state
)

Parameters

worker
DnsThreadStart delegate specifies the method to execute.
state
Information to pass to the worker delegate method; can be null.

Remarks

This method provides an easy means for executing multiple DNS resolutions in parallel. The default IPv4 socket interface is used.

Unhandled exceptions occurring on the worker thread are reported via the Error event.

Example

The following example demonstrates performing a DNS lookup of a provided hostname, and an MX record lookup of a provided email address.
C# Copy Code
private void button1_Click(object sender, EventArgs e)
{
    dns1.Start(doMxLookup, EmailToResolveTextbox.Text);
}

private void button2_Click(object sender, EventArgs e)
{
    dns1.Start(doHostLookup, HostToResolveTextbox.Text);
}

/// <summary>
/// Performs an MX record lookup of the provided email address.
/// </summary>
/// <param name="slave">Object used to perform DNS lookup</param>
/// <param name="state">Passed in from the 2nd parameter of Dns.Start(). Email address to lookup.</param>
private void doMxLookup(DnsSlave slave, object state)
{
    MxHostEntry[] hostEntries = slave.GetMxHostEntries(state.ToString());
    string results = "The following mail servers were returned for " + state.ToString() + ":" + Environment.NewLine;
    foreach (MxHostEntry hostEntry in hostEntries)
        results += hostEntry.HostName + " : Preference: " + hostEntry.Preference.ToString() + Environment.NewLine;
    //Marshal result to the UI for display
    dns1.Marshal(results, null);
}

/// <summary>
/// Performs a DNS lookup of the provided hostname.
/// </summary>
/// <param name="slave">Object used to perform DNS lookup</param>
/// <param name="state">Passed in from the 2nd parameter of Dns.Start(). Hostname to lookup.</param>
private void doHostLookup(DnsSlave slave, object state)
{
    System.Net.IPHostEntry hostEntry = slave.GetHostEntry(state.ToString());
    string results = "The following IP addresses were returned for " + state.ToString() + ":" + Environment.NewLine;
    foreach (System.Net.IPAddress address in hostEntry.AddressList)
        results += address.ToString() + Environment.NewLine;
    //Marshal result to the UI for display
    dns1.Marshal(results, null);
}

/// <summary>
/// Raised when Dns.Marshal(string, object) is called.
/// </summary>
private void dns1_UserState(object sender, UserStateEventArgs e)
{
    textBox1.AppendText(e.Message + Environment.NewLine);
}
Visual Basic Copy Code
Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs)
    dns1.Start(AddressOf doMxLookup, EmailToResolveTextbox.Text)
End Sub

Private Sub button2_Click(ByVal sender As Object, ByVal e As EventArgs)
    dns1.Start(AddressOf doHostLookup, HostToResolveTextbox.Text)
End Sub

''' <summary>
''' Performs an MX record lookup of the provided email address.
''' </summary>
''' <param name="slave">Object used to perform DNS lookup</param>
''' <param name="state">Passed in from the 2nd parameter of Dns.Start(). Email address to lookup.</param>
Private Sub doMxLookup(ByVal slave As DnsSlave, ByVal state As Object)
    Dim hostEntries() As MxHostEntry = slave.GetMxHostEntries(state.ToString())
    Dim results As String = "The following mail servers were returned for " & state.ToString() & ":" & Environment.NewLine
    For Each hostEntry As MxHostEntry In hostEntries
        results &= hostEntry.HostName & " : Preference: " & hostEntry.Preference.ToString() & Environment.NewLine
    Next hostEntry
    'Marshal result to the UI for display
    dns1.Marshal(results, Nothing)
End Sub

''' <summary>
''' Performs a DNS lookup of the provided hostname.
''' </summary>
''' <param name="slave">Object used to perform DNS lookup</param>
''' <param name="state">Passed in from the 2nd parameter of Dns.Start(). Hostname to lookup.</param>
Private Sub doHostLookup(ByVal slave As DnsSlave, ByVal state As Object)
    Dim hostEntry As System.Net.IPHostEntry = slave.GetHostEntry(state.ToString())
    Dim results As String = "The following IP addresses were returned for " & state.ToString() & ":" & Environment.NewLine
    For Each address As System.Net.IPAddress In hostEntry.AddressList
        results &= address.ToString() & Environment.NewLine
    Next address
    'Marshal result to the UI for display
    dns1.Marshal(results, Nothing)
End Sub

''' <summary>
''' Raised when Dns.Marshal(string, object) is called.
''' </summary>
Private Sub dns1_UserState(ByVal sender As Object, ByVal e As UserStateEventArgs)
    textBox1.AppendText(e.Message & Environment.NewLine)
End Sub

See Also

Reference

Dns Class
Dns Members
Overload List


Start(DnsThreadStart,IPEndPoint,Object) Method

[image]
PowerTCP Sockets for .NET
Start(DnsThreadStart,IPEndPoint,Object) Method
See Also Send comments on this topic
Dart.Sockets Namespace > Dns Class > Start Method : Start(DnsThreadStart,IPEndPoint,Object) Method

worker
DnsThreadStart delegate specifies the method to execute.
localEndPoint
Specifies the local IPEndPoint to bind to.
state
Information to pass to the worker delegate method; can be null.

Glossary Item Box

Starts a worker thread on which the specified delegate method executes.

Syntax

Visual Basic (Declaration)
Public Overloads Sub Start( _
   ByVal worker As DnsThreadStart, _
   ByVal localEndPoint As IPEndPoint, _
   ByVal state As Object _
)
Visual Basic (Usage) Copy Code
Dim instance As Dns
Dim worker As DnsThreadStart
Dim localEndPoint As IPEndPoint
Dim state As Object

instance.Start(worker, localEndPoint, state)
C#
public void Start(
   DnsThreadStart worker,
   IPEndPoint localEndPoint,
   object state
)
Managed Extensions for C++
public: void Start(
   DnsThreadStart* worker,
   IPEndPoint* localEndPoint,
   Object* state
)
C++/CLI
public:
void Start(
   DnsThreadStart^ worker,
   IPEndPoint^ localEndPoint,
   Object^ state
)

Parameters

worker
DnsThreadStart delegate specifies the method to execute.
localEndPoint
Specifies the local IPEndPoint to bind to.
state
Information to pass to the worker delegate method; can be null.

Remarks

This method provides an easy means for executing multiple DNS resolutions in parallel.

Unhandled exceptions occurring on the worker thread are reported via the Error event.

See Also

Reference

Dns Class
Dns Members
Overload List


Dns Class Properties

[image]
PowerTCP Sockets for .NET
Dns Class Properties
See Also Send comments on this topic
Dart.Sockets Namespace : Dns Class

Glossary Item Box

For a list of all members of this type, see Dns members.

Public Properties

 | Name | Description
Public Property | Container | (Inherited from System.ComponentModel.Component)
Public Property | Encoding | Character encoding used by the component. (Inherited from Dart.Sockets.ComponentBase)
Public Property | Servers | A list of DNS servers known to the local system.
Public Property | Site | (Inherited from System.ComponentModel.Component)
Public Property | SynchronizingObject | Gets or sets the object used to marshal data to the UI thread (for raising events). (Inherited from Dart.Sockets.ComponentBase)
Public Property | SyncRoot | Gets an object that is used to synchronize access to the upper layer protocol in use. (Inherited from Dart.Sockets.ComponentBase)
Public Property | Tag | Gets or sets an object that stores any user data. (Inherited from Dart.Sockets.ComponentBase)
Top

Protected Properties

 | Name | Description
Protected Property | CanRaiseEvents | (Inherited from System.ComponentModel.Component)
Protected Property | DesignMode | (Inherited from System.ComponentModel.Component)
Protected Property | Events | (Inherited from System.ComponentModel.Component)
Top

See Also

Reference

Dns Class
Dart.Sockets Namespace


Servers Property

[image]
PowerTCP Sockets for .NET
Servers Property
See Also Send comments on this topic
Dart.Sockets Namespace > Dns Class : Servers Property

Glossary Item Box

A list of DNS servers known to the local system.

Syntax

Visual Basic (Declaration)
Public ReadOnly Property Servers As List(Of IPEndPoint)
Visual Basic (Usage) Copy Code
Dim instance As Dns
Dim value As List(Of IPEndPoint)

value = instance.Servers
C#
public List<IPEndPoint> Servers {get;}
Managed Extensions for C++
public: __property List<IPEndPoint*>* get_Servers();
C++/CLI
public:
property List<IPEndPoint^>^ Servers {
   List<IPEndPoint^>^ get();
}

See Also

Reference

Dns Class
Dns Members


Dns Class Fields

[image]
PowerTCP Sockets for .NET
Dns Class Fields
See Also Send comments on this topic
Dart.Sockets Namespace : Dns Class

Glossary Item Box

For a list of all members of this type, see Dns members.

Public Fields

 | Name | Description
Public Field | DefaultPort | The default DNS server port; 53.
Top

See Also

Reference

Dns Class
Dart.Sockets Namespace


DefaultPort Field

[image]
PowerTCP Sockets for .NET
DefaultPort Field
See Also Send comments on this topic
Dart.Sockets Namespace > Dns Class : DefaultPort Field

Glossary Item Box

The default DNS server port; 53.

Syntax

Visual Basic (Declaration)
Public Const DefaultPort As Integer
Visual Basic (Usage) Copy Code
Dim value As Integer

value = Dns.DefaultPort
C#
public const int DefaultPort
Managed Extensions for C++
public: const int DefaultPort
C++/CLI
public:
const int DefaultPort

See Also

Reference

Dns Class
Dns Members


DnsSlave Class

[image]
PowerTCP Sockets for .NET
DnsSlave Class
Members See Also Send comments on this topic
Dart.Sockets Namespace : DnsSlave Class

Glossary Item Box

Used to perform DNS resolutions.

Object Model

DnsSlave Class

Syntax

Visual Basic (Declaration)
Public Class DnsSlave
Visual Basic (Usage) Copy Code
Dim instance As DnsSlave
C#
public class DnsSlave
Managed Extensions for C++
public __gc class DnsSlave
C++/CLI
public ref class DnsSlave

Inheritance Hierarchy

System.Object
Dart.Sockets.DnsSlave

See Also

Reference

DnsSlave Members
Dart.Sockets Namespace


DnsSlave Class Members

[image]
PowerTCP Sockets for .NET
DnsSlave Class Members
See Also Fields Methods Send comments on this topic
Dart.Sockets Namespace : DnsSlave Class

Glossary Item Box

The following tables list the members exposed by DnsSlave.

Public Constructors

 | Name | Description
Public Constructor | DnsSlave Constructor | Creates an object that manages DNS resolution requests.
Top

Public Fields

 | Name | Description
Public Field | Socket | Gets the socket used for communications.
Top

Public Methods

 | Name | Description
Public Method | GetHostEntry | Overloaded. Resolves a hostname (forward lookup) or IP address (reverse lookup) using the default DNS server.
Public Method | GetMxHostEntries | Overloaded. Resolves an emailAddress or mail server domain using the default DNS server.
Top

See Also

Reference

DnsSlave Class
Dart.Sockets Namespace


DnsSlave Constructor

[image]
PowerTCP Sockets for .NET
DnsSlave Constructor
See Also Send comments on this topic
Dart.Sockets Namespace > DnsSlave Class : DnsSlave Constructor

parent
Parent Dns component.
localEndPoint
A IPEndPoint that establishes from which IP interface requests will originate.

Glossary Item Box

Creates an object that manages DNS resolution requests.

Syntax

Visual Basic (Declaration)
<SecuritySafeCriticalAttribute()>
Public Function New( _
   ByVal parent As Dns, _
   ByVal localEndPoint As IPEndPoint _
)
Visual Basic (Usage) Copy Code
Dim parent As Dns
Dim localEndPoint As IPEndPoint

Dim instance As New DnsSlave(parent, localEndPoint)
C#
[SecuritySafeCritical()]
public DnsSlave(
   Dns parent,
   IPEndPoint localEndPoint
)
Managed Extensions for C++
[SecuritySafeCritical()]
public: DnsSlave(
   Dns* parent,
   IPEndPoint* localEndPoint
)
C++/CLI
[SecuritySafeCritical()]
public:
DnsSlave(
   Dns^ parent,
   IPEndPoint^ localEndPoint
)

Parameters

parent
Parent Dns component.
localEndPoint
A IPEndPoint that establishes from which IP interface requests will originate.

Remarks

The IPAddress.AddressFamily of the local EndPoint MUST match the AddressFamily of destination hosts.

See Also

Reference

DnsSlave Class
DnsSlave Members


DnsSlave Class Methods

[image]
PowerTCP Sockets for .NET
DnsSlave Class Methods
See Also Send comments on this topic
Dart.Sockets Namespace : DnsSlave Class

Glossary Item Box

For a list of all members of this type, see DnsSlave members.

Public Methods

 | Name | Description
Public Method | GetHostEntry | Overloaded. Resolves a hostname (forward lookup) or IP address (reverse lookup) using the default DNS server.
Public Method | GetMxHostEntries | Overloaded. Resolves an emailAddress or mail server domain using the default DNS server.
Top

See Also

Reference

DnsSlave Class
Dart.Sockets Namespace


GetHostEntry Method

[image]
PowerTCP Sockets for .NET
GetHostEntry Method
See Also Send comments on this topic
Dart.Sockets Namespace > DnsSlave Class : GetHostEntry Method

Glossary Item Box

Resolves a hostname (forward lookup) or IP address (reverse lookup) using the default DNS server.

Overload List

Overload | Description
GetHostEntry(String) | Resolves a hostname (forward lookup) or IP address (reverse lookup) using the default DNS server.
GetHostEntry(String,IPEndPoint) | Resolves a hostname (forward lookup) or IP address (reverse lookup) using the specified DNS server.

See Also

Reference

DnsSlave Class
DnsSlave Members


GetHostEntry(String) Method

[image]
PowerTCP Sockets for .NET
GetHostEntry(String) Method
See Also Send comments on this topic
Dart.Sockets Namespace > DnsSlave Class > GetHostEntry Method : GetHostEntry(String) Method

hostNameOrAddress
Hostname or IP address (IPAddress.ToString() can be used).

Glossary Item Box

Resolves a hostname (forward lookup) or IP address (reverse lookup) using the default DNS server.

Syntax

Visual Basic (Declaration)
Public Overloads Function GetHostEntry( _
   ByVal hostNameOrAddress As String _
) As IPHostEntry
Visual Basic (Usage) Copy Code
Dim instance As DnsSlave
Dim hostNameOrAddress As String
Dim value As IPHostEntry

value = instance.GetHostEntry(hostNameOrAddress)
C#
public IPHostEntry GetHostEntry(
   string hostNameOrAddress
)
Managed Extensions for C++
public: IPHostEntry* GetHostEntry(
   string* hostNameOrAddress
)
C++/CLI
public:
IPHostEntry^ GetHostEntry(
   String^ hostNameOrAddress
)

Parameters

hostNameOrAddress
Hostname or IP address (IPAddress.ToString() can be used).

Return Value

A System.Net.IPHostEntry.

See Also

Reference

DnsSlave Class
DnsSlave Members
Overload List


GetHostEntry(String,IPEndPoint) Method

[image]
PowerTCP Sockets for .NET
GetHostEntry(String,IPEndPoint) Method
See Also Send comments on this topic
Dart.Sockets Namespace > DnsSlave Class > GetHostEntry Method : GetHostEntry(String,IPEndPoint) Method

hostNameOrAddress
Hostname or IP address (IPAddress.ToString() can be used).
remoteEndPoint
IPEndPoint that specifies the DNS server.

Glossary Item Box

Resolves a hostname (forward lookup) or IP address (reverse lookup) using the specified DNS server.

Syntax

Visual Basic (Declaration)
Public Overloads Function GetHostEntry( _
   ByVal hostNameOrAddress As String, _
   ByVal remoteEndPoint As IPEndPoint _
) As IPHostEntry
Visual Basic (Usage) Copy Code
Dim instance As DnsSlave
Dim hostNameOrAddress As String
Dim remoteEndPoint As IPEndPoint
Dim value As IPHostEntry

value = instance.GetHostEntry(hostNameOrAddress, remoteEndPoint)
C#
public IPHostEntry GetHostEntry(
   string hostNameOrAddress,
   IPEndPoint remoteEndPoint
)
Managed Extensions for C++
public: IPHostEntry* GetHostEntry(
   string* hostNameOrAddress,
   IPEndPoint* remoteEndPoint
)
C++/CLI
public:
IPHostEntry^ GetHostEntry(
   String^ hostNameOrAddress,
   IPEndPoint^ remoteEndPoint
)

Parameters

hostNameOrAddress
Hostname or IP address (IPAddress.ToString() can be used).
remoteEndPoint
IPEndPoint that specifies the DNS server.

Return Value

A System.Net.IPHostEntry.

See Also

Reference

DnsSlave Class
DnsSlave Members
Overload List


GetMxHostEntries Method

[image]
PowerTCP Sockets for .NET
GetMxHostEntries Method
See Also Send comments on this topic
Dart.Sockets Namespace > DnsSlave Class : GetMxHostEntries Method

Glossary Item Box

Resolves an emailAddress or mail server domain using the default DNS server.

Overload List

Overload | Description
GetMxHostEntries(String) | Resolves an emailAddress or mail server domain using the default DNS server.
GetMxHostEntries(String,IPEndPoint) | Resolves an emailAddress or mail server using the specified DNS server.

See Also

Reference

DnsSlave Class
DnsSlave Members


GetMxHostEntries(String) Method

[image]
PowerTCP Sockets for .NET
GetMxHostEntries(String) Method
See Also Example Send comments on this topic
Dart.Sockets Namespace > DnsSlave Class > GetMxHostEntries Method : GetMxHostEntries(String) Method

emailAddress
Email address (or domain server name).

Glossary Item Box

Resolves an emailAddress or mail server domain using the default DNS server.

Syntax

Visual Basic (Declaration)
Public Overloads Function GetMxHostEntries( _
   ByVal emailAddress As String _
) As MxHostEntry()
Visual Basic (Usage) Copy Code
Dim instance As DnsSlave
Dim emailAddress As String
Dim value() As MxHostEntry

value = instance.GetMxHostEntries(emailAddress)
C#
public MxHostEntry[] GetMxHostEntries(
   string emailAddress
)
Managed Extensions for C++
public: MxHostEntry*[]* GetMxHostEntries(
   string* emailAddress
)
C++/CLI
public:
array<MxHostEntry^>^ GetMxHostEntries(
   String^ emailAddress
)

Parameters

emailAddress
Email address (or domain server name).

Return Value

An array of MxHostEntry objects associated with the email address.

Remarks

Any email address must be in the standard user@hostname form.

Example

The following example demonstrates performing a DNS lookup of a provided hostname, and an MX record lookup of a provided email address.
C# Copy Code
private void button1_Click(object sender, EventArgs e)
{
    dns1.Start(doMxLookup, EmailToResolveTextbox.Text);
}

private void button2_Click(object sender, EventArgs e)
{
    dns1.Start(doHostLookup, HostToResolveTextbox.Text);
}

/// <summary>
/// Performs an MX record lookup of the provided email address.
/// </summary>
/// <param name="slave">Object used to perform DNS lookup</param>
/// <param name="state">Passed in from the 2nd parameter of Dns.Start(). Email address to lookup.</param>
private void doMxLookup(DnsSlave slave, object state)
{
    MxHostEntry[] hostEntries = slave.GetMxHostEntries(state.ToString());
    string results = "The following mail servers were returned for " + state.ToString() + ":" + Environment.NewLine;
    foreach (MxHostEntry hostEntry in hostEntries)
        results += hostEntry.HostName + " : Preference: " + hostEntry.Preference.ToString() + Environment.NewLine;
    //Marshal result to the UI for display
    dns1.Marshal(results, null);
}

/// <summary>
/// Performs a DNS lookup of the provided hostname.
/// </summary>
/// <param name="slave">Object used to perform DNS lookup</param>
/// <param name="state">Passed in from the 2nd parameter of Dns.Start(). Hostname to lookup.</param>
private void doHostLookup(DnsSlave slave, object state)
{
    System.Net.IPHostEntry hostEntry = slave.GetHostEntry(state.ToString());
    string results = "The following IP addresses were returned for " + state.ToString() + ":" + Environment.NewLine;
    foreach (System.Net.IPAddress address in hostEntry.AddressList)
        results += address.ToString() + Environment.NewLine;
    //Marshal result to the UI for display
    dns1.Marshal(results, null);
}

/// <summary>
/// Raised when Dns.Marshal(string, object) is called.
/// </summary>
private void dns1_UserState(object sender, UserStateEventArgs e)
{
    textBox1.AppendText(e.Message + Environment.NewLine);
}
Visual Basic Copy Code
Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs)
    dns1.Start(AddressOf doMxLookup, EmailToResolveTextbox.Text)
End Sub

Private Sub button2_Click(ByVal sender As Object, ByVal e As EventArgs)
    dns1.Start(AddressOf doHostLookup, HostToResolveTextbox.Text)
End Sub

''' <summary>
''' Performs an MX record lookup of the provided email address.
''' </summary>
''' <param name="slave">Object used to perform DNS lookup</param>
''' <param name="state">Passed in from the 2nd parameter of Dns.Start(). Email address to lookup.</param>
Private Sub doMxLookup(ByVal slave As DnsSlave, ByVal state As Object)
    Dim hostEntries() As MxHostEntry = slave.GetMxHostEntries(state.ToString())
    Dim results As String = "The following mail servers were returned for " & state.ToString() & ":" & Environment.NewLine
    For Each hostEntry As MxHostEntry In hostEntries
        results &= hostEntry.HostName & " : Preference: " & hostEntry.Preference.ToString() & Environment.NewLine
    Next hostEntry
    'Marshal result to the UI for display
    dns1.Marshal(results, Nothing)
End Sub

''' <summary>
''' Performs a DNS lookup of the provided hostname.
''' </summary>
''' <param name="slave">Object used to perform DNS lookup</param>
''' <param name="state">Passed in from the 2nd parameter of Dns.Start(). Hostname to lookup.</param>
Private Sub doHostLookup(ByVal slave As DnsSlave, ByVal state As Object)
    Dim hostEntry As System.Net.IPHostEntry = slave.GetHostEntry(state.ToString())
    Dim results As String = "The following IP addresses were returned for " & state.ToString() & ":" & Environment.NewLine
    For Each address As System.Net.IPAddress In hostEntry.AddressList
        results &= address.ToString() & Environment.NewLine
    Next address
    'Marshal result to the UI for display
    dns1.Marshal(results, Nothing)
End Sub

''' <summary>
''' Raised when Dns.Marshal(string, object) is called.
''' </summary>
Private Sub dns1_UserState(ByVal sender As Object, ByVal e As UserStateEventArgs)
    textBox1.AppendText(e.Message & Environment.NewLine)
End Sub

See Also

Reference

DnsSlave Class
DnsSlave Members
Overload List


GetMxHostEntries(String,IPEndPoint) Method

[image]
PowerTCP Sockets for .NET
GetMxHostEntries(String,IPEndPoint) Method
See Also Send comments on this topic
Dart.Sockets Namespace > DnsSlave Class > GetMxHostEntries Method : GetMxHostEntries(String,IPEndPoint) Method

emailAddress
Email address (or domain server name).
remoteEndPoint
IPEndPoint that specifies the DNS server.

Glossary Item Box

Resolves an emailAddress or mail server using the specified DNS server.

Syntax

Visual Basic (Declaration)
Public Overloads Function GetMxHostEntries( _
   ByVal emailAddress As String, _
   ByVal remoteEndPoint As IPEndPoint _
) As MxHostEntry()
Visual Basic (Usage) Copy Code
Dim instance As DnsSlave
Dim emailAddress As String
Dim remoteEndPoint As IPEndPoint
Dim value() As MxHostEntry

value = instance.GetMxHostEntries(emailAddress, remoteEndPoint)
C#
public MxHostEntry[] GetMxHostEntries(
   string emailAddress,
   IPEndPoint remoteEndPoint
)
Managed Extensions for C++
public: MxHostEntry*[]* GetMxHostEntries(
   string* emailAddress,
   IPEndPoint* remoteEndPoint
)
C++/CLI
public:
array<MxHostEntry^>^ GetMxHostEntries(
   String^ emailAddress,
   IPEndPoint^ remoteEndPoint
)

Parameters

emailAddress
Email address (or domain server name).
remoteEndPoint
IPEndPoint that specifies the DNS server.

Return Value

An array of MxHostEntry objects associated with the email address.

Remarks

Any email address must be in the standard user@hostname form.

See Also

Reference

DnsSlave Class
DnsSlave Members
Overload List


DnsSlave Class Fields

[image]
PowerTCP Sockets for .NET
DnsSlave Class Fields
See Also Send comments on this topic
Dart.Sockets Namespace : DnsSlave Class

Glossary Item Box

For a list of all members of this type, see DnsSlave members.

Public Fields

 | Name | Description
Public Field | Socket | Gets the socket used for communications.
Top

See Also

Reference

DnsSlave Class
Dart.Sockets Namespace


Socket Field

[image]
PowerTCP Sockets for .NET
Socket Field
See Also Send comments on this topic
Dart.Sockets Namespace > DnsSlave Class : Socket Field

Glossary Item Box

Gets the socket used for communications.

Syntax

Visual Basic (Declaration)
Public ReadOnly Socket As Socket
Visual Basic (Usage) Copy Code
Dim instance As DnsSlave
Dim value As Socket

value = instance.Socket
C#
public readonly Socket Socket
Managed Extensions for C++
public: readonly Socket* Socket
C++/CLI
public:
readonly Socket^ Socket

Field Value

The Socket used for UDP communications.

See Also

Reference

DnsSlave Class
DnsSlave Members


Echo Class

[image]
PowerTCP Sockets for .NET
Echo Class
Members See Also Send comments on this topic
Dart.Sockets Namespace : Echo Class

Glossary Item Box

Encapsulates an echo response from a server.

Object Model

Echo Class

Syntax

Visual Basic (Declaration)
Public Class Echo
Visual Basic (Usage) Copy Code
Dim instance As Echo
C#
public class Echo
Managed Extensions for C++
public __gc class Echo
C++/CLI
public ref class Echo

Inheritance Hierarchy

System.Object
Dart.Sockets.Echo

See Also

Reference

Echo Members
Dart.Sockets Namespace


Echo Class Members

[image]
PowerTCP Sockets for .NET
Echo Class Members
See Also Fields Methods Send comments on this topic
Dart.Sockets Namespace : Echo Class

Glossary Item Box

The following tables list the members exposed by Echo.

Public Fields

 | Name | Description
Public Field | Address | Returns the IP address of the remote host.
Public Field | Broadcast | Indicates whether Echo originated as an IPv4 broadcast request to address IPAddress.Broadcast (255.255.255.255).
Public Field | Data | Returns data returned from the echo request.
Public Field | RoundTripTime | Returns the time spanned between sending and receiving a response to the echo request.
Public Field | Status | The status (success or otherwise) of the echo request.
Public Field | Ttl | Returns the TTL (time to live) for the packet.
Top

Public Methods

 | Name | Description
Public Method | ToString | Returns a string containing information regarding the Echo.
Top

See Also

Reference

Echo Class
Dart.Sockets Namespace


Echo Class Methods

[image]
PowerTCP Sockets for .NET
Echo Class Methods
See Also Send comments on this topic
Dart.Sockets Namespace : Echo Class

Glossary Item Box

For a list of all members of this type, see Echo members.

Public Methods

 | Name | Description
Public Method | ToString | Returns a string containing information regarding the Echo.
Top

See Also

Reference

Echo Class
Dart.Sockets Namespace


ToString Method

[image]
PowerTCP Sockets for .NET
ToString Method
See Also Send comments on this topic
Dart.Sockets Namespace > Echo Class : ToString Method

Glossary Item Box

Returns a string containing information regarding the Echo.

Syntax

Visual Basic (Declaration)
Public Overrides Function ToString() As String
Visual Basic (Usage) Copy Code
Dim instance As Echo
Dim value As String

value = instance.ToString()
C#
public override string ToString()
Managed Extensions for C++
public: string* ToString(); override
C++/CLI
public:
String^ ToString(); override

Return Value

A string representing the echo.

See Also

Reference

Echo Class
Echo Members


Echo Class Fields

[image]
PowerTCP Sockets for .NET
Echo Class Fields
See Also Send comments on this topic
Dart.Sockets Namespace : Echo Class

Glossary Item Box

For a list of all members of this type, see Echo members.

Public Fields

 | Name | Description
Public Field | Address | Returns the IP address of the remote host.
Public Field | Broadcast | Indicates whether Echo originated as an IPv4 broadcast request to address IPAddress.Broadcast (255.255.255.255).
Public Field | Data | Returns data returned from the echo request.
Public Field | RoundTripTime | Returns the time spanned between sending and receiving a response to the echo request.
Public Field | Status | The status (success or otherwise) of the echo request.
Public Field | Ttl | Returns the TTL (time to live) for the packet.
Top

See Also

Reference

Echo Class
Dart.Sockets Namespace


Address Field

[image]
PowerTCP Sockets for .NET
Address Field
See Also Send comments on this topic
Dart.Sockets Namespace > Echo Class : Address Field

Glossary Item Box

Returns the IP address of the remote host.

Syntax

Visual Basic (Declaration)
Public ReadOnly Address As IPAddress
Visual Basic (Usage) Copy Code
Dim instance As Echo
Dim value As IPAddress

value = instance.Address
C#
public readonly IPAddress Address
Managed Extensions for C++
public: readonly IPAddress* Address
C++/CLI
public:
readonly IPAddress^ Address

Field Value

An IPAddress for the remote host.

See Also

Reference

Echo Class
Echo Members


Broadcast Field

[image]
PowerTCP Sockets for .NET
Broadcast Field
See Also Send comments on this topic
Dart.Sockets Namespace > Echo Class : Broadcast Field

Glossary Item Box

Indicates whether Echo originated as an IPv4 broadcast request to address IPAddress.Broadcast (255.255.255.255).

Syntax

Visual Basic (Declaration)
Public ReadOnly Broadcast As Boolean
Visual Basic (Usage) Copy Code
Dim instance As Echo
Dim value As Boolean

value = instance.Broadcast
C#
public readonly bool Broadcast
Managed Extensions for C++
public: readonly bool Broadcast
C++/CLI
public:
readonly bool Broadcast

See Also

Reference

Echo Class
Echo Members


Data Field

[image]
PowerTCP Sockets for .NET
Data Field
See Also Send comments on this topic
Dart.Sockets Namespace > Echo Class : Data Field

Glossary Item Box

Returns data returned from the echo request.

Syntax

Visual Basic (Declaration)
Public ReadOnly Data As Byte()
Visual Basic (Usage) Copy Code
Dim instance As Echo
Dim value() As Byte

value = instance.Data
C#
public readonly byte[] Data
Managed Extensions for C++
public: readonly byte[]* Data
C++/CLI
public:
readonly array<byte>^ Data

Field Value

A byte array representing the data sent to and subsequently returned from the remote host.

Remarks

When a ping request is sent, any data included in the packet is returned to the sender.

See Also

Reference

Echo Class
Echo Members


RoundTripTime Field

[image]
PowerTCP Sockets for .NET
RoundTripTime Field
See Also Send comments on this topic
Dart.Sockets Namespace > Echo Class : RoundTripTime Field

Glossary Item Box

Returns the time spanned between sending and receiving a response to the echo request.

Syntax

Visual Basic (Declaration)
Public ReadOnly RoundTripTime As TimeSpan
Visual Basic (Usage) Copy Code
Dim instance As Echo
Dim value As TimeSpan

value = instance.RoundTripTime
C#
public readonly TimeSpan RoundTripTime
Managed Extensions for C++
public: readonly TimeSpan RoundTripTime
C++/CLI
public:
readonly TimeSpan RoundTripTime

Field Value

A TimeSpan object.

See Also

Reference

Echo Class
Echo Members


Status Field

[image]
PowerTCP Sockets for .NET
Status Field
See Also Send comments on this topic
Dart.Sockets Namespace > Echo Class : Status Field

Glossary Item Box

The status (success or otherwise) of the echo request.

Syntax

Visual Basic (Declaration)
Public ReadOnly Status As Ping.Status
Visual Basic (Usage) Copy Code
Dim instance As Echo
Dim value As Ping.Status

value = instance.Status
C#
public readonly Ping.Status Status
Managed Extensions for C++
public: readonly Ping.Status Status
C++/CLI
public:
readonly Ping.Status Status

See Also

Reference

Echo Class
Echo Members


Ttl Field

[image]
PowerTCP Sockets for .NET
Ttl Field
See Also Send comments on this topic
Dart.Sockets Namespace > Echo Class : Ttl Field

Glossary Item Box

Returns the TTL (time to live) for the packet.

Syntax

Visual Basic (Declaration)
Public ReadOnly Ttl As Integer
Visual Basic (Usage) Copy Code
Dim instance As Echo
Dim value As Integer

value = instance.Ttl
C#
public readonly int Ttl
Managed Extensions for C++
public: readonly int Ttl
C++/CLI
public:
readonly int Ttl

Field Value

Returns an integer value representing the TTL for the packet.

Remarks

In practice TTL is decremented at each router the packet arrives at. A packet with a TTL of 0 will be discarded.

See Also

Reference

Echo Class
Echo Members


EchoEventArgs Class

[image]
PowerTCP Sockets for .NET
EchoEventArgs Class
Members See Also Send comments on this topic
Dart.Sockets Namespace : EchoEventArgs Class

Glossary Item Box

Provides data for the Echo event.

Object Model

EchoEventArgs Class

Syntax

Visual Basic (Declaration)
Public Class EchoEventArgs
   Inherits System.EventArgs
Visual Basic (Usage) Copy Code
Dim instance As EchoEventArgs
C#
public class EchoEventArgs : System.EventArgs
Managed Extensions for C++
public __gc class EchoEventArgs : public System.EventArgs
C++/CLI
public ref class EchoEventArgs : public System.EventArgs

Inheritance Hierarchy

System.Object
System.EventArgs
Dart.Sockets.EchoEventArgs

See Also

Reference

EchoEventArgs Members
Dart.Sockets Namespace


EchoEventArgs Class Members

[image]
PowerTCP Sockets for .NET
EchoEventArgs Class Members
See Also Fields Send comments on this topic
Dart.Sockets Namespace : EchoEventArgs Class

Glossary Item Box

The following tables list the members exposed by EchoEventArgs.

Public Fields

 | Name | Description
Public Field | Echoes | Gets the Echo result from the Ping.
Top

See Also

Reference

EchoEventArgs Class
Dart.Sockets Namespace


EchoEventArgs Class Fields

[image]
PowerTCP Sockets for .NET
EchoEventArgs Class Fields
See Also Send comments on this topic
Dart.Sockets Namespace : EchoEventArgs Class

Glossary Item Box

For a list of all members of this type, see EchoEventArgs members.

Public Fields

 | Name | Description
Public Field | Echoes | Gets the Echo result from the Ping.
Top

See Also

Reference

EchoEventArgs Class
Dart.Sockets Namespace


Echoes Field

[image]
PowerTCP Sockets for .NET
Echoes Field
See Also Send comments on this topic
Dart.Sockets Namespace > EchoEventArgs Class : Echoes Field

Glossary Item Box

Gets the Echo result from the Ping.

Syntax

Visual Basic (Declaration)
Public ReadOnly Echoes As Echo()
Visual Basic (Usage) Copy Code
Dim instance As EchoEventArgs
Dim value() As Echo

value = instance.Echoes
C#
public readonly Echo[] Echoes
Managed Extensions for C++
public: readonly Echo*[]* Echoes
C++/CLI
public:
readonly array<Echo^>^ Echoes

See Also

Reference

EchoEventArgs Class
EchoEventArgs Members


ErrorEventArgs Class

[image]
PowerTCP Sockets for .NET
ErrorEventArgs Class
Members See Also Send comments on this topic
Dart.Sockets Namespace : ErrorEventArgs Class

Glossary Item Box

Provides data for the Error event.

Object Model

ErrorEventArgs Class

Syntax

Visual Basic (Declaration)
Public Class ErrorEventArgs
   Inherits System.EventArgs
Visual Basic (Usage) Copy Code
Dim instance As ErrorEventArgs
C#
public class ErrorEventArgs : System.EventArgs
Managed Extensions for C++
public __gc class ErrorEventArgs : public System.EventArgs
C++/CLI
public ref class ErrorEventArgs : public System.EventArgs

Inheritance Hierarchy

System.Object
System.EventArgs
Dart.Sockets.ErrorEventArgs

See Also

Reference

ErrorEventArgs Members
Dart.Sockets Namespace


ErrorEventArgs Class Members

[image]
PowerTCP Sockets for .NET
ErrorEventArgs Class Members
See Also Methods Send comments on this topic
Dart.Sockets Namespace : ErrorEventArgs Class

Glossary Item Box

The following tables list the members exposed by ErrorEventArgs.

Public Constructors

 | Name | Description
Public Constructor | ErrorEventArgs Constructor | Save an exception within this class.
Top

Public Methods

 | Name | Description
Public Method | GetException | Returns the Exception marshaled to the UI thread.
Top

See Also

Reference

ErrorEventArgs Class
Dart.Sockets Namespace


ErrorEventArgs Constructor

[image]
PowerTCP Sockets for .NET
ErrorEventArgs Constructor
See Also Send comments on this topic
Dart.Sockets Namespace > ErrorEventArgs Class : ErrorEventArgs Constructor

exception
Exception to save.

Glossary Item Box

Save an exception within this class.

Syntax

Visual Basic (Declaration)
Public Function New( _
   ByVal exception As Exception _
)
Visual Basic (Usage) Copy Code
Dim exception As Exception

Dim instance As New ErrorEventArgs(exception)
C#
public ErrorEventArgs(
   Exception exception
)
Managed Extensions for C++
public: ErrorEventArgs(
   Exception* exception
)
C++/CLI
public:
ErrorEventArgs(
   Exception^ exception
)

Parameters

exception
Exception to save.

See Also

Reference

ErrorEventArgs Class
ErrorEventArgs Members


ErrorEventArgs Class Methods

[image]
PowerTCP Sockets for .NET
ErrorEventArgs Class Methods
See Also Send comments on this topic
Dart.Sockets Namespace : ErrorEventArgs Class

Glossary Item Box

For a list of all members of this type, see ErrorEventArgs members.

Public Methods

 | Name | Description
Public Method | GetException | Returns the Exception marshaled to the UI thread.
Top

See Also

Reference

ErrorEventArgs Class
Dart.Sockets Namespace


GetException Method

[image]
PowerTCP Sockets for .NET
GetException Method
See Also Send comments on this topic
Dart.Sockets Namespace > ErrorEventArgs Class : GetException Method

Glossary Item Box

Returns the Exception marshaled to the UI thread.

Syntax

Visual Basic (Declaration)
Public Function GetException() As Exception
Visual Basic (Usage) Copy Code
Dim instance As ErrorEventArgs
Dim value As Exception

value = instance.GetException()
C#
public Exception GetException()
Managed Extensions for C++
public: Exception* GetException();
C++/CLI
public:
Exception^ GetException();

Return Value

Exception

See Also

Reference

ErrorEventArgs Class
ErrorEventArgs Members


IPEndPoint Class

[image]
PowerTCP Sockets for .NET
IPEndPoint Class
Members See Also Send comments on this topic
Dart.Sockets Namespace : IPEndPoint Class

Glossary Item Box

Allows user to specify a range of IPEndPoints for local binding. Also resolves hostnames and saves them for future use.

Object Model

IPEndPoint Class

Syntax

Visual Basic (Declaration)
<SerializableAttribute()>
Public Class IPEndPoint
   Inherits System.Net.IPEndPoint
Visual Basic (Usage) Copy Code
Dim instance As IPEndPoint
C#
[Serializable()]
public class IPEndPoint : System.Net.IPEndPoint
Managed Extensions for C++
[Serializable()]
public __gc class IPEndPoint : public System.Net.IPEndPoint
C++/CLI
[Serializable()]
public ref class IPEndPoint : public System.Net.IPEndPoint

Inheritance Hierarchy

System.Object
System.Net.EndPoint
System.Net.IPEndPoint
Dart.Sockets.IPEndPoint

See Also

Reference

IPEndPoint Members
Dart.Sockets Namespace


IPEndPoint Class Members

[image]
PowerTCP Sockets for .NET
IPEndPoint Class Members
See Also Fields Properties Methods Send comments on this topic
Dart.Sockets Namespace : IPEndPoint Class

Glossary Item Box

The following tables list the members exposed by IPEndPoint.

Public Constructors

 | Name | Description
Public Constructor | IPEndPoint Constructor | Overloaded.
Top

Public Fields

 | Name | Description
Public Field | Range | The socket will be bound to a port between IPEndPoint.Port and (IPEndPoint.Port + Range), inclusive.
Top

Public Properties

 | Name | Description
Public Property | Address | Gets or sets the address of the endpoint.
Public Property | AddressFamily | (Inherited from System.Net.IPEndPoint)
Public Property | HostNameOrAddress | Gets or sets the host name or address resolved to create this IPEndPoint. Also performs a DNS resolution.
Public Property | HostNameOrAddressColonPort | The host name or address used to create this IPEndPoint with ":port" appended.
Public Property | Port | Gets or sets the port number of the endpoint.
Top

Public Methods

 | Name | Description
Public Method | Create | (Inherited from System.Net.IPEndPoint)
Public Method | Equals | (Inherited from System.Net.IPEndPoint)
Public Method | GetHashCode | (Inherited from System.Net.IPEndPoint)
Public Method | Serialize | (Inherited from System.Net.IPEndPoint)
Public Method | ToString | (Inherited from System.Net.IPEndPoint)
Top

See Also

Reference

IPEndPoint Class
Dart.Sockets Namespace


IPEndPoint Constructor

[image]
PowerTCP Sockets for .NET
IPEndPoint Constructor
See Also Send comments on this topic
Dart.Sockets Namespace > IPEndPoint Class : IPEndPoint Constructor

Glossary Item Box

Overload List

Overload | Description
IPEndPoint Constructor() | Creates an IPEndPoint using IPAddress.Any and an ephemeral port (0).
IPEndPoint Constructor(AddressFamily) | Creates an IPEndPoint using IPAddress.Any or IPAddress.IPv6Any and an ephemeral port (0).
IPEndPoint Constructor(IPAddress,Int32) | Creates an IPEndPoint using a specified IPAddress and port.
IPEndPoint Constructor(IPAddress,Int32,Int32) | Creates an IPEndPoint using an IPAddress, port, and port range.
IPEndPoint Constructor(String) | Creates an IPEndPoint using a hostname or address, and port 0.
IPEndPoint Constructor(String,Int32) | Creates an IPEndPoint using a hostname or address, and port.
IPEndPoint Constructor(String,AddressFamily,Int32) | Creates an IPEndPoint using a hostname or address, port, and AddressFamily.
IPEndPoint Constructor(String,AddressFamily,Int32,Int32) | Creates an IPEndPoint using a hostname or address, address family, port and range.
IPEndPoint Constructor(String,String,Int32,Int32) | Creates an IPEndPoint using a hostname or address, address, port and range.

See Also

Reference

IPEndPoint Class
IPEndPoint Members


IPEndPoint Constructor()

[image]
PowerTCP Sockets for .NET
IPEndPoint Constructor()
See Also Send comments on this topic
Dart.Sockets Namespace > IPEndPoint Class > IPEndPoint Constructor : IPEndPoint Constructor()

Glossary Item Box

Creates an IPEndPoint using IPAddress.Any and an ephemeral port (0).

Syntax

Visual Basic (Declaration)
Public Function New()
Visual Basic (Usage) Copy Code
Dim instance As New IPEndPoint()
C#
public IPEndPoint()
Managed Extensions for C++
public: IPEndPoint();
C++/CLI
public:
IPEndPoint();

See Also

Reference

IPEndPoint Class
IPEndPoint Members
Overload List


IPEndPoint Constructor(AddressFamily)

[image]
PowerTCP Sockets for .NET
IPEndPoint Constructor(AddressFamily)
See Also Send comments on this topic
Dart.Sockets Namespace > IPEndPoint Class > IPEndPoint Constructor : IPEndPoint Constructor(AddressFamily)

addressFamily
AddressFamily to match.

Glossary Item Box

Creates an IPEndPoint using IPAddress.Any or IPAddress.IPv6Any and an ephemeral port (0).

Syntax

Visual Basic (Declaration)
Public Function New( _
   ByVal addressFamily As AddressFamily _
)
Visual Basic (Usage) Copy Code
Dim addressFamily As AddressFamily

Dim instance As New IPEndPoint(addressFamily)
C#
public IPEndPoint(
   AddressFamily addressFamily
)
Managed Extensions for C++
public: IPEndPoint(
   AddressFamily addressFamily
)
C++/CLI
public:
IPEndPoint(
   AddressFamily addressFamily
)

Parameters

addressFamily
AddressFamily to match.

See Also

Reference

IPEndPoint Class
IPEndPoint Members
Overload List


IPEndPoint Constructor(IPAddress,Int32)

[image]
PowerTCP Sockets for .NET
IPEndPoint Constructor(IPAddress,Int32)
See Also Send comments on this topic
Dart.Sockets Namespace > IPEndPoint Class > IPEndPoint Constructor : IPEndPoint Constructor(IPAddress,Int32)

address
An IPv4 or IPv6 address.
port
The port to bind to.

Glossary Item Box

Creates an IPEndPoint using a specified IPAddress and port.

Syntax

Visual Basic (Declaration)
Public Function New( _
   ByVal address As IPAddress, _
   ByVal port As Integer _
)
Visual Basic (Usage) Copy Code
Dim address As IPAddress
Dim port As Integer

Dim instance As New IPEndPoint(address, port)
C#
public IPEndPoint(
   IPAddress address,
   int port
)
Managed Extensions for C++
public: IPEndPoint(
   IPAddress* address,
   int port
)
C++/CLI
public:
IPEndPoint(
   IPAddress^ address,
   int port
)

Parameters

address
An IPv4 or IPv6 address.
port
The port to bind to.

See Also

Reference

IPEndPoint Class
IPEndPoint Members
Overload List


IPEndPoint Constructor(IPAddress,Int32,Int32)

[image]
PowerTCP Sockets for .NET
IPEndPoint Constructor(IPAddress,Int32,Int32)
See Also Send comments on this topic
Dart.Sockets Namespace > IPEndPoint Class > IPEndPoint Constructor : IPEndPoint Constructor(IPAddress,Int32,Int32)

address
An IPv4 or IPv6 address.
port
The port to bind to.
range
The range of ports, starting at port, to attempt to bind to.

Glossary Item Box

Creates an IPEndPoint using an IPAddress, port, and port range.

Syntax

Visual Basic (Declaration)
Public Function New( _
   ByVal address As IPAddress, _
   ByVal port As Integer, _
   ByVal range As Integer _
)
Visual Basic (Usage) Copy Code
Dim address As IPAddress
Dim port As Integer
Dim range As Integer

Dim instance As New IPEndPoint(address, port, range)
C#
public IPEndPoint(
   IPAddress address,
   int port,
   int range
)
Managed Extensions for C++
public: IPEndPoint(
   IPAddress* address,
   int port,
   int range
)
C++/CLI
public:
IPEndPoint(
   IPAddress^ address,
   int port,
   int range
)

Parameters

address
An IPv4 or IPv6 address.
port
The port to bind to.
range
The range of ports, starting at port, to attempt to bind to.

See Also

Reference

IPEndPoint Class
IPEndPoint Members
Overload List


IPEndPoint Constructor(String)

[image]
PowerTCP Sockets for .NET
IPEndPoint Constructor(String)
See Also Send comments on this topic
Dart.Sockets Namespace > IPEndPoint Class > IPEndPoint Constructor : IPEndPoint Constructor(String)

hostNameOrAddress
A hostname or an IPv4 or IPv6 address. Empty string resolves to the first local IPv4 network interface.

Glossary Item Box

Creates an IPEndPoint using a hostname or address, and port 0.

Syntax

Visual Basic (Declaration)
Public Function New( _
   ByVal hostNameOrAddress As String _
)
Visual Basic (Usage) Copy Code
Dim hostNameOrAddress As String

Dim instance As New IPEndPoint(hostNameOrAddress)
C#
public IPEndPoint(
   string hostNameOrAddress
)
Managed Extensions for C++
public: IPEndPoint(
   string* hostNameOrAddress
)
C++/CLI
public:
IPEndPoint(
   String^ hostNameOrAddress
)

Parameters

hostNameOrAddress
A hostname or an IPv4 or IPv6 address. Empty string resolves to the first local IPv4 network interface.

Remarks

The hostNameOrAddress parameter is limited to 126 characters in pre-4.0 versions of the .NET Framework, and 255 characters in versions 4.0 and higher.

If hostNameOrAddress is a hostname, resolves to the IPv4 address.

See Also

Reference

IPEndPoint Class
IPEndPoint Members
Overload List


IPEndPoint Constructor(String,Int32)

[image]
PowerTCP Sockets for .NET
IPEndPoint Constructor(String,Int32)
See Also Send comments on this topic
Dart.Sockets Namespace > IPEndPoint Class > IPEndPoint Constructor : IPEndPoint Constructor(String,Int32)

hostNameOrAddress
A hostname or an IPv4 or IPv6 address. Empty string resolves to the first local IPv4 network interface.
port
The port to bind to.

Glossary Item Box

Creates an IPEndPoint using a hostname or address, and port.

Syntax

Visual Basic (Declaration)
Public Function New( _
   ByVal hostNameOrAddress As String, _
   ByVal port As Integer _
)
Visual Basic (Usage) Copy Code
Dim hostNameOrAddress As String
Dim port As Integer

Dim instance As New IPEndPoint(hostNameOrAddress, port)
C#
public IPEndPoint(
   string hostNameOrAddress,
   int port
)
Managed Extensions for C++
public: IPEndPoint(
   string* hostNameOrAddress,
   int port
)
C++/CLI
public:
IPEndPoint(
   String^ hostNameOrAddress,
   int port
)

Parameters

hostNameOrAddress
A hostname or an IPv4 or IPv6 address. Empty string resolves to the first local IPv4 network interface.
port
The port to bind to.

Remarks

The hostNameOrAddress parameter is limited to 126 characters in pre-4.0 versions of the .NET Framework, and 255 characters in versions 4.0 and higher.

If hostNameOrAddress is a hostname, resolves to the IPv4 address.

See Also

Reference

IPEndPoint Class
IPEndPoint Members
Overload List


IPEndPoint Constructor(String,AddressFamily,Int32)

[image]
PowerTCP Sockets for .NET
IPEndPoint Constructor(String,AddressFamily,Int32)
See Also Send comments on this topic
Dart.Sockets Namespace > IPEndPoint Class > IPEndPoint Constructor : IPEndPoint Constructor(String,AddressFamily,Int32)

hostNameOrAddress
A hostname or string address. Empty string resolves to the first local network interface in the specified AddressFamily.
addressFamily
The System.Net.Sockets.AddressFamily to match if resolving a hostname.
port
The port to bind to.

Glossary Item Box

Creates an IPEndPoint using a hostname or address, port, and AddressFamily.

Syntax

Visual Basic (Declaration)
Public Function New( _
   ByVal hostNameOrAddress As String, _
   ByVal addressFamily As AddressFamily, _
   ByVal port As Integer _
)
Visual Basic (Usage) Copy Code
Dim hostNameOrAddress As String
Dim addressFamily As AddressFamily
Dim port As Integer

Dim instance As New IPEndPoint(hostNameOrAddress, addressFamily, port)
C#
public IPEndPoint(
   string hostNameOrAddress,
   AddressFamily addressFamily,
   int port
)
Managed Extensions for C++
public: IPEndPoint(
   string* hostNameOrAddress,
   AddressFamily addressFamily,
   int port
)
C++/CLI
public:
IPEndPoint(
   String^ hostNameOrAddress,
   AddressFamily addressFamily,
   int port
)

Parameters

hostNameOrAddress
A hostname or string address. Empty string resolves to the first local network interface in the specified AddressFamily.
addressFamily
The System.Net.Sockets.AddressFamily to match if resolving a hostname.
port
The port to bind to.

Remarks

The hostNameOrAddress parameter is limited to 126 characters in pre-4.0 versions of the .NET Framework, and 255 characters in versions 4.0 and higher.

See Also

Reference

IPEndPoint Class
IPEndPoint Members
Overload List


IPEndPoint Constructor(String,AddressFamily,Int32,Int32)

[image]
PowerTCP Sockets for .NET
IPEndPoint Constructor(String,AddressFamily,Int32,Int32)
See Also Send comments on this topic
Dart.Sockets Namespace > IPEndPoint Class > IPEndPoint Constructor : IPEndPoint Constructor(String,AddressFamily,Int32,Int32)

hostNameOrAddress
A hostname or string address. Empty string resolves to the first local network interface in the specified AddressFamily.
addressFamily
The AddressFamily to match if resolving a hostname.
port
The port to bind to.
range
The range of ports, starting at port, to attempt to bind to.

Glossary Item Box

Creates an IPEndPoint using a hostname or address, address family, port and range.

Syntax

Visual Basic (Declaration)
Public Function New( _
   ByVal hostNameOrAddress As String, _
   ByVal addressFamily As AddressFamily, _
   ByVal port As Integer, _
   ByVal range As Integer _
)
Visual Basic (Usage) Copy Code
Dim hostNameOrAddress As String
Dim addressFamily As AddressFamily
Dim port As Integer
Dim range As Integer

Dim instance As New IPEndPoint(hostNameOrAddress, addressFamily, port, range)
C#
public IPEndPoint(
   string hostNameOrAddress,
   AddressFamily addressFamily,
   int port,
   int range
)
Managed Extensions for C++
public: IPEndPoint(
   string* hostNameOrAddress,
   AddressFamily addressFamily,
   int port,
   int range
)
C++/CLI
public:
IPEndPoint(
   String^ hostNameOrAddress,
   AddressFamily addressFamily,
   int port,
   int range
)

Parameters

hostNameOrAddress
A hostname or string address. Empty string resolves to the first local network interface in the specified AddressFamily.
addressFamily
The AddressFamily to match if resolving a hostname.
port
The port to bind to.
range
The range of ports, starting at port, to attempt to bind to.

Remarks

The socket will try to bind to the specified port. Upon failure, it will try with each successive port up to (port + range), until successful. An Exception is raised if all binding attempts fail.

The hostNameOrAddress parameter is limited to 126 characters in pre-4.0 versions of the .NET Framework, and 255 characters in versions 4.0 and higher.

See Also

Reference

IPEndPoint Class
IPEndPoint Members
Overload List


IPEndPoint Constructor(String,String,Int32,Int32)

[image]
PowerTCP Sockets for .NET
IPEndPoint Constructor(String,String,Int32,Int32)
See Also Send comments on this topic
Dart.Sockets Namespace > IPEndPoint Class > IPEndPoint Constructor : IPEndPoint Constructor(String,String,Int32,Int32)

hostNameOrAddress
A hostname or string address.
address
The IPAddress in string notation.
port
The port to bind to.
range
The range of ports, starting at port, to attempt to bind to.

Glossary Item Box

Creates an IPEndPoint using a hostname or address, address, port and range.

Syntax

Visual Basic (Declaration)
Public Function New( _
   ByVal hostNameOrAddress As String, _
   ByVal address As String, _
   ByVal port As Integer, _
   ByVal range As Integer _
)
Visual Basic (Usage) Copy Code
Dim hostNameOrAddress As String
Dim address As String
Dim port As Integer
Dim range As Integer

Dim instance As New IPEndPoint(hostNameOrAddress, address, port, range)
C#
public IPEndPoint(
   string hostNameOrAddress,
   string address,
   int port,
   int range
)
Managed Extensions for C++
public: IPEndPoint(
   string* hostNameOrAddress,
   string* address,
   int port,
   int range
)
C++/CLI
public:
IPEndPoint(
   String^ hostNameOrAddress,
   String^ address,
   int port,
   int range
)

Parameters

hostNameOrAddress
A hostname or string address.
address
The IPAddress in string notation.
port
The port to bind to.
range
The range of ports, starting at port, to attempt to bind to.

Remarks

This constructor is typically used to serialize the IPEndPoint and does not resolve hostNameOrAddress. The hostname can be needed for some proxies.

See Also

Reference

IPEndPoint Class
IPEndPoint Members
Overload List


IPEndPoint Class Properties

[image]
PowerTCP Sockets for .NET
IPEndPoint Class Properties
See Also Send comments on this topic
Dart.Sockets Namespace : IPEndPoint Class

Glossary Item Box

For a list of all members of this type, see IPEndPoint members.

Public Properties

 | Name | Description
Public Property | Address | Gets or sets the address of the endpoint.
Public Property | AddressFamily | (Inherited from System.Net.IPEndPoint)
Public Property | HostNameOrAddress | Gets or sets the host name or address resolved to create this IPEndPoint. Also performs a DNS resolution.
Public Property | HostNameOrAddressColonPort | The host name or address used to create this IPEndPoint with ":port" appended.
Public Property | Port | Gets or sets the port number of the endpoint.
Top

See Also

Reference

IPEndPoint Class
Dart.Sockets Namespace


Address Property

[image]
PowerTCP Sockets for .NET
Address Property
See Also Send comments on this topic
Dart.Sockets Namespace > IPEndPoint Class : Address Property

Glossary Item Box

Gets or sets the address of the endpoint.

Syntax

Visual Basic (Declaration)
Public Shadows Property Address As IPAddress
Visual Basic (Usage) Copy Code
Dim instance As IPEndPoint
Dim value As IPAddress

instance.Address = value

value = instance.Address
C#
public new IPAddress Address {get; set;}
Managed Extensions for C++
public: __property new IPAddress* get_Address();
public: __property new void set_Address(
   IPAddress* value
);
C++/CLI
public:
new property IPAddress^ Address {
   IPAddress^ get();
   void set (    IPAddress^ value);
}

See Also

Reference

IPEndPoint Class
IPEndPoint Members


HostNameOrAddress Property

[image]
PowerTCP Sockets for .NET
HostNameOrAddress Property
See Also Send comments on this topic
Dart.Sockets Namespace > IPEndPoint Class : HostNameOrAddress Property

Glossary Item Box

Gets or sets the host name or address resolved to create this IPEndPoint. Also performs a DNS resolution.

Syntax

Visual Basic (Declaration)
Public Property HostNameOrAddress As String
Visual Basic (Usage) Copy Code
Dim instance As IPEndPoint
Dim value As String

instance.HostNameOrAddress = value

value = instance.HostNameOrAddress
C#
public string HostNameOrAddress {get; set;}
Managed Extensions for C++
public: __property string* get_HostNameOrAddress();
public: __property void set_HostNameOrAddress(
   string* value
);
C++/CLI
public:
property String^ HostNameOrAddress {
   String^ get();
   void set (    String^ value);
}

Remarks

The value of this property is limited to 126 characters in pre-4.0 versions of the .NET Framework, and 255 characters in versions 4.0 and higher. IDN encoding is performed for DNS resolution if a non-ASCII hostname is provided.

See Also

Reference

IPEndPoint Class
IPEndPoint Members


HostNameOrAddressColonPort Property

[image]
PowerTCP Sockets for .NET
HostNameOrAddressColonPort Property
See Also Send comments on this topic
Dart.Sockets Namespace > IPEndPoint Class : HostNameOrAddressColonPort Property

Glossary Item Box

The host name or address used to create this IPEndPoint with ":port" appended.

Syntax

Visual Basic (Declaration)
Public ReadOnly Property HostNameOrAddressColonPort As String
Visual Basic (Usage) Copy Code
Dim instance As IPEndPoint
Dim value As String

value = instance.HostNameOrAddressColonPort
C#
public string HostNameOrAddressColonPort {get;}
Managed Extensions for C++
public: __property string* get_HostNameOrAddressColonPort();
C++/CLI
public:
property String^ HostNameOrAddressColonPort {
   String^ get();
}

Remarks

If HostNameOrAddress is an IPv6 address, the format includes square brackets as follows: [xx:yy...zz]:port.

See Also

Reference

IPEndPoint Class
IPEndPoint Members


Port Property

[image]
PowerTCP Sockets for .NET
Port Property
See Also Send comments on this topic
Dart.Sockets Namespace > IPEndPoint Class : Port Property

Glossary Item Box

Gets or sets the port number of the endpoint.

Syntax

Visual Basic (Declaration)
<DefaultValueAttribute()>
Public Shadows Property Port As Integer
Visual Basic (Usage) Copy Code
Dim instance As IPEndPoint
Dim value As Integer

instance.Port = value

value = instance.Port
C#
[DefaultValue()]
public new int Port {get; set;}
Managed Extensions for C++
[DefaultValue()]
public: __property new int get_Port();
public: __property new void set_Port(
   int value
);
C++/CLI
[DefaultValue()]
public:
new property int Port {
   int get();
   void set (    int value);
}

See Also

Reference

IPEndPoint Class
IPEndPoint Members


IPEndPoint Class Fields

[image]
PowerTCP Sockets for .NET
IPEndPoint Class Fields
See Also Send comments on this topic
Dart.Sockets Namespace : IPEndPoint Class

Glossary Item Box

For a list of all members of this type, see IPEndPoint members.

Public Fields

 | Name | Description
Public Field | Range | The socket will be bound to a port between IPEndPoint.Port and (IPEndPoint.Port + Range), inclusive.
Top

See Also

Reference

IPEndPoint Class
Dart.Sockets Namespace


Range Field

[image]
PowerTCP Sockets for .NET
Range Field
See Also Send comments on this topic
Dart.Sockets Namespace > IPEndPoint Class : Range Field

Glossary Item Box

The socket will be bound to a port between IPEndPoint.Port and (IPEndPoint.Port + Range), inclusive.

Syntax

Visual Basic (Declaration)
Public Range As Integer
Visual Basic (Usage) Copy Code
Dim instance As IPEndPoint
Dim value As Integer

value = instance.Range

instance.Range = value
C#
public int Range
Managed Extensions for C++
public: int Range
C++/CLI
public:
int Range

See Also

Reference

IPEndPoint Class
IPEndPoint Members


MxHostEntry Class

[image]
PowerTCP Sockets for .NET
MxHostEntry Class
Members Example See Also Send comments on this topic
Dart.Sockets Namespace : MxHostEntry Class

Glossary Item Box

Provides the HostName and Preference provided by an MX record lookup.

Object Model

MxHostEntry Class

Syntax

Visual Basic (Declaration)
Public Class MxHostEntry
Visual Basic (Usage) Copy Code
Dim instance As MxHostEntry
C#
public class MxHostEntry
Managed Extensions for C++
public __gc class MxHostEntry
C++/CLI
public ref class MxHostEntry

Example

The following example demonstrates performing a DNS lookup of a provided hostname, and an MX record lookup of a provided email address.
C# Copy Code
private void button1_Click(object sender, EventArgs e)
{
    dns1.Start(doMxLookup, EmailToResolveTextbox.Text);
}

private void button2_Click(object sender, EventArgs e)
{
    dns1.Start(doHostLookup, HostToResolveTextbox.Text);
}

/// <summary>
/// Performs an MX record lookup of the provided email address.
/// </summary>
/// <param name="slave">Object used to perform DNS lookup</param>
/// <param name="state">Passed in from the 2nd parameter of Dns.Start(). Email address to lookup.</param>
private void doMxLookup(DnsSlave slave, object state)
{
    MxHostEntry[] hostEntries = slave.GetMxHostEntries(state.ToString());
    string results = "The following mail servers were returned for " + state.ToString() + ":" + Environment.NewLine;
    foreach (MxHostEntry hostEntry in hostEntries)
        results += hostEntry.HostName + " : Preference: " + hostEntry.Preference.ToString() + Environment.NewLine;
    //Marshal result to the UI for display
    dns1.Marshal(results, null);
}

/// <summary>
/// Performs a DNS lookup of the provided hostname.
/// </summary>
/// <param name="slave">Object used to perform DNS lookup</param>
/// <param name="state">Passed in from the 2nd parameter of Dns.Start(). Hostname to lookup.</param>
private void doHostLookup(DnsSlave slave, object state)
{
    System.Net.IPHostEntry hostEntry = slave.GetHostEntry(state.ToString());
    string results = "The following IP addresses were returned for " + state.ToString() + ":" + Environment.NewLine;
    foreach (System.Net.IPAddress address in hostEntry.AddressList)
        results += address.ToString() + Environment.NewLine;
    //Marshal result to the UI for display
    dns1.Marshal(results, null);
}

/// <summary>
/// Raised when Dns.Marshal(string, object) is called.
/// </summary>
private void dns1_UserState(object sender, UserStateEventArgs e)
{
    textBox1.AppendText(e.Message + Environment.NewLine);
}
Visual Basic Copy Code
Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs)
    dns1.Start(AddressOf doMxLookup, EmailToResolveTextbox.Text)
End Sub

Private Sub button2_Click(ByVal sender As Object, ByVal e As EventArgs)
    dns1.Start(AddressOf doHostLookup, HostToResolveTextbox.Text)
End Sub

''' <summary>
''' Performs an MX record lookup of the provided email address.
''' </summary>
''' <param name="slave">Object used to perform DNS lookup</param>
''' <param name="state">Passed in from the 2nd parameter of Dns.Start(). Email address to lookup.</param>
Private Sub doMxLookup(ByVal slave As DnsSlave, ByVal state As Object)
    Dim hostEntries() As MxHostEntry = slave.GetMxHostEntries(state.ToString())
    Dim results As String = "The following mail servers were returned for " & state.ToString() & ":" & Environment.NewLine
    For Each hostEntry As MxHostEntry In hostEntries
        results &= hostEntry.HostName & " : Preference: " & hostEntry.Preference.ToString() & Environment.NewLine
    Next hostEntry
    'Marshal result to the UI for display
    dns1.Marshal(results, Nothing)
End Sub

''' <summary>
''' Performs a DNS lookup of the provided hostname.
''' </summary>
''' <param name="slave">Object used to perform DNS lookup</param>
''' <param name="state">Passed in from the 2nd parameter of Dns.Start(). Hostname to lookup.</param>
Private Sub doHostLookup(ByVal slave As DnsSlave, ByVal state As Object)
    Dim hostEntry As System.Net.IPHostEntry = slave.GetHostEntry(state.ToString())
    Dim results As String = "The following IP addresses were returned for " & state.ToString() & ":" & Environment.NewLine
    For Each address As System.Net.IPAddress In hostEntry.AddressList
        results &= address.ToString() & Environment.NewLine
    Next address
    'Marshal result to the UI for display
    dns1.Marshal(results, Nothing)
End Sub

''' <summary>
''' Raised when Dns.Marshal(string, object) is called.
''' </summary>
Private Sub dns1_UserState(ByVal sender As Object, ByVal e As UserStateEventArgs)
    textBox1.AppendText(e.Message & Environment.NewLine)
End Sub

Inheritance Hierarchy

System.Object
Dart.Sockets.MxHostEntry

See Also

Reference

MxHostEntry Members
Dart.Sockets Namespace


MxHostEntry Class Members

[image]
PowerTCP Sockets for .NET
MxHostEntry Class Members
See Also Fields Send comments on this topic
Dart.Sockets Namespace : MxHostEntry Class

Glossary Item Box

The following tables list the members exposed by MxHostEntry.

Public Constructors

 | Name | Description
Public Constructor | MxHostEntry Constructor | Constructor for MxHostEntry.
Top

Public Fields

 | Name | Description
Public Field | HostName | Gets the hostname of the resolved mail server.
Public Field | Preference | Gets the preference value of the entry.
Top

See Also

Reference

MxHostEntry Class
Dart.Sockets Namespace


MxHostEntry Constructor

[image]
PowerTCP Sockets for .NET
MxHostEntry Constructor
See Also Send comments on this topic
Dart.Sockets Namespace > MxHostEntry Class : MxHostEntry Constructor

hostName
preference

Glossary Item Box

Constructor for MxHostEntry.

Syntax

Visual Basic (Declaration)
Public Function New( _
   ByVal hostName As String, _
   ByVal preference As Integer _
)
Visual Basic (Usage) Copy Code
Dim hostName As String
Dim preference As Integer

Dim instance As New MxHostEntry(hostName, preference)
C#
public MxHostEntry(
   string hostName,
   int preference
)
Managed Extensions for C++
public: MxHostEntry(
   string* hostName,
   int preference
)
C++/CLI
public:
MxHostEntry(
   String^ hostName,
   int preference
)

Parameters

hostName
preference

See Also

Reference

MxHostEntry Class
MxHostEntry Members


MxHostEntry Class Fields

[image]
PowerTCP Sockets for .NET
MxHostEntry Class Fields
See Also Send comments on this topic
Dart.Sockets Namespace : MxHostEntry Class

Glossary Item Box

For a list of all members of this type, see MxHostEntry members.

Public Fields

 | Name | Description
Public Field | HostName | Gets the hostname of the resolved mail server.
Public Field | Preference | Gets the preference value of the entry.
Top

See Also

Reference

MxHostEntry Class
Dart.Sockets Namespace


HostName Field

[image]
PowerTCP Sockets for .NET
HostName Field
See Also Send comments on this topic
Dart.Sockets Namespace > MxHostEntry Class : HostName Field

Glossary Item Box

Gets the hostname of the resolved mail server.

Syntax

Visual Basic (Declaration)
Public ReadOnly HostName As String
Visual Basic (Usage) Copy Code
Dim instance As MxHostEntry
Dim value As String

value = instance.HostName
C#
public readonly string HostName
Managed Extensions for C++
public: readonly string* HostName
C++/CLI
public:
readonly String^ HostName

See Also

Reference

MxHostEntry Class
MxHostEntry Members


Preference Field

[image]
PowerTCP Sockets for .NET
Preference Field
See Also Send comments on this topic
Dart.Sockets Namespace > MxHostEntry Class : Preference Field

Glossary Item Box

Gets the preference value of the entry.

Syntax

Visual Basic (Declaration)
Public ReadOnly Preference As Integer
Visual Basic (Usage) Copy Code
Dim instance As MxHostEntry
Dim value As Integer

value = instance.Preference
C#
public readonly int Preference
Managed Extensions for C++
public: readonly int Preference
C++/CLI
public:
readonly int Preference

Remarks

Lower numbers are preferred.

See Also

Reference

MxHostEntry Class
MxHostEntry Members


Ping Class

[image]
PowerTCP Sockets for .NET
Ping Class
Members Example See Also Send comments on this topic
Dart.Sockets Namespace : Ping Class

Glossary Item Box

Provides classes and methods for Pinging (sending ICMP Echo requests).

Object Model

Ping Class

Syntax

Visual Basic (Declaration)
Public Class Ping
   Inherits ComponentBase
Visual Basic (Usage) Copy Code
Dim instance As Ping
C#
public class Ping : ComponentBase
Managed Extensions for C++
public __gc class Ping : public ComponentBase
C++/CLI
public ref class Ping : public ComponentBase

Example

The following example demonstrates pinging a remote host.
C# Copy Code
private void button1_Click(object sender, EventArgs e)
{
    ping1.Start(pingWorker, HostNameOrAddressToPingTextbox.Text);
}

private void pingWorker(PingSlave slave, object state)
{
    ping1.Marshal(slave.GetEchoes(new Dart.Sockets.IPEndPoint(state.ToString(), 0).Address, null, 20, 5000, false));
}

void ping1_Echo(object sender, EchoEventArgs e)
{
    string results = "The following echoes were returned:\r\n";
    for (int i = 0; i < e.Echoes.Length; i++)
        results += e.Echoes[i].ToString() + "\r\n";
    textBox1.AppendText(results);
}
Visual Basic Copy Code
Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs)
    ping1.Start(AddressOf pingWorker, HostNameOrAddressToPingTextbox.Text)
End Sub

Private Sub pingWorker(ByVal slave As PingSlave, ByVal state As Object)
    ping1.Marshal(slave.GetEchoes((New Dart.Sockets.IPEndPoint(state.ToString(), 0)).Address, Nothing, 20, 5000, False))
End Sub

Private Sub ping1_Echo(ByVal sender As Object, ByVal e As EchoEventArgs)
    Dim results As String = "The following echoes were returned:" & vbCrLf
    For i As Integer = 0 To e.Echoes.Length - 1
        results &= e.Echoes(i).ToString() & vbCrLf
    Next i
    textBox1.AppendText(results)
End Sub

Inheritance Hierarchy

System.Object
System.MarshalByRefObject
System.ComponentModel.Component
Dart.Sockets.ComponentBase
Dart.Sockets.Ping

See Also

Reference

Ping Members
Dart.Sockets Namespace


Ping Class Members

[image]
PowerTCP Sockets for .NET
Ping Class Members
See Also Properties Methods Events Send comments on this topic
Dart.Sockets Namespace : Ping Class

Glossary Item Box

The following tables list the members exposed by Ping.

Public Constructors

 | Name | Description
Public Constructor | Ping Constructor | Overloaded.
Top

Public Properties

 | Name | Description
Public Property | Container | (Inherited from System.ComponentModel.Component)
Public Property | Encoding | Character encoding used by the component. (Inherited from Dart.Sockets.ComponentBase)
Public Property | Site | (Inherited from System.ComponentModel.Component)
Public Property | SynchronizingObject | Gets or sets the object used to marshal data to the UI thread (for raising events). (Inherited from Dart.Sockets.ComponentBase)
Public Property | SyncRoot | Gets an object that is used to synchronize access to the upper layer protocol in use. (Inherited from Dart.Sockets.ComponentBase)
Public Property | Tag | Gets or sets an object that stores any user data. (Inherited from Dart.Sockets.ComponentBase)
Top

Protected Properties

 | Name | Description
Protected Property | CanRaiseEvents | (Inherited from System.ComponentModel.Component)
Protected Property | DesignMode | (Inherited from System.ComponentModel.Component)
Protected Property | Events | (Inherited from System.ComponentModel.Component)
Top

Public Methods

 | Name | Description
Public Method | CreateObjRef | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from System.MarshalByRefObject)
Public Method | Deserialize | Deserialize a previously serialized object. (Inherited from Dart.Sockets.ComponentBase)
Public Method | Dispose | Overloaded. (Inherited from System.ComponentModel.Component)
Public Method | GetLifetimeService | Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | InitializeLifetimeService | Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | Marshal | Overloaded. Marshals an array of Echo objects to the UI thread.
Public Method | Serialize | Serialize an object to the provided destination stream. (Inherited from Dart.Sockets.ComponentBase)
Public Method | Start | Overloaded. Starts a worker thread on which the specified delegate function executes.
Public Method | ToString | (Inherited from System.ComponentModel.Component)
Top

Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from System.ComponentModel.Component)
Protected Method | GetService | (Inherited from System.ComponentModel.Component)
Protected Method | MemberwiseClone | Overloaded. Creates a shallow copy of the current System.MarshalByRefObject object. (Inherited from System.MarshalByRefObject)
Protected Method | OnEcho | Raises the Echo event.
Protected Method | OnError | Raises the Error event. (Inherited from Dart.Sockets.ComponentBase)
Protected Method | OnUserState | Raises the UserState event. (Inherited from Dart.Sockets.ComponentBase)
Top

Public Events

 | Name | Description
Public Event | Disposed | (Inherited from System.ComponentModel.Component)
Public Event | Echo | Raised when Marshal(Echo[]) is used.
Public Event | Error | Raised when Marshal(Exception) is used or an unhandled Exception is thrown in a worker thread created using Start. (Inherited from Dart.Sockets.ComponentBase)
Public Event | UserState | Raised when Marshal(String,Object) is used. (Inherited from Dart.Sockets.ComponentBase)
Top

See Also

Reference

Ping Class
Dart.Sockets Namespace


Ping Constructor

[image]
PowerTCP Sockets for .NET
Ping Constructor
See Also Send comments on this topic
Dart.Sockets Namespace > Ping Class : Ping Constructor

Glossary Item Box

Overload List

Overload | Description
Ping Constructor(IContainer) | Initializes a new Ping object.
Ping Constructor() | Create a Ping component.

See Also

Reference

Ping Class
Ping Members


Ping Constructor(IContainer)

[image]
PowerTCP Sockets for .NET
Ping Constructor(IContainer)
See Also Send comments on this topic
Dart.Sockets Namespace > Ping Class > Ping Constructor : Ping Constructor(IContainer)

container
The IContainer which contains the object.

Glossary Item Box

Initializes a new Ping object.

Syntax

Visual Basic (Declaration)
Public Function New( _
   ByVal container As IContainer _
)
Visual Basic (Usage) Copy Code
Dim container As IContainer

Dim instance As New Ping(container)
C#
public Ping(
   IContainer container
)
Managed Extensions for C++
public: Ping(
   IContainer* container
)
C++/CLI
public:
Ping(
   IContainer^ container
)

Parameters

container
The IContainer which contains the object.

See Also

Reference

Ping Class
Ping Members
Overload List


Ping Constructor()

[image]
PowerTCP Sockets for .NET
Ping Constructor()
See Also Send comments on this topic
Dart.Sockets Namespace > Ping Class > Ping Constructor : Ping Constructor()

Glossary Item Box

Create a Ping component.

Syntax

Visual Basic (Declaration)
Public Function New()
Visual Basic (Usage) Copy Code
Dim instance As New Ping()
C#
public Ping()
Managed Extensions for C++
public: Ping();
C++/CLI
public:
Ping();

See Also

Reference

Ping Class
Ping Members
Overload List


Ping Class Methods

[image]
PowerTCP Sockets for .NET
Ping Class Methods
See Also Send comments on this topic
Dart.Sockets Namespace : Ping Class

Glossary Item Box

For a list of all members of this type, see Ping members.

Public Methods

 | Name | Description
Public Method | CreateObjRef | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from System.MarshalByRefObject)
Public Method | Deserialize | Deserialize a previously serialized object. (Inherited from Dart.Sockets.ComponentBase)
Public Method | Dispose | Overloaded. (Inherited from System.ComponentModel.Component)
Public Method | GetLifetimeService | Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | InitializeLifetimeService | Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | Marshal | Overloaded. Marshals an array of Echo objects to the UI thread.
Public Method | Serialize | Serialize an object to the provided destination stream. (Inherited from Dart.Sockets.ComponentBase)
Public Method | Start | Overloaded. Starts a worker thread on which the specified delegate function executes.
Public Method | ToString | (Inherited from System.ComponentModel.Component)
Top

Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from System.ComponentModel.Component)
Protected Method | GetService | (Inherited from System.ComponentModel.Component)
Protected Method | MemberwiseClone | Overloaded. Creates a shallow copy of the current System.MarshalByRefObject object. (Inherited from System.MarshalByRefObject)
Protected Method | OnEcho | Raises the Echo event.
Protected Method | OnError | Raises the Error event. (Inherited from Dart.Sockets.ComponentBase)
Protected Method | OnUserState | Raises the UserState event. (Inherited from Dart.Sockets.ComponentBase)
Top

See Also

Reference

Ping Class
Dart.Sockets Namespace


Marshal Method

[image]
PowerTCP Sockets for .NET
Marshal Method
See Also Send comments on this topic
Dart.Sockets Namespace > Ping Class : Marshal Method

Glossary Item Box

Marshals an array of Echo objects to the UI thread.

Overload List

Overload | Description
Marshal(Echo[]) | Marshals an array of Echo objects to the UI thread.
Marshal(String,Object) | Marshals a string and/or object to the UI thread and raises the UserState event. (Inherited from Dart.Sockets.ComponentBase)
Marshal(Exception) | Marshals an exception to the UI thread and raises the Error event. (Inherited from Dart.Sockets.ComponentBase)

See Also

Reference

Ping Class
Ping Members


Marshal(Echo[]) Method

[image]
PowerTCP Sockets for .NET
Marshal(Echo[]) Method
See Also Example Send comments on this topic
Dart.Sockets Namespace > Ping Class > Marshal Method : Marshal(Echo[]) Method

echoes
The Echo objects to be marshaled.

Glossary Item Box

Marshals an array of Echo objects to the UI thread.

Syntax

Visual Basic (Declaration)
Public Overloads Sub Marshal( _
   ByVal echoes() As Echo _
)
Visual Basic (Usage) Copy Code
Dim instance As Ping
Dim echoes() As Echo

instance.Marshal(echoes)
C#
public void Marshal(
   Echo[] echoes
)
Managed Extensions for C++
public: void Marshal(
   Echo*[]* echoes
)
C++/CLI
public:
void Marshal(
   array<Echo^>^ echoes
)

Parameters

echoes
The Echo objects to be marshaled.

Remarks

This method is used to marshal Ping echoes from a worker thread to the UI thread for typical display purposes. It calls the OnEcho method, which raises the Echo event.

See the SynchronizingObject property for information on updating UI controls in your event handler.

Example

The following example demonstrates pinging a remote host.
C# Copy Code
private void button1_Click(object sender, EventArgs e)
{
    ping1.Start(pingWorker, HostNameOrAddressToPingTextbox.Text);
}

private void pingWorker(PingSlave slave, object state)
{
    ping1.Marshal(slave.GetEchoes(new Dart.Sockets.IPEndPoint(state.ToString(), 0).Address, null, 20, 5000, false));
}

void ping1_Echo(object sender, EchoEventArgs e)
{
    string results = "The following echoes were returned:\r\n";
    for (int i = 0; i < e.Echoes.Length; i++)
        results += e.Echoes[i].ToString() + "\r\n";
    textBox1.AppendText(results);
}
Visual Basic Copy Code
Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs)
    ping1.Start(AddressOf pingWorker, HostNameOrAddressToPingTextbox.Text)
End Sub

Private Sub pingWorker(ByVal slave As PingSlave, ByVal state As Object)
    ping1.Marshal(slave.GetEchoes((New Dart.Sockets.IPEndPoint(state.ToString(), 0)).Address, Nothing, 20, 5000, False))
End Sub

Private Sub ping1_Echo(ByVal sender As Object, ByVal e As EchoEventArgs)
    Dim results As String = "The following echoes were returned:" & vbCrLf
    For i As Integer = 0 To e.Echoes.Length - 1
        results &= e.Echoes(i).ToString() & vbCrLf
    Next i
    textBox1.AppendText(results)
End Sub

See Also

Reference

Ping Class
Ping Members
Overload List


OnEcho Method

[image]
PowerTCP Sockets for .NET
OnEcho Method
See Also Send comments on this topic
Dart.Sockets Namespace > Ping Class : OnEcho Method

e
An EchoEventArgs object that contains the event data.

Glossary Item Box

Raises the Echo event.

Syntax

Visual Basic (Declaration)
Protected Overridable Sub OnEcho( _
   ByVal e As EchoEventArgs _
)
Visual Basic (Usage) Copy Code
Dim instance As Ping
Dim e As EchoEventArgs

instance.OnEcho(e)
C#
protected virtual void OnEcho(
   EchoEventArgs e
)
Managed Extensions for C++
protected: virtual void OnEcho(
   EchoEventArgs* e
)
C++/CLI
protected:
virtual void OnEcho(
   EchoEventArgs^ e
)

Parameters

e
An EchoEventArgs object that contains the event data.

Remarks

If the Synchronizing property is set, this method asynchronously invokes the Echo event on the UI thread. If the Synchronizing property is null, this method invokes the event on the executing thread.

This method allows derived classes to handle the event without attaching a delegate, but marshaling is not provided. This is the preferred technique for handling the event in a derived class.

Note to Inheritors: When overriding OnEcho in a derived class, be sure to call the base class OnEcho method, so that registered delegates receive the event.

See the SynchronizingObject property for information on updating UI controls in your event handler.

See Also

Reference

Ping Class
Ping Members


Start Method

[image]
PowerTCP Sockets for .NET
Start Method
See Also Send comments on this topic
Dart.Sockets Namespace > Ping Class : Start Method

Glossary Item Box

Starts a worker thread on which the specified delegate function executes.

Overload List

Overload | Description
Start(PingThreadStart,Object) | Starts a worker thread on which the specified delegate function executes.
Start(PingThreadStart,IPAddress,Type,Object) | Starts a worker thread on which the specified delegate function executes.

See Also

Reference

Ping Class
Ping Members


Start(PingThreadStart,Object) Method

[image]
PowerTCP Sockets for .NET
Start(PingThreadStart,Object) Method
See Also Example Send comments on this topic
Dart.Sockets Namespace > Ping Class > Start Method : Start(PingThreadStart,Object) Method

worker
PingThreadStart delegate specifying the function to execute.
state
Information to pass to the worker delegate function; can be null.

Glossary Item Box

Starts a worker thread on which the specified delegate function executes.

Syntax

Visual Basic (Declaration)
Public Overloads Sub Start( _
   ByVal worker As PingThreadStart, _
   ByVal state As Object _
)
Visual Basic (Usage) Copy Code
Dim instance As Ping
Dim worker As PingThreadStart
Dim state As Object

instance.Start(worker, state)
C#
public void Start(
   PingThreadStart worker,
   object state
)
Managed Extensions for C++
public: void Start(
   PingThreadStart* worker,
   Object* state
)
C++/CLI
public:
void Start(
   PingThreadStart^ worker,
   Object^ state
)

Parameters

worker
PingThreadStart delegate specifying the function to execute.
state
Information to pass to the worker delegate function; can be null.

Remarks

This method provides a convenient means for executing blocking functions on a worker thread. Applications with a UI thread should use this technique to execute processes (like multiple Pings) that can block the UI thread.

The local IP interface defaults to IPAddress.Any and the Ping.Type defaults to Ping.Type.Raw.

Unhandled exceptions occurring on the worker thread will be caught and reported by the Error event.

Example

The following example demonstrates pinging a remote host.
C# Copy Code
private void button1_Click(object sender, EventArgs e)
{
    ping1.Start(pingWorker, HostNameOrAddressToPingTextbox.Text);
}

private void pingWorker(PingSlave slave, object state)
{
    ping1.Marshal(slave.GetEchoes(new Dart.Sockets.IPEndPoint(state.ToString(), 0).Address, null, 20, 5000, false));
}

void ping1_Echo(object sender, EchoEventArgs e)
{
    string results = "The following echoes were returned:\r\n";
    for (int i = 0; i < e.Echoes.Length; i++)
        results += e.Echoes[i].ToString() + "\r\n";
    textBox1.AppendText(results);
}
Visual Basic Copy Code
Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs)
    ping1.Start(AddressOf pingWorker, HostNameOrAddressToPingTextbox.Text)
End Sub

Private Sub pingWorker(ByVal slave As PingSlave, ByVal state As Object)
    ping1.Marshal(slave.GetEchoes((New Dart.Sockets.IPEndPoint(state.ToString(), 0)).Address, Nothing, 20, 5000, False))
End Sub

Private Sub ping1_Echo(ByVal sender As Object, ByVal e As EchoEventArgs)
    Dim results As String = "The following echoes were returned:" & vbCrLf
    For i As Integer = 0 To e.Echoes.Length - 1
        results &= e.Echoes(i).ToString() & vbCrLf
    Next i
    textBox1.AppendText(results)
End Sub

See Also

Reference

Ping Class
Ping Members
Overload List


Start(PingThreadStart,IPAddress,Type,Object) Method

[image]
PowerTCP Sockets for .NET
Start(PingThreadStart,IPAddress,Type,Object) Method
See Also Send comments on this topic
Dart.Sockets Namespace > Ping Class > Start Method : Start(PingThreadStart,IPAddress,Type,Object) Method

worker
PingThreadStart delegate specifying the function to execute.
localAddress
The local IP interface desired.
type
The Ping.Type of Echo technology desired.
state
Information to pass to the worker delegate function; can be null.

Glossary Item Box

Starts a worker thread on which the specified delegate function executes.

Syntax

Visual Basic (Declaration)
Public Overloads Sub Start( _
   ByVal worker As PingThreadStart, _
   ByVal localAddress As IPAddress, _
   ByVal type As Ping.Type, _
   ByVal state As Object _
)
Visual Basic (Usage) Copy Code
Dim instance As Ping
Dim worker As PingThreadStart
Dim localAddress As IPAddress
Dim type As Ping.Type
Dim state As Object

instance.Start(worker, localAddress, type, state)
C#
public void Start(
   PingThreadStart worker,
   IPAddress localAddress,
   Ping.Type type,
   object state
)
Managed Extensions for C++
public: void Start(
   PingThreadStart* worker,
   IPAddress* localAddress,
   Ping.Type type,
   Object* state
)
C++/CLI
public:
void Start(
   PingThreadStart^ worker,
   IPAddress^ localAddress,
   Ping.Type type,
   Object^ state
)

Parameters

worker
PingThreadStart delegate specifying the function to execute.
localAddress
The local IP interface desired.
type
The Ping.Type of Echo technology desired.
state
Information to pass to the worker delegate function; can be null.

Remarks

This method provides a convenient means for executing blocking functions on a worker thread. Applications with a UI thread should use this technique to execute processes (like multiple Pings) that can block the UI thread.

Unhandled exceptions occurring on the worker thread will be caught and reported by the Error event.

See Also

Reference

Ping Class
Ping Members
Overload List


Ping Class Events

[image]
PowerTCP Sockets for .NET
Ping Class Events
See Also Send comments on this topic
Dart.Sockets Namespace : Ping Class

Glossary Item Box

For a list of all members of this type, see Ping members.

Public Events

 | Name | Description
Public Event | Disposed | (Inherited from System.ComponentModel.Component)
Public Event | Echo | Raised when Marshal(Echo[]) is used.
Public Event | Error | Raised when Marshal(Exception) is used or an unhandled Exception is thrown in a worker thread created using Start. (Inherited from Dart.Sockets.ComponentBase)
Public Event | UserState | Raised when Marshal(String,Object) is used. (Inherited from Dart.Sockets.ComponentBase)
Top

See Also

Reference

Ping Class
Dart.Sockets Namespace


Echo Event

[image]
PowerTCP Sockets for .NET
Echo Event
See Also Send comments on this topic
Dart.Sockets Namespace > Ping Class : Echo Event

Glossary Item Box

Raised when Marshal(Echo[]) is used.

Syntax

Visual Basic (Declaration)
Public Event Echo As EventHandler(Of EchoEventArgs)
Visual Basic (Usage) Copy Code
Dim instance As Ping
Dim handler As EventHandler(Of EchoEventArgs)

AddHandler instance.Echo, handler
C#
public event EventHandler<EchoEventArgs> Echo
Managed Extensions for C++
public: __event EventHandler<EchoEventArgs*>* Echo
C++/CLI
public:
event EventHandler<EchoEventArgs^>^ Echo

Remarks

See the SynchronizingObject property for information on updating UI controls in your event handler.

See Also

Reference

Ping Class
Ping Members


PingSlave Class

[image]
PowerTCP Sockets for .NET
PingSlave Class
Members Example See Also Send comments on this topic
Dart.Sockets Namespace : PingSlave Class

Glossary Item Box

Used on each worker thread to provide a series of ICMP Echo (Ping) requests.

Object Model

PingSlave Class

Syntax

Visual Basic (Declaration)
Public Class PingSlave
Visual Basic (Usage) Copy Code
Dim instance As PingSlave
C#
public class PingSlave
Managed Extensions for C++
public __gc class PingSlave
C++/CLI
public ref class PingSlave

Example

The following example demonstrates pinging a remote host.
C# Copy Code
private void button1_Click(object sender, EventArgs e)
{
    ping1.Start(pingWorker, HostNameOrAddressToPingTextbox.Text);
}

private void pingWorker(PingSlave slave, object state)
{
    ping1.Marshal(slave.GetEchoes(new Dart.Sockets.IPEndPoint(state.ToString(), 0).Address, null, 20, 5000, false));
}

void ping1_Echo(object sender, EchoEventArgs e)
{
    string results = "The following echoes were returned:\r\n";
    for (int i = 0; i < e.Echoes.Length; i++)
        results += e.Echoes[i].ToString() + "\r\n";
    textBox1.AppendText(results);
}
Visual Basic Copy Code
Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs)
    ping1.Start(AddressOf pingWorker, HostNameOrAddressToPingTextbox.Text)
End Sub

Private Sub pingWorker(ByVal slave As PingSlave, ByVal state As Object)
    ping1.Marshal(slave.GetEchoes((New Dart.Sockets.IPEndPoint(state.ToString(), 0)).Address, Nothing, 20, 5000, False))
End Sub

Private Sub ping1_Echo(ByVal sender As Object, ByVal e As EchoEventArgs)
    Dim results As String = "The following echoes were returned:" & vbCrLf
    For i As Integer = 0 To e.Echoes.Length - 1
        results &= e.Echoes(i).ToString() & vbCrLf
    Next i
    textBox1.AppendText(results)
End Sub

Inheritance Hierarchy

System.Object
Dart.Sockets.PingSlave

See Also

Reference

PingSlave Members
Dart.Sockets Namespace


PingSlave Class Members

[image]
PowerTCP Sockets for .NET
PingSlave Class Members
See Also Methods Send comments on this topic
Dart.Sockets Namespace : PingSlave Class

Glossary Item Box

The following tables list the members exposed by PingSlave.

Public Constructors

 | Name | Description
Public Constructor | PingSlave Constructor | Creates an object that manages ICMP Echo requests.
Top

Public Methods

 | Name | Description
Public Method | GetEchoes | Send an ICMP Echo request and block until all responses are received.
Top

See Also

Reference

PingSlave Class
Dart.Sockets Namespace


PingSlave Constructor

[image]
PowerTCP Sockets for .NET
PingSlave Constructor
See Also Send comments on this topic
Dart.Sockets Namespace > PingSlave Class : PingSlave Constructor

localAddress
A IPAddress that establishes from which IP interface requests will originate.
type
Specifies what technology will be used to create the Echo request.

Glossary Item Box

Creates an object that manages ICMP Echo requests.

Syntax

Visual Basic (Declaration)
<SecuritySafeCriticalAttribute()>
Public Function New( _
   ByVal localAddress As IPAddress, _
   ByVal type As Ping.Type _
)
Visual Basic (Usage) Copy Code
Dim localAddress As IPAddress
Dim type As Ping.Type

Dim instance As New PingSlave(localAddress, type)
C#
[SecuritySafeCritical()]
public PingSlave(
   IPAddress localAddress,
   Ping.Type type
)
Managed Extensions for C++
[SecuritySafeCritical()]
public: PingSlave(
   IPAddress* localAddress,
   Ping.Type type
)
C++/CLI
[SecuritySafeCritical()]
public:
PingSlave(
   IPAddress^ localAddress,
   Ping.Type type
)

Parameters

localAddress
A IPAddress that establishes from which IP interface requests will originate.
type
Specifies what technology will be used to create the Echo request.

Remarks

The IPAddress.AddressFamily of the local EndPoint MUST match the AddressFamily of destination hosts.

See Also

Reference

PingSlave Class
PingSlave Members


PingSlave Class Methods

[image]
PowerTCP Sockets for .NET
PingSlave Class Methods
See Also Send comments on this topic
Dart.Sockets Namespace : PingSlave Class

Glossary Item Box

For a list of all members of this type, see PingSlave members.

Public Methods

 | Name | Description
Public Method | GetEchoes | Send an ICMP Echo request and block until all responses are received.
Top

See Also

Reference

PingSlave Class
Dart.Sockets Namespace


GetEchoes Method

[image]
PowerTCP Sockets for .NET
GetEchoes Method
See Also Example Send comments on this topic
Dart.Sockets Namespace > PingSlave Class : GetEchoes Method

address
The host where the Echo request is sent (can be a broadcast address).
data
The data to send in the Echo request. Can be null.
ttl
The maximum number of hops the request should take before expiring.
timeout
The number of milliseconds to wait for responses to arrive.
broadcast
If true, multiple socket receives will be used until the socket times out. If false, only one socket receive is used.

Glossary Item Box

Send an ICMP Echo request and block until all responses are received.

Syntax

Visual Basic (Declaration)
Public Function GetEchoes( _
   ByVal address As IPAddress, _
   ByVal data() As Byte, _
   ByVal ttl As Integer, _
   ByVal timeout As Integer, _
   ByVal broadcast As Boolean _
) As Echo()
Visual Basic (Usage) Copy Code
Dim instance As PingSlave
Dim address As IPAddress
Dim data() As Byte
Dim ttl As Integer
Dim timeout As Integer
Dim broadcast As Boolean
Dim value() As Echo

value = instance.GetEchoes(address, data, ttl, timeout, broadcast)
C#
public Echo[] GetEchoes(
   IPAddress address,
   byte[] data,
   int ttl,
   int timeout,
   bool broadcast
)
Managed Extensions for C++
public: Echo*[]* GetEchoes(
   IPAddress* address,
   byte[]* data,
   int ttl,
   int timeout,
   bool broadcast
)
C++/CLI
public:
array<Echo^>^ GetEchoes(
   IPAddress^ address,
   array<byte>^ data,
   int ttl,
   int timeout,
   bool broadcast
)

Parameters

address
The host where the Echo request is sent (can be a broadcast address).
data
The data to send in the Echo request. Can be null.
ttl
The maximum number of hops the request should take before expiring.
timeout
The number of milliseconds to wait for responses to arrive.
broadcast
If true, multiple socket receives will be used until the socket times out. If false, only one socket receive is used.

Return Value

One or more Echo responses.

Remarks

This method will block until it times out while performing a socket receive.

Ping broadcasting is supported when Type is set to Type.Raw. When set to Type.System, only the first responding system is returned.

Example

The following example demonstrates pinging a remote host.
C# Copy Code
private void button1_Click(object sender, EventArgs e)
{
    ping1.Start(pingWorker, HostNameOrAddressToPingTextbox.Text);
}

private void pingWorker(PingSlave slave, object state)
{
    ping1.Marshal(slave.GetEchoes(new Dart.Sockets.IPEndPoint(state.ToString(), 0).Address, null, 20, 5000, false));
}

void ping1_Echo(object sender, EchoEventArgs e)
{
    string results = "The following echoes were returned:\r\n";
    for (int i = 0; i < e.Echoes.Length; i++)
        results += e.Echoes[i].ToString() + "\r\n";
    textBox1.AppendText(results);
}
Visual Basic Copy Code
Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs)
    ping1.Start(AddressOf pingWorker, HostNameOrAddressToPingTextbox.Text)
End Sub

Private Sub pingWorker(ByVal slave As PingSlave, ByVal state As Object)
    ping1.Marshal(slave.GetEchoes((New Dart.Sockets.IPEndPoint(state.ToString(), 0)).Address, Nothing, 20, 5000, False))
End Sub

Private Sub ping1_Echo(ByVal sender As Object, ByVal e As EchoEventArgs)
    Dim results As String = "The following echoes were returned:" & vbCrLf
    For i As Integer = 0 To e.Echoes.Length - 1
        results &= e.Echoes(i).ToString() & vbCrLf
    Next i
    textBox1.AppendText(results)
End Sub

See Also

Reference

PingSlave Class
PingSlave Members


ProtocolException Class

[image]
PowerTCP Sockets for .NET
ProtocolException Class
Members See Also Send comments on this topic
Dart.Sockets Namespace : ProtocolException Class

Glossary Item Box

Thrown when an upper-layer protocol like FTP, SMTP or POP3 receives a negative response from the server.

Object Model

ProtocolException Class

Syntax

Visual Basic (Declaration)
<SerializableAttribute()>
Public Class ProtocolException
   Inherits System.ApplicationException
Visual Basic (Usage) Copy Code
Dim instance As ProtocolException
C#
[Serializable()]
public class ProtocolException : System.ApplicationException
Managed Extensions for C++
[Serializable()]
public __gc class ProtocolException : public System.ApplicationException
C++/CLI
[Serializable()]
public ref class ProtocolException : public System.ApplicationException

Remarks

This exception is thrown when a server response is negative. For example, if an FTP server returned a "500" respose (indicating a syntax error) to a sent command.

Inheritance Hierarchy

System.Object
System.Exception
System.ApplicationException
Dart.Sockets.ProtocolException

See Also

Reference

ProtocolException Members
Dart.Sockets Namespace


ProtocolException Class Members

[image]
PowerTCP Sockets for .NET
ProtocolException Class Members
See Also Properties Methods Events Send comments on this topic
Dart.Sockets Namespace : ProtocolException Class

Glossary Item Box

The following tables list the members exposed by ProtocolException.

Protected Constructors

 | Name | Description
Protected Constructor | ProtocolException Constructor | Initializes a new ProtocolException.
Top

Public Properties

 | Name | Description
Public Property | Data | Gets a collection of key/value pairs that provide additional user-defined information about the exception. (Inherited from System.Exception)
Public Property | HelpLink | Gets or sets a link to the help file associated with this exception. (Inherited from System.Exception)
Public Property | HResult | Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception. (Inherited from System.Exception)
Public Property | InnerException | Gets the System.Exception instance that caused the current exception. (Inherited from System.Exception)
Public Property | Message | Gets a message that describes the current exception. (Inherited from System.Exception)
Public Property | Source | Gets or sets the name of the application or the object that causes the error. (Inherited from System.Exception)
Public Property | StackTrace | Gets a string representation of the immediate frames on the call stack. (Inherited from System.Exception)
Public Property | TargetSite | Gets the method that throws the current exception. (Inherited from System.Exception)
Top

Public Methods

 | Name | Description
Public Method | GetBaseException | When overridden in a derived class, returns the System.Exception that is the root cause of one or more subsequent exceptions. (Inherited from System.Exception)
Public Method | GetObjectData | When overridden in a derived class, sets the System.Runtime.Serialization.SerializationInfo with information about the exception. (Inherited from System.Exception)
Public Method | GetType | Gets the runtime type of the current instance. (Inherited from System.Exception)
Public Method | ToString | Creates and returns a string representation of the current exception. (Inherited from System.Exception)
Top

Protected Events

 | Name | Description
Protected Event | SerializeObjectState | Occurs when an exception is serialized to create an exception state object that contains serialized data about the exception. (Inherited from System.Exception)
Top

See Also

Reference

ProtocolException Class
Dart.Sockets Namespace


ProtocolException Constructor

[image]
PowerTCP Sockets for .NET
ProtocolException Constructor
See Also Send comments on this topic
Dart.Sockets Namespace > ProtocolException Class : ProtocolException Constructor

info
context

Glossary Item Box

Initializes a new ProtocolException.

Syntax

Visual Basic (Declaration)
Protected Function New( _
   ByVal info As SerializationInfo, _
   ByVal context As StreamingContext _
)
Visual Basic (Usage) Copy Code
Dim info As SerializationInfo
Dim context As StreamingContext

Dim instance As New ProtocolException(info, context)
C#
protected ProtocolException(
   SerializationInfo info,
   StreamingContext context
)
Managed Extensions for C++
protected: ProtocolException(
   SerializationInfo* info,
   StreamingContext context
)
C++/CLI
protected:
ProtocolException(
   SerializationInfo^ info,
   StreamingContext context
)

Parameters

info
context

See Also

Reference

ProtocolException Class
ProtocolException Members


Proxy Class

[image]
PowerTCP Sockets for .NET
Proxy Class
Members See Also Send comments on this topic
Dart.Sockets Namespace : Proxy Class

Glossary Item Box

Describes the server proxy, if any, to connect to.

Object Model

Proxy ClassIPEndPoint Class

Syntax

Visual Basic (Declaration)
<SerializableAttribute()>
Public Class Proxy
Visual Basic (Usage) Copy Code
Dim instance As Proxy
C#
[Serializable()]
public class Proxy
Managed Extensions for C++
[Serializable()]
public __gc class Proxy
C++/CLI
[Serializable()]
public ref class Proxy

Inheritance Hierarchy

System.Object
Dart.Sockets.Proxy

See Also

Reference

Proxy Members
Dart.Sockets Namespace


Proxy Class Members

[image]
PowerTCP Sockets for .NET
Proxy Class Members
See Also Properties Send comments on this topic
Dart.Sockets Namespace : Proxy Class

Glossary Item Box

The following tables list the members exposed by Proxy.

Public Constructors

 | Name | Description
Public Constructor | Proxy Constructor | The default constructor for Proxy
Top

Public Properties

 | Name | Description
Public Property | Password | The password to send to the server proxy. Not used for Socks4.
Public Property | RemoteEndPoint | IPEndPoint of the server proxy to connect to.
Public Property | Type | The ProxyType desired.
Public Property | Username | The username to send to the server proxy.
Top

See Also

Reference

Proxy Class
Dart.Sockets Namespace


Proxy Constructor

[image]
PowerTCP Sockets for .NET
Proxy Constructor
See Also Send comments on this topic
Dart.Sockets Namespace > Proxy Class : Proxy Constructor

Glossary Item Box

The default constructor for Proxy

Syntax

Visual Basic (Declaration)
Public Function New()
Visual Basic (Usage) Copy Code
Dim instance As New Proxy()
C#
public Proxy()
Managed Extensions for C++
public: Proxy();
C++/CLI
public:
Proxy();

See Also

Reference

Proxy Class
Proxy Members


Proxy Class Properties

[image]
PowerTCP Sockets for .NET
Proxy Class Properties
See Also Send comments on this topic
Dart.Sockets Namespace : Proxy Class

Glossary Item Box

For a list of all members of this type, see Proxy members.

Public Properties

 | Name | Description
Public Property | Password | The password to send to the server proxy. Not used for Socks4.
Public Property | RemoteEndPoint | IPEndPoint of the server proxy to connect to.
Public Property | Type | The ProxyType desired.
Public Property | Username | The username to send to the server proxy.
Top

See Also

Reference

Proxy Class
Dart.Sockets Namespace


Password Property

[image]
PowerTCP Sockets for .NET
Password Property
See Also Send comments on this topic
Dart.Sockets Namespace > Proxy Class : Password Property

Glossary Item Box

The password to send to the server proxy. Not used for Socks4.

Syntax

Visual Basic (Declaration)
<DefaultValueAttribute()>
Public Property Password As String
Visual Basic (Usage) Copy Code
Dim instance As Proxy
Dim value As String

instance.Password = value

value = instance.Password
C#
[DefaultValue()]
public string Password {get; set;}
Managed Extensions for C++
[DefaultValue()]
public: __property string* get_Password();
public: __property void set_Password(
   string* value
);
C++/CLI
[DefaultValue()]
public:
property String^ Password {
   String^ get();
   void set (    String^ value);
}

See Also

Reference

Proxy Class
Proxy Members


RemoteEndPoint Property

[image]
PowerTCP Sockets for .NET
RemoteEndPoint Property
See Also Send comments on this topic
Dart.Sockets Namespace > Proxy Class : RemoteEndPoint Property

Glossary Item Box

IPEndPoint of the server proxy to connect to.

Syntax

Visual Basic (Declaration)
Public Property RemoteEndPoint As IPEndPoint
Visual Basic (Usage) Copy Code
Dim instance As Proxy
Dim value As IPEndPoint

instance.RemoteEndPoint = value

value = instance.RemoteEndPoint
C#
public IPEndPoint RemoteEndPoint {get; set;}
Managed Extensions for C++
public: __property IPEndPoint* get_RemoteEndPoint();
public: __property void set_RemoteEndPoint(
   IPEndPoint* value
);
C++/CLI
public:
property IPEndPoint^ RemoteEndPoint {
   IPEndPoint^ get();
   void set (    IPEndPoint^ value);
}

See Also

Reference

Proxy Class
Proxy Members


Type Property

[image]
PowerTCP Sockets for .NET
Type Property
See Also Send comments on this topic
Dart.Sockets Namespace > Proxy Class : Type Property

Glossary Item Box

The ProxyType desired.

Syntax

Visual Basic (Declaration)
<DefaultValueAttribute()>
Public Property Type As ProxyType
Visual Basic (Usage) Copy Code
Dim instance As Proxy
Dim value As ProxyType

instance.Type = value

value = instance.Type
C#
[DefaultValue()]
public ProxyType Type {get; set;}
Managed Extensions for C++
[DefaultValue()]
public: __property ProxyType get_Type();
public: __property void set_Type(
   ProxyType value
);
C++/CLI
[DefaultValue()]
public:
property ProxyType Type {
   ProxyType get();
   void set (    ProxyType value);
}

See Also

Reference

Proxy Class
Proxy Members


Username Property

[image]
PowerTCP Sockets for .NET
Username Property
See Also Send comments on this topic
Dart.Sockets Namespace > Proxy Class : Username Property

Glossary Item Box

The username to send to the server proxy.

Syntax

Visual Basic (Declaration)
<DefaultValueAttribute()>
Public Property Username As String
Visual Basic (Usage) Copy Code
Dim instance As Proxy
Dim value As String

instance.Username = value

value = instance.Username
C#
[DefaultValue()]
public string Username {get; set;}
Managed Extensions for C++
[DefaultValue()]
public: __property string* get_Username();
public: __property void set_Username(
   string* value
);
C++/CLI
[DefaultValue()]
public:
property String^ Username {
   String^ get();
   void set (    String^ value);
}

See Also

Reference

Proxy Class
Proxy Members


PtyBase Class

[image]
PowerTCP Sockets for .NET
PtyBase Class
Members See Also Send comments on this topic
Dart.Sockets Namespace : PtyBase Class

Glossary Item Box

This class provides support for interactive on-line terminal access using controls derived from TextBoxBase.

Object Model

PtyBase ClassTcpSocketOption Class

Syntax

Visual Basic (Declaration)
Public Class PtyBase
   Inherits TcpBase
Visual Basic (Usage) Copy Code
Dim instance As PtyBase
C#
public class PtyBase : TcpBase
Managed Extensions for C++
public __gc class PtyBase : public TcpBase
C++/CLI
public ref class PtyBase : public TcpBase

Inheritance Hierarchy

System.Object
System.MarshalByRefObject
System.ComponentModel.Component
Dart.Sockets.ComponentBase
Dart.Sockets.SocketBase
Dart.Sockets.TcpBase
Dart.Sockets.PtyBase
Dart.Sockets.Tcp

See Also

Reference

PtyBase Members
Dart.Sockets Namespace


PtyBase Class Members

[image]
PowerTCP Sockets for .NET
PtyBase Class Members
See Also Properties Methods Events Send comments on this topic
Dart.Sockets Namespace : PtyBase Class

Glossary Item Box

The following tables list the members exposed by PtyBase.

Public Properties

 | Name | Description
Public Property | CloseTime | Returns the DateTime the connection was closed. (Inherited from Dart.Sockets.TcpBase)
Public Property | ConnectTime | Returns the DateTime the connection was established. (Inherited from Dart.Sockets.TcpBase)
Public Property | Container | (Inherited from System.ComponentModel.Component)
Public Property | CRLF | Set to true if the Pty property is used and a CR should be converted to a CRLF for sending.
Public Property | Encoding | Character encoding used by the component. (Inherited from Dart.Sockets.ComponentBase)
Public Property | LocalEcho | Set to true if the Pty property is used and keystrokes should be displayed in the textbox.
Public Property | NetworkStream | Returns the NetworkStream object created when Connect() is called. (Inherited from Dart.Sockets.TcpBase)
Public Property | Pty | Gets or sets a display control to use for automatic pseudo terminal support.
Public Property | RemoteEndPoint | Gets the remote address and port of the connection. (Inherited from Dart.Sockets.TcpBase)
Public Property | Site | (Inherited from System.ComponentModel.Component)
Public Property | Socket | Gets the socket used by the component for communications. (Inherited from Dart.Sockets.SocketBase)
Public Property | SocketOption | Gets and sets the socket options for classes derived from TcpBase. (Inherited from Dart.Sockets.TcpBase)
Public Property | SslStream | Returns the SslStream object created when AuthenticateAsClient or AuthenticateAsServer are called. (Inherited from Dart.Sockets.TcpBase)
Public Property | State | Gets the status of the connection as of the last socket operation. (Inherited from Dart.Sockets.TcpBase)
Public Property | SynchronizingObject | Gets or sets the object used to marshal data to the UI thread (for raising events). (Inherited from Dart.Sockets.ComponentBase)
Public Property | SyncRoot | Gets an object that is used to synchronize access to the upper layer protocol in use. (Inherited from Dart.Sockets.ComponentBase)
Public Property | Tag | Gets or sets an object that stores any user data. (Inherited from Dart.Sockets.ComponentBase)
Top

Protected Properties

 | Name | Description
Protected Property | CanRaiseEvents | (Inherited from System.ComponentModel.Component)
Protected Property | DesignMode | (Inherited from System.ComponentModel.Component)
Protected Property | Events | (Inherited from System.ComponentModel.Component)
Top

Public Methods

 | Name | Description
Public Method | Abort | Performs a hard close of the connection. (Inherited from Dart.Sockets.TcpBase)
Public Method | AuthenticateAsClient | Overloaded. Authenticates the server when establishing a secure connection. (Inherited from Dart.Sockets.TcpBase)
Public Method | AuthenticateAsServer | Authenticates a client when establishing a secure connection. (Inherited from Dart.Sockets.TcpBase)
Public Method | Close | Gracefully closes the connection. (Inherited from Dart.Sockets.TcpBase)
Public Method | Connect | Connect to a server using the configuration specified by session. (Inherited from Dart.Sockets.TcpBase)
Public Method | ConnectAsync | Connect to a server using the configuration specified by session. (Inherited from Dart.Sockets.TcpBase)
Public Method | CreateObjRef | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from System.MarshalByRefObject)
Public Method | Deserialize | Deserialize a previously serialized object. (Inherited from Dart.Sockets.ComponentBase)
Public Method | Dispose | Overloaded. Disposes of TcpBase and its associated resources. (Inherited from Dart.Sockets.TcpBase)
Public Method | GetLifetimeService | Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | GetStream | Provides access to the underlying Stream. (Inherited from Dart.Sockets.TcpBase)
Public Method | InitializeLifetimeService | Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | Marshal | Overloaded. Marshals data to the UI thread. (Inherited from Dart.Sockets.TcpBase)
Public Method | Read | Overloaded. Receives data from the remote host. (Inherited from Dart.Sockets.TcpBase)
Public Method | ReadAsync | Start an asynchronous read on the socket. (Inherited from Dart.Sockets.TcpBase)
Public Method | ReadToCount | Read until count bytes are read, an exception is thrown, or the connection is closed. (Inherited from Dart.Sockets.TcpBase)
Public Method | ReadToDelimiter | Overloaded. Read until the delimiter is found, an exception is thrown, or the connection is closed. (Inherited from Dart.Sockets.TcpBase)
Public Method | ReadToEnd | Read until the connection is closed or an exception is thrown. (Inherited from Dart.Sockets.TcpBase)
Public Method | Serialize | Serialize an object to the provided destination stream. (Inherited from Dart.Sockets.ComponentBase)
Public Method | ShutdownSsl | Signals the remote host to shutdown the SSL connection. (Inherited from Dart.Sockets.TcpBase)
Public Method | ToString | (Inherited from System.ComponentModel.Component)
Public Method | Write | Overloaded. Sends data to the remote host. (Inherited from Dart.Sockets.TcpBase)
Public Method | WriteAsync | Start an asynchronous write on the socket. (Inherited from Dart.Sockets.TcpBase)
Top

Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from System.ComponentModel.Component)
Protected Method | GetService | (Inherited from System.ComponentModel.Component)
Protected Method | MemberwiseClone | Overloaded. Creates a shallow copy of the current System.MarshalByRefObject object. (Inherited from System.MarshalByRefObject)
Protected Method | OnData | Raises the TcpBase.Data event. (Inherited from Dart.Sockets.TcpBase)
Protected Method | OnError | Raises the Error event. (Inherited from Dart.Sockets.ComponentBase)
Protected Method | OnLog | Raises the TcpBase.Log event. (Inherited from Dart.Sockets.TcpBase)
Protected Method | OnStateChanged | Raises the TcpBase.StateChanged event. (Inherited from Dart.Sockets.TcpBase)
Protected Method | OnUserState | Raises the UserState event. (Inherited from Dart.Sockets.ComponentBase)
Top

Public Events

 | Name | Description
Public Event | Data | Raised when TcpBase.Marshal is used. (Inherited from Dart.Sockets.TcpBase)
Public Event | Disposed | (Inherited from System.ComponentModel.Component)
Public Event | Error | Raised when Marshal(Exception) is used or an unhandled Exception is thrown in a worker thread created using Start. (Inherited from Dart.Sockets.ComponentBase)
Public Event | Log | Raised when data is read or written. (Inherited from Dart.Sockets.TcpBase)
Public Event | StateChanged | Raised when the value of the State property changes. (Inherited from Dart.Sockets.TcpBase)
Public Event | UserState | Raised when Marshal(String,Object) is used. (Inherited from Dart.Sockets.ComponentBase)
Top

See Also

Reference

PtyBase Class
Dart.Sockets Namespace


PtyBase Class Properties

[image]
PowerTCP Sockets for .NET
PtyBase Class Properties
See Also Send comments on this topic
Dart.Sockets Namespace : PtyBase Class

Glossary Item Box

For a list of all members of this type, see PtyBase members.

Public Properties

 | Name | Description
Public Property | CloseTime | Returns the DateTime the connection was closed. (Inherited from Dart.Sockets.TcpBase)
Public Property | ConnectTime | Returns the DateTime the connection was established. (Inherited from Dart.Sockets.TcpBase)
Public Property | Container | (Inherited from System.ComponentModel.Component)
Public Property | CRLF | Set to true if the Pty property is used and a CR should be converted to a CRLF for sending.
Public Property | Encoding | Character encoding used by the component. (Inherited from Dart.Sockets.ComponentBase)
Public Property | LocalEcho | Set to true if the Pty property is used and keystrokes should be displayed in the textbox.
Public Property | NetworkStream | Returns the NetworkStream object created when Connect() is called. (Inherited from Dart.Sockets.TcpBase)
Public Property | Pty | Gets or sets a display control to use for automatic pseudo terminal support.
Public Property | RemoteEndPoint | Gets the remote address and port of the connection. (Inherited from Dart.Sockets.TcpBase)
Public Property | Site | (Inherited from System.ComponentModel.Component)
Public Property | Socket | Gets the socket used by the component for communications. (Inherited from Dart.Sockets.SocketBase)
Public Property | SocketOption | Gets and sets the socket options for classes derived from TcpBase. (Inherited from Dart.Sockets.TcpBase)
Public Property | SslStream | Returns the SslStream object created when AuthenticateAsClient or AuthenticateAsServer are called. (Inherited from Dart.Sockets.TcpBase)
Public Property | State | Gets the status of the connection as of the last socket operation. (Inherited from Dart.Sockets.TcpBase)
Public Property | SynchronizingObject | Gets or sets the object used to marshal data to the UI thread (for raising events). (Inherited from Dart.Sockets.ComponentBase)
Public Property | SyncRoot | Gets an object that is used to synchronize access to the upper layer protocol in use. (Inherited from Dart.Sockets.ComponentBase)
Public Property | Tag | Gets or sets an object that stores any user data. (Inherited from Dart.Sockets.ComponentBase)
Top

Protected Properties

 | Name | Description
Protected Property | CanRaiseEvents | (Inherited from System.ComponentModel.Component)
Protected Property | DesignMode | (Inherited from System.ComponentModel.Component)
Protected Property | Events | (Inherited from System.ComponentModel.Component)
Top

See Also

Reference

PtyBase Class
Dart.Sockets Namespace


CRLF Property

[image]
PowerTCP Sockets for .NET
CRLF Property
See Also Send comments on this topic
Dart.Sockets Namespace > PtyBase Class : CRLF Property

Glossary Item Box

Set to true if the Pty property is used and a CR should be converted to a CRLF for sending.

Syntax

Visual Basic (Declaration)
<DefaultValueAttribute()>
Public Property CRLF As Boolean
Visual Basic (Usage) Copy Code
Dim instance As PtyBase
Dim value As Boolean

instance.CRLF = value

value = instance.CRLF
C#
[DefaultValue()]
public bool CRLF {get; set;}
Managed Extensions for C++
[DefaultValue()]
public: __property bool get_CRLF();
public: __property void set_CRLF(
   bool value
);
C++/CLI
[DefaultValue()]
public:
property bool CRLF {
   bool get();
   void set (    bool value);
}

Remarks

This property controls the behavior of the TextBox assigned to the Pty property. For example, the Echo protocol echoes back any sent character. Since as textbox requires a CRLF, set this property to true so that a CRLF will be generated when the return key is pressed. Defaults to false.

See Also

Reference

PtyBase Class
PtyBase Members


LocalEcho Property

[image]
PowerTCP Sockets for .NET
LocalEcho Property
See Also Send comments on this topic
Dart.Sockets Namespace > PtyBase Class : LocalEcho Property

Glossary Item Box

Set to true if the Pty property is used and keystrokes should be displayed in the textbox.

Syntax

Visual Basic (Declaration)
<DefaultValueAttribute()>
Public Property LocalEcho As Boolean
Visual Basic (Usage) Copy Code
Dim instance As PtyBase
Dim value As Boolean

instance.LocalEcho = value

value = instance.LocalEcho
C#
[DefaultValue()]
public bool LocalEcho {get; set;}
Managed Extensions for C++
[DefaultValue()]
public: __property bool get_LocalEcho();
public: __property void set_LocalEcho(
   bool value
);
C++/CLI
[DefaultValue()]
public:
property bool LocalEcho {
   bool get();
   void set (    bool value);
}

Remarks

This property controls the behavior of the TextBox assigned to the Pty property. For example, the Pop protocol does not echo sent characters to the screen. Set this property to true to see the characters being sent to the Pop server. Defaults to false.

See Also

Reference

PtyBase Class
PtyBase Members


Pty Property

[image]
PowerTCP Sockets for .NET
Pty Property
See Also Send comments on this topic
Dart.Sockets Namespace > PtyBase Class : Pty Property

Glossary Item Box

Gets or sets a display control to use for automatic pseudo terminal support.

Syntax

Visual Basic (Declaration)
<DefaultValueAttribute()>
Public Property Pty As TextBoxBase
Visual Basic (Usage) Copy Code
Dim instance As PtyBase
Dim value As TextBoxBase

instance.Pty = value

value = instance.Pty
C#
[DefaultValue()]
public TextBoxBase Pty {get; set;}
Managed Extensions for C++
[DefaultValue()]
public: __property TextBoxBase* get_Pty();
public: __property void set_Pty(
   TextBoxBase* value
);
C++/CLI
[DefaultValue()]
public:
property TextBoxBase^ Pty {
   TextBoxBase^ get();
   void set (    TextBoxBase^ value);
}

Remarks

Set this property to a control derived from TextBoxBase and call Connect to start an online session. Data received from the host will be displayed, and keyboard input will automatically be sent to the remote host.

The Multiline property on the Pty control is set to true. You may wish to set the Font property to a fixed-width font and set the Wordwrap property to false. Also, if the SynchronizingObject is null, it will be set to the Pty control.

These properties can be changed from their default values after this property is set.

See Also

Reference

PtyBase Class
PtyBase Members


Security Class

[image]
PowerTCP Sockets for .NET
Security Class
Members See Also Send comments on this topic
Dart.Sockets Namespace : Security Class

Glossary Item Box

Holds the configuration used to establish an SSL session.

Object Model

Security Class

Syntax

Visual Basic (Declaration)
<SerializableAttribute()>
Public Class Security
Visual Basic (Usage) Copy Code
Dim instance As Security
C#
[Serializable()]
public class Security
Managed Extensions for C++
[Serializable()]
public __gc class Security
C++/CLI
[Serializable()]
public ref class Security

Inheritance Hierarchy

System.Object
Dart.Sockets.Security
Dart.Sockets.ClientSecurity
Dart.Sockets.ServerSecurity

See Also

Reference

Security Members
Dart.Sockets Namespace


Security Class Members

[image]
PowerTCP Sockets for .NET
Security Class Members
See Also Fields Properties Send comments on this topic
Dart.Sockets Namespace : Security Class

Glossary Item Box

The following tables list the members exposed by Security.

Public Constructors

 | Name | Description
Public Constructor | Security Constructor | The default constructor for Security
Top

Public Fields

 | Name | Description
Public Field | ValidationCallback | The delegate that executes after the server provides its certificate to the client.
Top

Public Properties

 | Name | Description
Public Property | CheckCertificateRevocation | Indicates whether the certificate revocation list is checked during authentication.
Public Property | Protocols | Gets or sets the SSLProtocols available.
Top

See Also

Reference

Security Class
Dart.Sockets Namespace


Security Constructor

[image]
PowerTCP Sockets for .NET
Security Constructor
See Also Send comments on this topic
Dart.Sockets Namespace > Security Class : Security Constructor

Glossary Item Box

The default constructor for Security

Syntax

Visual Basic (Declaration)
Public Function New()
Visual Basic (Usage) Copy Code
Dim instance As New Security()
C#
public Security()
Managed Extensions for C++
public: Security();
C++/CLI
public:
Security();

See Also

Reference

Security Class
Security Members


Security Class Properties

[image]
PowerTCP Sockets for .NET
Security Class Properties
See Also Send comments on this topic
Dart.Sockets Namespace : Security Class

Glossary Item Box

For a list of all members of this type, see Security members.

Public Properties

 | Name | Description
Public Property | CheckCertificateRevocation | Indicates whether the certificate revocation list is checked during authentication.
Public Property | Protocols | Gets or sets the SSLProtocols available.
Top

See Also

Reference

Security Class
Dart.Sockets Namespace


CheckCertificateRevocation Property

[image]
PowerTCP Sockets for .NET
CheckCertificateRevocation Property
See Also Send comments on this topic
Dart.Sockets Namespace > Security Class : CheckCertificateRevocation Property

Glossary Item Box

Indicates whether the certificate revocation list is checked during authentication.

Syntax

Visual Basic (Declaration)
<DefaultValueAttribute()>
Public Property CheckCertificateRevocation As Boolean
Visual Basic (Usage) Copy Code
Dim instance As Security
Dim value As Boolean

instance.CheckCertificateRevocation = value

value = instance.CheckCertificateRevocation
C#
[DefaultValue()]
public bool CheckCertificateRevocation {get; set;}
Managed Extensions for C++
[DefaultValue()]
public: __property bool get_CheckCertificateRevocation();
public: __property void set_CheckCertificateRevocation(
   bool value
);
C++/CLI
[DefaultValue()]
public:
property bool CheckCertificateRevocation {
   bool get();
   void set (    bool value);
}

See Also

Reference

Security Class
Security Members


Protocols Property

[image]
PowerTCP Sockets for .NET
Protocols Property
See Also Send comments on this topic
Dart.Sockets Namespace > Security Class : Protocols Property

Glossary Item Box

Gets or sets the SSLProtocols available.

Syntax

Visual Basic (Declaration)
<DefaultValueAttribute()>
Public Property Protocols As SslProtocols
Visual Basic (Usage) Copy Code
Dim instance As Security
Dim value As SslProtocols

instance.Protocols = value

value = instance.Protocols
C#
[DefaultValue()]
public SslProtocols Protocols {get; set;}
Managed Extensions for C++
[DefaultValue()]
public: __property SslProtocols get_Protocols();
public: __property void set_Protocols(
   SslProtocols value
);
C++/CLI
[DefaultValue()]
public:
property SslProtocols Protocols {
   SslProtocols get();
   void set (    SslProtocols value);
}

See Also

Reference

Security Class
Security Members


Security Class Fields

[image]
PowerTCP Sockets for .NET
Security Class Fields
See Also Send comments on this topic
Dart.Sockets Namespace : Security Class

Glossary Item Box

For a list of all members of this type, see Security members.

Public Fields

 | Name | Description
Public Field | ValidationCallback | The delegate that executes after the server provides its certificate to the client.
Top

See Also

Reference

Security Class
Dart.Sockets Namespace


ValidationCallback Field

[image]
PowerTCP Sockets for .NET
ValidationCallback Field
See Also Send comments on this topic
Dart.Sockets Namespace > Security Class : ValidationCallback Field

Glossary Item Box

The delegate that executes after the server provides its certificate to the client.

Syntax

Visual Basic (Declaration)
Public ValidationCallback As RemoteCertificateValidationCallback
Visual Basic (Usage) Copy Code
Dim instance As Security
Dim value As RemoteCertificateValidationCallback

value = instance.ValidationCallback

instance.ValidationCallback = value
C#
public RemoteCertificateValidationCallback ValidationCallback
Managed Extensions for C++
public: RemoteCertificateValidationCallback* ValidationCallback
C++/CLI
public:
RemoteCertificateValidationCallback^ ValidationCallback

See Also

Reference

Security Class
Security Members


Segment Class

[image]
PowerTCP Sockets for .NET
Segment Class
Members See Also Send comments on this topic
Dart.Sockets Namespace : Segment Class

Glossary Item Box

Used to describe a byte[] segment that holds data.

Object Model

Segment Class

Syntax

Visual Basic (Declaration)
Public Class Segment
Visual Basic (Usage) Copy Code
Dim instance As Segment
C#
public class Segment
Managed Extensions for C++
public __gc class Segment
C++/CLI
public ref class Segment

Inheritance Hierarchy

System.Object
Dart.Sockets.Segment
Dart.Sockets.Data

See Also

Reference

Segment Members
Dart.Sockets Namespace


Segment Class Members

[image]
PowerTCP Sockets for .NET
Segment Class Members
See Also Properties Send comments on this topic
Dart.Sockets Namespace : Segment Class

Glossary Item Box

The following tables list the members exposed by Segment.

Public Constructors

 | Name | Description
Public Constructor | Segment Constructor | Used to create a Segment object that holds a buffer of data.
Top

Public Properties

 | Name | Description
Public Property | Buffer | Gets the buffer that holds data.
Public Property | Count | Byte count of data.
Public Property | Offset | The offset into the buffer where the data starts.
Top

See Also

Reference

Segment Class
Dart.Sockets Namespace


Segment Constructor

[image]
PowerTCP Sockets for .NET
Segment Constructor
See Also Send comments on this topic
Dart.Sockets Namespace > Segment Class : Segment Constructor

buffer
Byte[] containing data.
offset
Offset into the buffer where the data starts.
count
Byte count of data.

Glossary Item Box

Used to create a Segment object that holds a buffer of data.

Syntax

Visual Basic (Declaration)
Public Function New( _
   ByVal buffer() As Byte, _
   ByVal offset As Integer, _
   ByVal count As Integer _
)
Visual Basic (Usage) Copy Code
Dim buffer() As Byte
Dim offset As Integer
Dim count As Integer

Dim instance As New Segment(buffer, offset, count)
C#
public Segment(
   byte[] buffer,
   int offset,
   int count
)
Managed Extensions for C++
public: Segment(
   byte[]* buffer,
   int offset,
   int count
)
C++/CLI
public:
Segment(
   array<byte>^ buffer,
   int offset,
   int count
)

Parameters

buffer
Byte[] containing data.
offset
Offset into the buffer where the data starts.
count
Byte count of data.

See Also

Reference

Segment Class
Segment Members


Segment Class Properties

[image]
PowerTCP Sockets for .NET
Segment Class Properties
See Also Send comments on this topic
Dart.Sockets Namespace : Segment Class

Glossary Item Box

For a list of all members of this type, see Segment members.

Public Properties

 | Name | Description
Public Property | Buffer | Gets the buffer that holds data.
Public Property | Count | Byte count of data.
Public Property | Offset | The offset into the buffer where the data starts.
Top

See Also

Reference

Segment Class
Dart.Sockets Namespace


Buffer Property

[image]
PowerTCP Sockets for .NET
Buffer Property
See Also Send comments on this topic
Dart.Sockets Namespace > Segment Class : Buffer Property

Glossary Item Box

Gets the buffer that holds data.

Syntax

Visual Basic (Declaration)
Public ReadOnly Property Buffer As Byte()
Visual Basic (Usage) Copy Code
Dim instance As Segment
Dim value() As Byte

value = instance.Buffer
C#
public byte[] Buffer {get;}
Managed Extensions for C++
public: __property byte[]* get_Buffer();
C++/CLI
public:
property array<byte>^ Buffer {
   array<byte>^ get();
}

See Also

Reference

Segment Class
Segment Members


Count Property

[image]
PowerTCP Sockets for .NET
Count Property
See Also Send comments on this topic
Dart.Sockets Namespace > Segment Class : Count Property

Glossary Item Box

Byte count of data.

Syntax

Visual Basic (Declaration)
Public ReadOnly Property Count As Integer
Visual Basic (Usage) Copy Code
Dim instance As Segment
Dim value As Integer

value = instance.Count
C#
public int Count {get;}
Managed Extensions for C++
public: __property int get_Count();
C++/CLI
public:
property int Count {
   int get();
}

See Also

Reference

Segment Class
Segment Members


Offset Property

[image]
PowerTCP Sockets for .NET
Offset Property
See Also Send comments on this topic
Dart.Sockets Namespace > Segment Class : Offset Property

Glossary Item Box

The offset into the buffer where the data starts.

Syntax

Visual Basic (Declaration)
Public ReadOnly Property Offset As Integer
Visual Basic (Usage) Copy Code
Dim instance As Segment
Dim value As Integer

value = instance.Offset
C#
public int Offset {get;}
Managed Extensions for C++
public: __property int get_Offset();
C++/CLI
public:
property int Offset {
   int get();
}

See Also

Reference

Segment Class
Segment Members


Server Class

[image]
PowerTCP Sockets for .NET
Server Class
Members Example See Also Send comments on this topic
Dart.Sockets Namespace : Server Class

Glossary Item Box

The Server component provides a framework for building non-secure and secure server applications.

Object Model

Server Class

Syntax

Visual Basic (Declaration)
Public Class Server
   Inherits SocketBase
Visual Basic (Usage) Copy Code
Dim instance As Server
C#
public class Server : SocketBase
Managed Extensions for C++
public __gc class Server : public SocketBase
C++/CLI
public ref class Server : public SocketBase

Remarks

Use the Server component to listen for incoming connections. When a connection is established from a TCP client, a new thread is created on which the server and client communicate.

What follows are short usage descriptions. For more information, see the appropriate member topic.

Using the Server Component

Listening for connections: Use Server.Start (specifying the port to listen on) to listen for incoming TCP connections.

Determining if the server is active: The Socket property is non-null when the server is active.

Handling incoming connections: When a TCP client connects to the server, a user-specified delegate is raised. A Tcp object is provided to the delegate, representing the client/server connection. Use the Tcp object to send and receive data to/from the connected client (both synchronous and asynchronous operation is supported). To facilitate memory release, dispose of the object and call GC.Collect when the connection is terminated.

Stop accepting incoming connections: Use Close to stop accepting incoming connections. Any existing connections will complete normally.

Stop the server and close all connections: Use Abort.

Communicating securely: Call TcpBase.AuthenticateAsServer for each incoming connection.

Example

The following example demonstrates an echo server using asynchronous read and write methods that utilize IO completion ports. The following example demonstrates an echo server on a single thread.
C# Copy Code
private void button1_Click(object sender, EventArgs e)
{
    //Start the echo server on port 7
    server1.Start(server1_NewConnection, 7, null);
}

private void server1_NewConnection(Tcp client, object state)
{
    //Read first data sent by client
    byte[] buffer = new byte[1024];
    client.ReadAsync(buffer, 0, buffer.Length, client_ReadAsyncCompleted, null);
}

private void client_ReadAsyncCompleted(TcpBase client, Data data, Exception ex, object state)
{
    //Echo data received back to client.
    //Data is null if client is not connected.
    if (data != null)
        client.WriteAsync(data.Buffer, data.Offset, data.Count, client_WriteAsyncCompleted, null);
}

private void client_WriteAsyncCompleted(TcpBase client, Data data, Exception ex, object state)
{
    //Read for more data.
    client.ReadAsync(data.Buffer, 0, data.Buffer.Length, client_ReadAsyncCompleted, null);
}
Visual Basic Copy Code
Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs)
    'Start the echo server on port 7
    server1.Start(AddressOf server1_NewConnection, 7, Nothing)
End Sub

Private Sub server1_NewConnection(ByVal client As Tcp, ByVal state As Object)
    'Read first data sent by client
    Dim buffer(1023) As Byte
    client.ReadAsync(buffer, 0, buffer.Length, AddressOf client_ReadAsyncCompleted, Nothing)
End Sub

Private Sub client_ReadAsyncCompleted(ByVal client As TcpBase, ByVal data As Data, ByVal ex As Exception, ByVal state As Object)
    'Echo data received back to client.
    'Data is null if client is not connected.
    If data IsNot Nothing Then
        client.WriteAsync(data.Buffer, data.Offset, data.Count, AddressOf client_WriteAsyncCompleted, Nothing)
    End If
End Sub

Private Sub client_WriteAsyncCompleted(ByVal client As TcpBase, ByVal data As Data, ByVal ex As Exception, ByVal state As Object)
    'Read for more data.
    client.ReadAsync(data.Buffer, 0, data.Buffer.Length, AddressOf client_ReadAsyncCompleted, Nothing)
End Sub
C# Copy Code
private void button1_Click(object sender, EventArgs e)
{
    //Start the echo server on port 7
    server1.Start(server1_NewConnection, 7, null);
}

private void server1_NewConnection(Tcp client, object state)
{
    //While connection is open, read and echo data back to client
    byte[] buffer = new byte[1024];
    Data data = client.Read(buffer);
    while (data != null)
    {
        client.Write(data.Buffer, data.Offset, data.Count);
        data = client.Read(buffer);
    }
}
Visual Basic Copy Code
Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs)
    'Start the echo server on port 7
    server1.Start(AddressOf server1_NewConnection, 7, Nothing)
End Sub

Private Sub server1_NewConnection(ByVal client As Tcp, ByVal state As Object)
    'While connection is open, read and echo data back to client
    Dim buffer(1023) As Byte
    Dim data As Data = client.Read(buffer)
    Do While data IsNot Nothing
        client.Write(data.Buffer, data.Offset, data.Count)
        data = client.Read(buffer)
    Loop
End Sub

Inheritance Hierarchy

System.Object
System.MarshalByRefObject
System.ComponentModel.Component
Dart.Sockets.ComponentBase
Dart.Sockets.SocketBase
Dart.Sockets.Server

See Also

Reference

Server Members
Dart.Sockets Namespace


Server Class Members

[image]
PowerTCP Sockets for .NET
Server Class Members
See Also Fields Properties Methods Events Send comments on this topic
Dart.Sockets Namespace : Server Class

Glossary Item Box

The following tables list the members exposed by Server.

Public Constructors

 | Name | Description
Public Constructor | Server Constructor | Overloaded.
Top

Public Fields

 | Name | Description
Public Field | Connections | Returns a List of Tcp objects representing active connections.
Top

Public Properties

 | Name | Description
Public Property | Backlog | The maximum length of the pending connections queue.
Public Property | Container | (Inherited from System.ComponentModel.Component)
Public Property | Encoding | Character encoding used by the component. (Inherited from Dart.Sockets.ComponentBase)
Public Property | Site | (Inherited from System.ComponentModel.Component)
Public Property | Socket | Gets the socket used by the component for communications. (Inherited from Dart.Sockets.SocketBase)
Public Property | SynchronizingObject | Gets or sets the object used to marshal data to the UI thread (for raising events). (Inherited from Dart.Sockets.ComponentBase)
Public Property | SyncRoot | Gets an object that is used to synchronize access to the upper layer protocol in use. (Inherited from Dart.Sockets.ComponentBase)
Public Property | Tag | Gets or sets an object that stores any user data. (Inherited from Dart.Sockets.ComponentBase)
Top

Protected Properties

 | Name | Description
Protected Property | CanRaiseEvents | (Inherited from System.ComponentModel.Component)
Protected Property | DesignMode | (Inherited from System.ComponentModel.Component)
Protected Property | Events | (Inherited from System.ComponentModel.Component)
Top

Public Methods

 | Name | Description
Public Method | Abort | Closes the listening socket and calls Close() on each active connection.
Public Method | Close | Closes the listening socket and allows each active connection to complete normally.
Public Method | CreateObjRef | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from System.MarshalByRefObject)
Public Method | Deserialize | Deserialize a previously serialized object. (Inherited from Dart.Sockets.ComponentBase)
Public Method | Dispose | Overloaded. Overridden. Releases all resources associated with the object.
Public Method | GetLifetimeService | Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | InitializeLifetimeService | Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | Marshal | Overloaded. Marshals a string and/or object to the UI thread and raises the UserState event. (Inherited from Dart.Sockets.ComponentBase)
Public Method | Serialize | Serialize an object to the provided destination stream. (Inherited from Dart.Sockets.ComponentBase)
Public Method | Start | Overloaded. Begin listening on the specified port on all IPv4 network interfaces.
Public Method | ToString | (Inherited from System.ComponentModel.Component)
Top

Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from System.ComponentModel.Component)
Protected Method | GetService | (Inherited from System.ComponentModel.Component)
Protected Method | MemberwiseClone | Overloaded. Creates a shallow copy of the current System.MarshalByRefObject object. (Inherited from System.MarshalByRefObject)
Protected Method | OnConnectionsChanged | Raises the ConnectionsChanged event.
Protected Method | OnError | Raises the Error event. (Inherited from Dart.Sockets.ComponentBase)
Protected Method | OnUserState | Raises the UserState event. (Inherited from Dart.Sockets.ComponentBase)
Top

Public Events

 | Name | Description
Public Event | ConnectionsChanged | Raised after the Connections list has changed.
Public Event | Disposed | (Inherited from System.ComponentModel.Component)
Public Event | Error | Raised when Marshal(Exception) is used or an unhandled Exception is thrown in a worker thread created using Start. (Inherited from Dart.Sockets.ComponentBase)
Public Event | UserState | Raised when Marshal(String,Object) is used. (Inherited from Dart.Sockets.ComponentBase)
Top

See Also

Reference

Server Class
Dart.Sockets Namespace


Server Constructor

[image]
PowerTCP Sockets for .NET
Server Constructor
See Also Send comments on this topic
Dart.Sockets Namespace > Server Class : Server Constructor

Glossary Item Box

Overload List

Overload | Description
Server Constructor(IContainer) | Initializes a new Server object.
Server Constructor() | Initializes a new Server.

See Also

Reference

Server Class
Server Members


Server Constructor(IContainer)

[image]
PowerTCP Sockets for .NET
Server Constructor(IContainer)
See Also Send comments on this topic
Dart.Sockets Namespace > Server Class > Server Constructor : Server Constructor(IContainer)

container
The IContainer which contains the object.

Glossary Item Box

Initializes a new Server object.

Syntax

Visual Basic (Declaration)
Public Function New( _
   ByVal container As IContainer _
)
Visual Basic (Usage) Copy Code
Dim container As IContainer

Dim instance As New Server(container)
C#
public Server(
   IContainer container
)
Managed Extensions for C++
public: Server(
   IContainer* container
)
C++/CLI
public:
Server(
   IContainer^ container
)

Parameters

container
The IContainer which contains the object.

See Also

Reference

Server Class
Server Members
Overload List


Server Constructor()

[image]
PowerTCP Sockets for .NET
Server Constructor()
See Also Send comments on this topic
Dart.Sockets Namespace > Server Class > Server Constructor : Server Constructor()

Glossary Item Box

Initializes a new Server.

Syntax

Visual Basic (Declaration)
Public Function New()
Visual Basic (Usage) Copy Code
Dim instance As New Server()
C#
public Server()
Managed Extensions for C++
public: Server();
C++/CLI
public:
Server();

Remarks

The default constructor dynamically initializes a new Server class.

See Also

Reference

Server Class
Server Members
Overload List


Server Class Methods

[image]
PowerTCP Sockets for .NET
Server Class Methods
See Also Send comments on this topic
Dart.Sockets Namespace : Server Class

Glossary Item Box

For a list of all members of this type, see Server members.

Public Methods

 | Name | Description
Public Method | Abort | Closes the listening socket and calls Close() on each active connection.
Public Method | Close | Closes the listening socket and allows each active connection to complete normally.
Public Method | CreateObjRef | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from System.MarshalByRefObject)
Public Method | Deserialize | Deserialize a previously serialized object. (Inherited from Dart.Sockets.ComponentBase)
Public Method | Dispose | Overloaded. Overridden. Releases all resources associated with the object.
Public Method | GetLifetimeService | Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | InitializeLifetimeService | Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | Marshal | Overloaded. Marshals a string and/or object to the UI thread and raises the UserState event. (Inherited from Dart.Sockets.ComponentBase)
Public Method | Serialize | Serialize an object to the provided destination stream. (Inherited from Dart.Sockets.ComponentBase)
Public Method | Start | Overloaded. Begin listening on the specified port on all IPv4 network interfaces.
Public Method | ToString | (Inherited from System.ComponentModel.Component)
Top

Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from System.ComponentModel.Component)
Protected Method | GetService | (Inherited from System.ComponentModel.Component)
Protected Method | MemberwiseClone | Overloaded. Creates a shallow copy of the current System.MarshalByRefObject object. (Inherited from System.MarshalByRefObject)
Protected Method | OnConnectionsChanged | Raises the ConnectionsChanged event.
Protected Method | OnError | Raises the Error event. (Inherited from Dart.Sockets.ComponentBase)
Protected Method | OnUserState | Raises the UserState event. (Inherited from Dart.Sockets.ComponentBase)
Top

See Also

Reference

Server Class
Dart.Sockets Namespace


Abort Method

[image]
PowerTCP Sockets for .NET
Abort Method
See Also Send comments on this topic
Dart.Sockets Namespace > Server Class : Abort Method

Glossary Item Box

Closes the listening socket and calls Close() on each active connection.

Syntax

Visual Basic (Declaration)
Public Sub Abort()
Visual Basic (Usage) Copy Code
Dim instance As Server

instance.Abort()
C#
public void Abort()
Managed Extensions for C++
public: void Abort();
C++/CLI
public:
void Abort();

See Also

Reference

Server Class
Server Members


Close Method

[image]
PowerTCP Sockets for .NET
Close Method
See Also Send comments on this topic
Dart.Sockets Namespace > Server Class : Close Method

Glossary Item Box

Closes the listening socket and allows each active connection to complete normally.

Syntax

Visual Basic (Declaration)
Public Sub Close()
Visual Basic (Usage) Copy Code
Dim instance As Server

instance.Close()
C#
public void Close()
Managed Extensions for C++
public: void Close();
C++/CLI
public:
void Close();

See Also

Reference

Server Class
Server Members


Dispose Method

[image]
PowerTCP Sockets for .NET
Dispose Method
See Also Send comments on this topic
Dart.Sockets Namespace > Server Class : Dispose Method

Glossary Item Box

Releases all resources associated with the object.

Overload List

Overload | Description
Dispose(Boolean) | Releases all resources associated with the object.
Dispose() | (Inherited from System.ComponentModel.Component)

See Also

Reference

Server Class
Server Members


Dispose(Boolean) Method

[image]
PowerTCP Sockets for .NET
Dispose(Boolean) Method
See Also Send comments on this topic
Dart.Sockets Namespace > Server Class > Dispose Method : Dispose(Boolean) Method

disposing
true when a user calls Dispose; false when called by a finalizer.

Glossary Item Box

Releases all resources associated with the object.

Syntax

Visual Basic (Declaration)
Protected Overloads Overrides Sub Dispose( _
   ByVal disposing As Boolean _
)
Visual Basic (Usage) Copy Code
Dim instance As Server
Dim disposing As Boolean

instance.Dispose(disposing)
C#
protected override void Dispose(
   bool disposing
)
Managed Extensions for C++
protected: void Dispose(
   bool disposing
) override
C++/CLI
protected:
void Dispose(
   bool disposing
) override

Parameters

disposing
true when a user calls Dispose; false when called by a finalizer.

See Also

Reference

Server Class
Server Members
Overload List


OnConnectionsChanged Method

[image]
PowerTCP Sockets for .NET
OnConnectionsChanged Method
See Also Send comments on this topic
Dart.Sockets Namespace > Server Class : OnConnectionsChanged Method

e

Glossary Item Box

Raises the ConnectionsChanged event.

Syntax

Visual Basic (Declaration)
Protected Overridable Sub OnConnectionsChanged( _
   ByVal e As ConnectionsChangedEventArgs _
)
Visual Basic (Usage) Copy Code
Dim instance As Server
Dim e As ConnectionsChangedEventArgs

instance.OnConnectionsChanged(e)
C#
protected virtual void OnConnectionsChanged(
   ConnectionsChangedEventArgs e
)
Managed Extensions for C++
protected: virtual void OnConnectionsChanged(
   ConnectionsChangedEventArgs* e
)
C++/CLI
protected:
virtual void OnConnectionsChanged(
   ConnectionsChangedEventArgs^ e
)

Parameters

e

Remarks

If the Synchronizing property is set, this method asynchronously invokes the ConnectionsChanged event on the UI thread. If the Synchronizing property is null, this method invokes the event on the executing thread.

This method allows derived classes to handle the event without attaching a delegate, but marshaling is not provided. This is the preferred technique for handling the event in a derived class.

Note to Inheritors: When overriding OnConnectionsChanged in a derived class, be sure to call the base class OnConnectionsChanged method, so that registered delegates receive the event.

See the SynchronizingObject property for information on updating UI controls in your event handler.

See Also

Reference

Server Class
Server Members


Start Method

[image]
PowerTCP Sockets for .NET
Start Method
See Also Send comments on this topic
Dart.Sockets Namespace > Server Class : Start Method

Glossary Item Box

Begin listening on the specified port on all IPv4 network interfaces.

Overload List

Overload | Description
Start(ConnectThreadStart,Int32,Object) | Begin listening on the specified port on all IPv4 network interfaces.
Start(ConnectThreadStart,IPEndPoint,Object) | Begin listening on the specified IPEndPoint.

See Also

Reference

Server Class
Server Members


Start(ConnectThreadStart,Int32,Object) Method

[image]
PowerTCP Sockets for .NET
Start(ConnectThreadStart,Int32,Object) Method
See Also Example Send comments on this topic
Dart.Sockets Namespace > Server Class > Start Method : Start(ConnectThreadStart,Int32,Object) Method

callback
A ConnectThreadStart delegate referencing the method to invoke on an IO completion thread as each connection is accepted.
localPort
Local port to bind to.
state
Object to pass into the callback method when invoked; can be null.

Glossary Item Box

Begin listening on the specified port on all IPv4 network interfaces.

Syntax

Visual Basic (Declaration)
Public Overloads Sub Start( _
   ByVal callback As ConnectThreadStart, _
   ByVal localPort As Integer, _
   ByVal state As Object _
)
Visual Basic (Usage) Copy Code
Dim instance As Server
Dim callback As ConnectThreadStart
Dim localPort As Integer
Dim state As Object

instance.Start(callback, localPort, state)
C#
public void Start(
   ConnectThreadStart callback,
   int localPort,
   object state
)
Managed Extensions for C++
public: void Start(
   ConnectThreadStart* callback,
   int localPort,
   Object* state
)
C++/CLI
public:
void Start(
   ConnectThreadStart^ callback,
   int localPort,
   Object^ state
)

Parameters

callback
A ConnectThreadStart delegate referencing the method to invoke on an IO completion thread as each connection is accepted.
localPort
Local port to bind to.
state
Object to pass into the callback method when invoked; can be null.

Remarks

This method does not block. Connections are accepted on IO completion threads and are reported to the specified delegate.

Example

The following example demonstrates an echo server using asynchronous read and write methods that utilize IO completion ports.
C# Copy Code
private void button1_Click(object sender, EventArgs e)
{
    //Start the echo server on port 7
    server1.Start(server1_NewConnection, 7, null);
}

private void server1_NewConnection(Tcp client, object state)
{
    //Read first data sent by client
    byte[] buffer = new byte[1024];
    client.ReadAsync(buffer, 0, buffer.Length, client_ReadAsyncCompleted, null);
}

private void client_ReadAsyncCompleted(TcpBase client, Data data, Exception ex, object state)
{
    //Echo data received back to client.
    //Data is null if client is not connected.
    if (data != null)
        client.WriteAsync(data.Buffer, data.Offset, data.Count, client_WriteAsyncCompleted, null);
}

private void client_WriteAsyncCompleted(TcpBase client, Data data, Exception ex, object state)
{
    //Read for more data.
    client.ReadAsync(data.Buffer, 0, data.Buffer.Length, client_ReadAsyncCompleted, null);
}
Visual Basic Copy Code
Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs)
    'Start the echo server on port 7
    server1.Start(AddressOf server1_NewConnection, 7, Nothing)
End Sub

Private Sub server1_NewConnection(ByVal client As Tcp, ByVal state As Object)
    'Read first data sent by client
    Dim buffer(1023) As Byte
    client.ReadAsync(buffer, 0, buffer.Length, AddressOf client_ReadAsyncCompleted, Nothing)
End Sub

Private Sub client_ReadAsyncCompleted(ByVal client As TcpBase, ByVal data As Data, ByVal ex As Exception, ByVal state As Object)
    'Echo data received back to client.
    'Data is null if client is not connected.
    If data IsNot Nothing Then
        client.WriteAsync(data.Buffer, data.Offset, data.Count, AddressOf client_WriteAsyncCompleted, Nothing)
    End If
End Sub

Private Sub client_WriteAsyncCompleted(ByVal client As TcpBase, ByVal data As Data, ByVal ex As Exception, ByVal state As Object)
    'Read for more data.
    client.ReadAsync(data.Buffer, 0, data.Buffer.Length, AddressOf client_ReadAsyncCompleted, Nothing)
End Sub

See Also

Reference

Server Class
Server Members
Overload List


Start(ConnectThreadStart,IPEndPoint,Object) Method

[image]
PowerTCP Sockets for .NET
Start(ConnectThreadStart,IPEndPoint,Object) Method
See Also Send comments on this topic
Dart.Sockets Namespace > Server Class > Start Method : Start(ConnectThreadStart,IPEndPoint,Object) Method

callback
A ConnectThreadStart delegate referencing the method to invoke on an IO completion thread as each connection is accepted.
localEP
Local endpoint to bind to.
state
Object to pass into the callback method when invoked; can be null.

Glossary Item Box

Begin listening on the specified IPEndPoint.

Syntax

Visual Basic (Declaration)
Public Overloads Sub Start( _
   ByVal callback As ConnectThreadStart, _
   ByVal localEP As IPEndPoint, _
   ByVal state As Object _
)
Visual Basic (Usage) Copy Code
Dim instance As Server
Dim callback As ConnectThreadStart
Dim localEP As IPEndPoint
Dim state As Object

instance.Start(callback, localEP, state)
C#
public void Start(
   ConnectThreadStart callback,
   IPEndPoint localEP,
   object state
)
Managed Extensions for C++
public: void Start(
   ConnectThreadStart* callback,
   IPEndPoint* localEP,
   Object* state
)
C++/CLI
public:
void Start(
   ConnectThreadStart^ callback,
   IPEndPoint^ localEP,
   Object^ state
)

Parameters

callback
A ConnectThreadStart delegate referencing the method to invoke on an IO completion thread as each connection is accepted.
localEP
Local endpoint to bind to.
state
Object to pass into the callback method when invoked; can be null.

Remarks

This method does not block. Connections are accepted on IO completion threads and are reported to the specified delegate.

See Also

Reference

Server Class
Server Members
Overload List


Server Class Properties

[image]
PowerTCP Sockets for .NET
Server Class Properties
See Also Send comments on this topic
Dart.Sockets Namespace : Server Class

Glossary Item Box

For a list of all members of this type, see Server members.

Public Properties

 | Name | Description
Public Property | Backlog | The maximum length of the pending connections queue.
Public Property | Container | (Inherited from System.ComponentModel.Component)
Public Property | Encoding | Character encoding used by the component. (Inherited from Dart.Sockets.ComponentBase)
Public Property | Site | (Inherited from System.ComponentModel.Component)
Public Property | Socket | Gets the socket used by the component for communications. (Inherited from Dart.Sockets.SocketBase)
Public Property | SynchronizingObject | Gets or sets the object used to marshal data to the UI thread (for raising events). (Inherited from Dart.Sockets.ComponentBase)
Public Property | SyncRoot | Gets an object that is used to synchronize access to the upper layer protocol in use. (Inherited from Dart.Sockets.ComponentBase)
Public Property | Tag | Gets or sets an object that stores any user data. (Inherited from Dart.Sockets.ComponentBase)
Top

Protected Properties

 | Name | Description
Protected Property | CanRaiseEvents | (Inherited from System.ComponentModel.Component)
Protected Property | DesignMode | (Inherited from System.ComponentModel.Component)
Protected Property | Events | (Inherited from System.ComponentModel.Component)
Top

See Also

Reference

Server Class
Dart.Sockets Namespace


Backlog Property

[image]
PowerTCP Sockets for .NET
Backlog Property
See Also Send comments on this topic
Dart.Sockets Namespace > Server Class : Backlog Property

Glossary Item Box

The maximum length of the pending connections queue.

Syntax

Visual Basic (Declaration)
<DefaultValueAttribute()>
Public Property Backlog As Integer
Visual Basic (Usage) Copy Code
Dim instance As Server
Dim value As Integer

instance.Backlog = value

value = instance.Backlog
C#
[DefaultValue()]
public int Backlog {get; set;}
Managed Extensions for C++
[DefaultValue()]
public: __property int get_Backlog();
public: __property void set_Backlog(
   int value
);
C++/CLI
[DefaultValue()]
public:
property int Backlog {
   int get();
   void set (    int value);
}

Remarks

This value is used as a parameter to the Socket.Listen method.

See Also

Reference

Server Class
Server Members


Server Class Fields

[image]
PowerTCP Sockets for .NET
Server Class Fields
See Also Send comments on this topic
Dart.Sockets Namespace : Server Class

Glossary Item Box

For a list of all members of this type, see Server members.

Public Fields

 | Name | Description
Public Field | Connections | Returns a List of Tcp objects representing active connections.
Top

See Also

Reference

Server Class
Dart.Sockets Namespace


Connections Field

[image]
PowerTCP Sockets for .NET
Connections Field
See Also Send comments on this topic
Dart.Sockets Namespace > Server Class : Connections Field

Glossary Item Box

Returns a List of Tcp objects representing active connections.

Syntax

Visual Basic (Declaration)
Public Connections As List(Of Tcp)
Visual Basic (Usage) Copy Code
Dim instance As Server
Dim value As List(Of Tcp)

value = instance.Connections

instance.Connections = value
C#
public List<Tcp> Connections
Managed Extensions for C++
public: List<Tcp*>* Connections
C++/CLI
public:
List<Tcp^>^ Connections

Remarks

When a client connects to the server, a Tcp object representing the connection is added to Connections and the ConnectionsChanged event is raised. When the connection is closed, the connection is removed from Connections and the ConnectionsChanged event is raised again.

Accessing the Connections collection is not thread-safe. Use "lock(server1.Connections)" (C# syntax) to ensure thread safety.

See Also

Reference

Server Class
Server Members


Server Class Events

[image]
PowerTCP Sockets for .NET
Server Class Events
See Also Send comments on this topic
Dart.Sockets Namespace : Server Class

Glossary Item Box

For a list of all members of this type, see Server members.

Public Events

 | Name | Description
Public Event | ConnectionsChanged | Raised after the Connections list has changed.
Public Event | Disposed | (Inherited from System.ComponentModel.Component)
Public Event | Error | Raised when Marshal(Exception) is used or an unhandled Exception is thrown in a worker thread created using Start. (Inherited from Dart.Sockets.ComponentBase)
Public Event | UserState | Raised when Marshal(String,Object) is used. (Inherited from Dart.Sockets.ComponentBase)
Top

See Also

Reference

Server Class
Dart.Sockets Namespace


ConnectionsChanged Event

[image]
PowerTCP Sockets for .NET
ConnectionsChanged Event
See Also Send comments on this topic
Dart.Sockets Namespace > Server Class : ConnectionsChanged Event

Glossary Item Box

Raised after the Connections list has changed.

Syntax

Visual Basic (Declaration)
Public Event ConnectionsChanged As EventHandler(Of ConnectionsChangedEventArgs)
Visual Basic (Usage) Copy Code
Dim instance As Server
Dim handler As EventHandler(Of ConnectionsChangedEventArgs)

AddHandler instance.ConnectionsChanged, handler
C#
public event EventHandler<ConnectionsChangedEventArgs> ConnectionsChanged
Managed Extensions for C++
public: __event EventHandler<ConnectionsChangedEventArgs*>* ConnectionsChanged
C++/CLI
public:
event EventHandler<ConnectionsChangedEventArgs^>^ ConnectionsChanged

Event Data

The event handler receives an argument of type ConnectionsChangedEventArgs containing data related to this event. The following ConnectionsChangedEventArgs properties provide information specific to this event.

Property | Description
Connection | Gets the Tcp object provided by the ConnectionsChanged event.

Remarks

This event is raised on the UI thread so that data can be used with UI components.

See SynchronizingObject for important information on updating UI controls from within this event.

See Also

Reference

Server Class
Server Members


ServerSecurity Class

[image]
PowerTCP Sockets for .NET
ServerSecurity Class
Members See Also Send comments on this topic
Dart.Sockets Namespace : ServerSecurity Class

Glossary Item Box

Holds the configuration used to establish an SSL server session.

Object Model

ServerSecurity Class

Syntax

Visual Basic (Declaration)
<SerializableAttribute()>
Public Class ServerSecurity
   Inherits Security
Visual Basic (Usage) Copy Code
Dim instance As ServerSecurity
C#
[Serializable()]
public class ServerSecurity : Security
Managed Extensions for C++
[Serializable()]
public __gc class ServerSecurity : public Security
C++/CLI
[Serializable()]
public ref class ServerSecurity : public Security

Inheritance Hierarchy

System.Object
Dart.Sockets.Security
Dart.Sockets.ServerSecurity

See Also

Reference

ServerSecurity Members
Dart.Sockets Namespace


ServerSecurity Class Members

[image]
PowerTCP Sockets for .NET
ServerSecurity Class Members
See Also Fields Properties Send comments on this topic
Dart.Sockets Namespace : ServerSecurity Class

Glossary Item Box

The following tables list the members exposed by ServerSecurity.

Public Constructors

 | Name | Description
Public Constructor | ServerSecurity Constructor | The default constructor for ServerSecurity
Top

Public Fields

 | Name | Description
Public Field | ValidationCallback | The delegate that executes after the server provides its certificate to the client. (Inherited from Dart.Sockets.Security)
Top

Public Properties

 | Name | Description
Public Property | Certificate | Gets or sets the server certificate to provide the client.
Public Property | CheckCertificateRevocation | Indicates whether the certificate revocation list is checked during authentication. (Inherited from Dart.Sockets.Security)
Public Property | Protocols | Gets or sets the SSLProtocols available. (Inherited from Dart.Sockets.Security)
Public Property | RequireClientCertificate | Indicates whether the server requires a client certificate.
Top

See Also

Reference

ServerSecurity Class
Dart.Sockets Namespace


ServerSecurity Constructor

[image]
PowerTCP Sockets for .NET
ServerSecurity Constructor
See Also Send comments on this topic
Dart.Sockets Namespace > ServerSecurity Class : ServerSecurity Constructor

Glossary Item Box

The default constructor for ServerSecurity

Syntax

Visual Basic (Declaration)
Public Function New()
Visual Basic (Usage) Copy Code
Dim instance As New ServerSecurity()
C#
public ServerSecurity()
Managed Extensions for C++
public: ServerSecurity();
C++/CLI
public:
ServerSecurity();

See Also

Reference

ServerSecurity Class
ServerSecurity Members


ServerSecurity Class Properties

[image]
PowerTCP Sockets for .NET
ServerSecurity Class Properties
See Also Send comments on this topic
Dart.Sockets Namespace : ServerSecurity Class

Glossary Item Box

For a list of all members of this type, see ServerSecurity members.

Public Properties

 | Name | Description
Public Property | Certificate | Gets or sets the server certificate to provide the client.
Public Property | CheckCertificateRevocation | Indicates whether the certificate revocation list is checked during authentication. (Inherited from Dart.Sockets.Security)
Public Property | Protocols | Gets or sets the SSLProtocols available. (Inherited from Dart.Sockets.Security)
Public Property | RequireClientCertificate | Indicates whether the server requires a client certificate.
Top

See Also

Reference

ServerSecurity Class
Dart.Sockets Namespace


Certificate Property

[image]
PowerTCP Sockets for .NET
Certificate Property
See Also Send comments on this topic
Dart.Sockets Namespace > ServerSecurity Class : Certificate Property

Glossary Item Box

Gets or sets the server certificate to provide the client.

Syntax

Visual Basic (Declaration)
Public Property Certificate As X509Certificate
Visual Basic (Usage) Copy Code
Dim instance As ServerSecurity
Dim value As X509Certificate

instance.Certificate = value

value = instance.Certificate
C#
public X509Certificate Certificate {get; set;}
Managed Extensions for C++
public: __property X509Certificate* get_Certificate();
public: __property void set_Certificate(
   X509Certificate* value
);
C++/CLI
public:
property X509Certificate^ Certificate {
   X509Certificate^ get();
   void set (    X509Certificate^ value);
}

See Also

Reference

ServerSecurity Class
ServerSecurity Members


RequireClientCertificate Property

[image]
PowerTCP Sockets for .NET
RequireClientCertificate Property
See Also Send comments on this topic
Dart.Sockets Namespace > ServerSecurity Class : RequireClientCertificate Property

Glossary Item Box

Indicates whether the server requires a client certificate.

Syntax

Visual Basic (Declaration)
<DefaultValueAttribute()>
Public Property RequireClientCertificate As Boolean
Visual Basic (Usage) Copy Code
Dim instance As ServerSecurity
Dim value As Boolean

instance.RequireClientCertificate = value

value = instance.RequireClientCertificate
C#
[DefaultValue()]
public bool RequireClientCertificate {get; set;}
Managed Extensions for C++
[DefaultValue()]
public: __property bool get_RequireClientCertificate();
public: __property void set_RequireClientCertificate(
   bool value
);
C++/CLI
[DefaultValue()]
public:
property bool RequireClientCertificate {
   bool get();
   void set (    bool value);
}

See Also

Reference

ServerSecurity Class
ServerSecurity Members


Session Class

[image]
PowerTCP Sockets for .NET
Session Class
Members See Also Send comments on this topic
Dart.Sockets Namespace : Session Class

Glossary Item Box

Holds the configuration common to UDP and TCP.

Object Model

Session ClassIPEndPoint ClassIPEndPoint Class

Syntax

Visual Basic (Declaration)
<SerializableAttribute()>
Public Class Session
Visual Basic (Usage) Copy Code
Dim instance As Session
C#
[Serializable()]
public class Session
Managed Extensions for C++
[Serializable()]
public __gc class Session
C++/CLI
[Serializable()]
public ref class Session

Inheritance Hierarchy

System.Object
Dart.Sockets.Session
Dart.Sockets.TcpSession

See Also

Reference

Session Members
Dart.Sockets Namespace


Session Class Members

[image]
PowerTCP Sockets for .NET
Session Class Members
See Also Properties Send comments on this topic
Dart.Sockets Namespace : Session Class

Glossary Item Box

The following tables list the members exposed by Session.

Public Constructors

 | Name | Description
Public Constructor | Session Constructor | Overloaded.
Top

Public Properties

 | Name | Description
Public Property | LocalEndPoint | EndPoint to bind to locally.
Public Property | RemoteEndPoint | EndPoint of the remote host to connect to.
Top

See Also

Reference

Session Class
Dart.Sockets Namespace


Session Constructor

[image]
PowerTCP Sockets for .NET
Session Constructor
See Also Send comments on this topic
Dart.Sockets Namespace > Session Class : Session Constructor

Glossary Item Box

Overload List

Overload | Description
Session Constructor() | Default constructor for Session.
Session Constructor(IPEndPoint) | Constructor for Session with a Remote IPEndPoint parameter.

See Also

Reference

Session Class
Session Members


Session Constructor()

[image]
PowerTCP Sockets for .NET
Session Constructor()
See Also Send comments on this topic
Dart.Sockets Namespace > Session Class > Session Constructor : Session Constructor()

Glossary Item Box

Default constructor for Session.

Syntax

Visual Basic (Declaration)
Public Function New()
Visual Basic (Usage) Copy Code
Dim instance As New Session()
C#
public Session()
Managed Extensions for C++
public: Session();
C++/CLI
public:
Session();

See Also

Reference

Session Class
Session Members
Overload List


Session Constructor(IPEndPoint)

[image]
PowerTCP Sockets for .NET
Session Constructor(IPEndPoint)
See Also Send comments on this topic
Dart.Sockets Namespace > Session Class > Session Constructor : Session Constructor(IPEndPoint)

remoteEP
The remote IPEndPoint to connect to.

Glossary Item Box

Constructor for Session with a Remote IPEndPoint parameter.

Syntax

Visual Basic (Declaration)
Public Function New( _
   ByVal remoteEP As IPEndPoint _
)
Visual Basic (Usage) Copy Code
Dim remoteEP As IPEndPoint

Dim instance As New Session(remoteEP)
C#
public Session(
   IPEndPoint remoteEP
)
Managed Extensions for C++
public: Session(
   IPEndPoint* remoteEP
)
C++/CLI
public:
Session(
   IPEndPoint^ remoteEP
)

Parameters

remoteEP
The remote IPEndPoint to connect to.

See Also

Reference

Session Class
Session Members
Overload List


Session Class Properties

[image]
PowerTCP Sockets for .NET
Session Class Properties
See Also Send comments on this topic
Dart.Sockets Namespace : Session Class

Glossary Item Box

For a list of all members of this type, see Session members.

Public Properties

 | Name | Description
Public Property | LocalEndPoint | EndPoint to bind to locally.
Public Property | RemoteEndPoint | EndPoint of the remote host to connect to.
Top

See Also

Reference

Session Class
Dart.Sockets Namespace


LocalEndPoint Property

[image]
PowerTCP Sockets for .NET
LocalEndPoint Property
See Also Send comments on this topic
Dart.Sockets Namespace > Session Class : LocalEndPoint Property

Glossary Item Box

EndPoint to bind to locally.

Syntax

Visual Basic (Declaration)
Public Property LocalEndPoint As IPEndPoint
Visual Basic (Usage) Copy Code
Dim instance As Session
Dim value As IPEndPoint

instance.LocalEndPoint = value

value = instance.LocalEndPoint
C#
public IPEndPoint LocalEndPoint {get; set;}
Managed Extensions for C++
public: __property IPEndPoint* get_LocalEndPoint();
public: __property void set_LocalEndPoint(
   IPEndPoint* value
);
C++/CLI
public:
property IPEndPoint^ LocalEndPoint {
   IPEndPoint^ get();
   void set (    IPEndPoint^ value);
}

Remarks

Use this property to control the use of IPv4/IPv6, the IP interface to bind to (for multi-homed hosts), and the port or port-range to use. Defaults to AddressFamily.InterNetworkV4, IPAddress.Any, and a port selected by the system (ephemeral port 0).

To use AddressFamily.InterNetworkV6, create a new IPEndPoint that specifies this AddressFamily. A Socket will be created that can connect to both IPv4 and IPv6 hosts. This is called a "dual stack", allowing clients to connect to both IPv4 and IPv6 servers, and allowing servers to accept connections from both IPv4 and IPv6 clients.

If IPEndPoint.Any is not desired, specify the hostname or address in the constructor.

If a random ephemeral port is not desired, specify the port or range in the constructor.

See Also

Reference

Session Class
Session Members


RemoteEndPoint Property

[image]
PowerTCP Sockets for .NET
RemoteEndPoint Property
See Also Send comments on this topic
Dart.Sockets Namespace > Session Class : RemoteEndPoint Property

Glossary Item Box

EndPoint of the remote host to connect to.

Syntax

Visual Basic (Declaration)
Public Property RemoteEndPoint As IPEndPoint
Visual Basic (Usage) Copy Code
Dim instance As Session
Dim value As IPEndPoint

instance.RemoteEndPoint = value

value = instance.RemoteEndPoint
C#
public IPEndPoint RemoteEndPoint {get; set;}
Managed Extensions for C++
public: __property IPEndPoint* get_RemoteEndPoint();
public: __property void set_RemoteEndPoint(
   IPEndPoint* value
);
C++/CLI
public:
property IPEndPoint^ RemoteEndPoint {
   IPEndPoint^ get();
   void set (    IPEndPoint^ value);
}

See Also

Reference

Session Class
Session Members


SocketBase Class

[image]
PowerTCP Sockets for .NET
SocketBase Class
Members See Also Send comments on this topic
Dart.Sockets Namespace : SocketBase Class

Glossary Item Box

Base class for PowerTCP Components.

Object Model

SocketBase Class

Syntax

Visual Basic (Declaration)
Public Class SocketBase
   Inherits ComponentBase
Visual Basic (Usage) Copy Code
Dim instance As SocketBase
C#
public class SocketBase : ComponentBase
Managed Extensions for C++
public __gc class SocketBase : public ComponentBase
C++/CLI
public ref class SocketBase : public ComponentBase

Inheritance Hierarchy

System.Object
System.MarshalByRefObject
System.ComponentModel.Component
Dart.Sockets.ComponentBase
Dart.Sockets.SocketBase
Dart.Sockets.Server
Dart.Sockets.TcpBase
Dart.Sockets.UdpBase

See Also

Reference

SocketBase Members
Dart.Sockets Namespace


SocketBase Class Members

[image]
PowerTCP Sockets for .NET
SocketBase Class Members
See Also Properties Methods Events Send comments on this topic
Dart.Sockets Namespace : SocketBase Class

Glossary Item Box

The following tables list the members exposed by SocketBase.

Public Properties

 | Name | Description
Public Property | Container | (Inherited from System.ComponentModel.Component)
Public Property | Encoding | Character encoding used by the component. (Inherited from Dart.Sockets.ComponentBase)
Public Property | Site | (Inherited from System.ComponentModel.Component)
Public Property | Socket | Gets the socket used by the component for communications.
Public Property | SynchronizingObject | Gets or sets the object used to marshal data to the UI thread (for raising events). (Inherited from Dart.Sockets.ComponentBase)
Public Property | SyncRoot | Gets an object that is used to synchronize access to the upper layer protocol in use. (Inherited from Dart.Sockets.ComponentBase)
Public Property | Tag | Gets or sets an object that stores any user data. (Inherited from Dart.Sockets.ComponentBase)
Top

Protected Properties

 | Name | Description
Protected Property | CanRaiseEvents | (Inherited from System.ComponentModel.Component)
Protected Property | DesignMode | (Inherited from System.ComponentModel.Component)
Protected Property | Events | (Inherited from System.ComponentModel.Component)
Top

Public Methods

 | Name | Description
Public Method | CreateObjRef | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from System.MarshalByRefObject)
Public Method | Deserialize | Deserialize a previously serialized object. (Inherited from Dart.Sockets.ComponentBase)
Public Method | Dispose | Overloaded. Overridden. Disposes of SocketBase and its associated resources.
Public Method | GetLifetimeService | Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | InitializeLifetimeService | Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | Marshal | Overloaded. Marshals a string and/or object to the UI thread and raises the UserState event. (Inherited from Dart.Sockets.ComponentBase)
Public Method | Serialize | Serialize an object to the provided destination stream. (Inherited from Dart.Sockets.ComponentBase)
Public Method | ToString | (Inherited from System.ComponentModel.Component)
Top

Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from System.ComponentModel.Component)
Protected Method | GetService | (Inherited from System.ComponentModel.Component)
Protected Method | MemberwiseClone | Overloaded. Creates a shallow copy of the current System.MarshalByRefObject object. (Inherited from System.MarshalByRefObject)
Protected Method | OnError | Raises the Error event. (Inherited from Dart.Sockets.ComponentBase)
Protected Method | OnUserState | Raises the UserState event. (Inherited from Dart.Sockets.ComponentBase)
Top

Public Events

 | Name | Description
Public Event | Disposed | (Inherited from System.ComponentModel.Component)
Public Event | Error | Raised when Marshal(Exception) is used or an unhandled Exception is thrown in a worker thread created using Start. (Inherited from Dart.Sockets.ComponentBase)
Public Event | UserState | Raised when Marshal(String,Object) is used. (Inherited from Dart.Sockets.ComponentBase)
Top

See Also

Reference

SocketBase Class
Dart.Sockets Namespace


SocketBase Class Methods

[image]
PowerTCP Sockets for .NET
SocketBase Class Methods
See Also Send comments on this topic
Dart.Sockets Namespace : SocketBase Class

Glossary Item Box

For a list of all members of this type, see SocketBase members.

Public Methods

 | Name | Description
Public Method | CreateObjRef | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from System.MarshalByRefObject)
Public Method | Deserialize | Deserialize a previously serialized object. (Inherited from Dart.Sockets.ComponentBase)
Public Method | Dispose | Overloaded. Overridden. Disposes of SocketBase and its associated resources.
Public Method | GetLifetimeService | Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | InitializeLifetimeService | Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | Marshal | Overloaded. Marshals a string and/or object to the UI thread and raises the UserState event. (Inherited from Dart.Sockets.ComponentBase)
Public Method | Serialize | Serialize an object to the provided destination stream. (Inherited from Dart.Sockets.ComponentBase)
Public Method | ToString | (Inherited from System.ComponentModel.Component)
Top

Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from System.ComponentModel.Component)
Protected Method | GetService | (Inherited from System.ComponentModel.Component)
Protected Method | MemberwiseClone | Overloaded. Creates a shallow copy of the current System.MarshalByRefObject object. (Inherited from System.MarshalByRefObject)
Protected Method | OnError | Raises the Error event. (Inherited from Dart.Sockets.ComponentBase)
Protected Method | OnUserState | Raises the UserState event. (Inherited from Dart.Sockets.ComponentBase)
Top

See Also

Reference

SocketBase Class
Dart.Sockets Namespace


Dispose Method

[image]
PowerTCP Sockets for .NET
Dispose Method
See Also Send comments on this topic
Dart.Sockets Namespace > SocketBase Class : Dispose Method

Glossary Item Box

Disposes of SocketBase and its associated resources.

Overload List

Overload | Description
Dispose(Boolean) | Disposes of SocketBase and its associated resources.
Dispose() | (Inherited from System.ComponentModel.Component)

See Also

Reference

SocketBase Class
SocketBase Members


Dispose(Boolean) Method

[image]
PowerTCP Sockets for .NET
Dispose(Boolean) Method
See Also Send comments on this topic
Dart.Sockets Namespace > SocketBase Class > Dispose Method : Dispose(Boolean) Method

disposing
true to release both managed and unmanaged resources; false to release only unmanaged resources.

Glossary Item Box

Disposes of SocketBase and its associated resources.

Syntax

Visual Basic (Declaration)
Protected Overloads Overrides Sub Dispose( _
   ByVal disposing As Boolean _
)
Visual Basic (Usage) Copy Code
Dim instance As SocketBase
Dim disposing As Boolean

instance.Dispose(disposing)
C#
protected override void Dispose(
   bool disposing
)
Managed Extensions for C++
protected: void Dispose(
   bool disposing
) override
C++/CLI
protected:
void Dispose(
   bool disposing
) override

Parameters

disposing
true to release both managed and unmanaged resources; false to release only unmanaged resources.

See Also

Reference

SocketBase Class
SocketBase Members
Overload List


SocketBase Class Properties

[image]
PowerTCP Sockets for .NET
SocketBase Class Properties
See Also Send comments on this topic
Dart.Sockets Namespace : SocketBase Class

Glossary Item Box

For a list of all members of this type, see SocketBase members.

Public Properties

 | Name | Description
Public Property | Container | (Inherited from System.ComponentModel.Component)
Public Property | Encoding | Character encoding used by the component. (Inherited from Dart.Sockets.ComponentBase)
Public Property | Site | (Inherited from System.ComponentModel.Component)
Public Property | Socket | Gets the socket used by the component for communications.
Public Property | SynchronizingObject | Gets or sets the object used to marshal data to the UI thread (for raising events). (Inherited from Dart.Sockets.ComponentBase)
Public Property | SyncRoot | Gets an object that is used to synchronize access to the upper layer protocol in use. (Inherited from Dart.Sockets.ComponentBase)
Public Property | Tag | Gets or sets an object that stores any user data. (Inherited from Dart.Sockets.ComponentBase)
Top

Protected Properties

 | Name | Description
Protected Property | CanRaiseEvents | (Inherited from System.ComponentModel.Component)
Protected Property | DesignMode | (Inherited from System.ComponentModel.Component)
Protected Property | Events | (Inherited from System.ComponentModel.Component)
Top

See Also

Reference

SocketBase Class
Dart.Sockets Namespace


Socket Property

[image]
PowerTCP Sockets for .NET
Socket Property
See Also Send comments on this topic
Dart.Sockets Namespace > SocketBase Class : Socket Property

Glossary Item Box

Gets the socket used by the component for communications.

Syntax

Visual Basic (Declaration)
Public ReadOnly Property Socket As Socket
Visual Basic (Usage) Copy Code
Dim instance As SocketBase
Dim value As Socket

value = instance.Socket
C#
public Socket Socket {get;}
Managed Extensions for C++
public: __property Socket* get_Socket();
C++/CLI
public:
property Socket^ Socket {
   Socket^ get();
}

Property Value

The Socket used for UDP or TCP communications. Returns null when not in use.

See Also

Reference

SocketBase Class
SocketBase Members


SocketOption Class

[image]
PowerTCP Sockets for .NET
SocketOption Class
Members See Also Send comments on this topic
Dart.Sockets Namespace : SocketOption Class

Glossary Item Box

Contains socket options that may be set by TCP and UDP sockets. These options are automatically applied to the connection used.

Object Model

SocketOption Class

Syntax

Visual Basic (Declaration)
<SerializableAttribute()>
Public Class SocketOption
Visual Basic (Usage) Copy Code
Dim instance As SocketOption
C#
[Serializable()]
public class SocketOption
Managed Extensions for C++
[Serializable()]
public __gc class SocketOption
C++/CLI
[Serializable()]
public ref class SocketOption

Inheritance Hierarchy

System.Object
Dart.Sockets.SocketOption
Dart.Sockets.TcpSocketOption
Dart.Sockets.UdpSocketOption

See Also

Reference

SocketOption Members
Dart.Sockets Namespace


SocketOption Class Members

[image]
PowerTCP Sockets for .NET
SocketOption Class Members
See Also Properties Send comments on this topic
Dart.Sockets Namespace : SocketOption Class

Glossary Item Box

The following tables list the members exposed by SocketOption.

Public Properties

 | Name | Description
Public Property | ExclusiveAddressUse | When set to true, forbids multiple socket bindings to the same address. Set this value to true to ensure you have exclusive use of the local endpoint. Socket.ExclusiveAddressUse is set to this value before Socket.Bind is used.
Public Property | ReceiveBufferSize | Gets or sets a value that specifies the size of the system receive buffer.
Public Property | ReceiveTimeout | Gets or sets a value that specifies the amount of time after which the underlying Socket.Receive call will time out.
Public Property | ReuseAddress | When set to true, allows multiple socket bindings to the same address. Set this value to true to allow multiple sockets to bind to the same local address.
Public Property | SendBufferSize | Gets or sets a value that specifies the size of the system send buffer.
Public Property | SendTimeout | Gets or sets a value that specifies the amount of time after which the underlying Socket Send call will time out.
Top

See Also

Reference

SocketOption Class
Dart.Sockets Namespace


SocketOption Class Properties

[image]
PowerTCP Sockets for .NET
SocketOption Class Properties
See Also Send comments on this topic
Dart.Sockets Namespace : SocketOption Class

Glossary Item Box

For a list of all members of this type, see SocketOption members.

Public Properties

 | Name | Description
Public Property | ExclusiveAddressUse | When set to true, forbids multiple socket bindings to the same address. Set this value to true to ensure you have exclusive use of the local endpoint. Socket.ExclusiveAddressUse is set to this value before Socket.Bind is used.
Public Property | ReceiveBufferSize | Gets or sets a value that specifies the size of the system receive buffer.
Public Property | ReceiveTimeout | Gets or sets a value that specifies the amount of time after which the underlying Socket.Receive call will time out.
Public Property | ReuseAddress | When set to true, allows multiple socket bindings to the same address. Set this value to true to allow multiple sockets to bind to the same local address.
Public Property | SendBufferSize | Gets or sets a value that specifies the size of the system send buffer.
Public Property | SendTimeout | Gets or sets a value that specifies the amount of time after which the underlying Socket Send call will time out.
Top

See Also

Reference

SocketOption Class
Dart.Sockets Namespace


ExclusiveAddressUse Property

[image]
PowerTCP Sockets for .NET
ExclusiveAddressUse Property
See Also Send comments on this topic
Dart.Sockets Namespace > SocketOption Class : ExclusiveAddressUse Property

Glossary Item Box

When set to true, forbids multiple socket bindings to the same address. Set this value to true to ensure you have exclusive use of the local endpoint. Socket.ExclusiveAddressUse is set to this value before Socket.Bind is used.

Syntax

Visual Basic (Declaration)
<DefaultValueAttribute()>
Public Property ExclusiveAddressUse As Boolean
Visual Basic (Usage) Copy Code
Dim instance As SocketOption
Dim value As Boolean

instance.ExclusiveAddressUse = value

value = instance.ExclusiveAddressUse
C#
[DefaultValue()]
public bool ExclusiveAddressUse {get; set;}
Managed Extensions for C++
[DefaultValue()]
public: __property bool get_ExclusiveAddressUse();
public: __property void set_ExclusiveAddressUse(
   bool value
);
C++/CLI
[DefaultValue()]
public:
property bool ExclusiveAddressUse {
   bool get();
   void set (    bool value);
}

Remarks

Set this value to true to ensure you have exclusive use of the local endpoint. Socket.ExclusiveAddressUse is set to this value before Socket.Bind is used.

See Also

Reference

SocketOption Class
SocketOption Members


ReceiveBufferSize Property

[image]
PowerTCP Sockets for .NET
ReceiveBufferSize Property
See Also Send comments on this topic
Dart.Sockets Namespace > SocketOption Class : ReceiveBufferSize Property

Glossary Item Box

Gets or sets a value that specifies the size of the system receive buffer.

Syntax

Visual Basic (Declaration)
<DefaultValueAttribute()>
Public Property ReceiveBufferSize As Integer
Visual Basic (Usage) Copy Code
Dim instance As SocketOption
Dim value As Integer

instance.ReceiveBufferSize = value

value = instance.ReceiveBufferSize
C#
[DefaultValue()]
public int ReceiveBufferSize {get; set;}
Managed Extensions for C++
[DefaultValue()]
public: __property int get_ReceiveBufferSize();
public: __property void set_ReceiveBufferSize(
   int value
);
C++/CLI
[DefaultValue()]
public:
property int ReceiveBufferSize {
   int get();
   void set (    int value);
}

Property Value

An integer with a default value of 32786.

Remarks

Increasing the buffer size may help performance when transferring large amounts of data, or when high bandwidth, high latency connections (such as a satellite broadband provider) are used.

The value cannot be changed on CF devices.

See Also

Reference

SocketOption Class
SocketOption Members


ReceiveTimeout Property

[image]
PowerTCP Sockets for .NET
ReceiveTimeout Property
See Also Send comments on this topic
Dart.Sockets Namespace > SocketOption Class : ReceiveTimeout Property

Glossary Item Box

Gets or sets a value that specifies the amount of time after which the underlying Socket.Receive call will time out.

Syntax

Visual Basic (Declaration)
<DefaultValueAttribute()>
Public Overridable Property ReceiveTimeout As Integer
Visual Basic (Usage) Copy Code
Dim instance As SocketOption
Dim value As Integer

instance.ReceiveTimeout = value

value = instance.ReceiveTimeout
C#
[DefaultValue()]
public virtual int ReceiveTimeout {get; set;}
Managed Extensions for C++
[DefaultValue()]
public: __property virtual int get_ReceiveTimeout();
public: __property virtual void set_ReceiveTimeout(
   int value
);
C++/CLI
[DefaultValue()]
public:
virtual property int ReceiveTimeout {
   int get();
   void set (    int value);
}

Property Value

The time-out value in milliseconds. The default value is 0, which indicates an infinite time-out period.

Remarks

A value of 0 or -1 indicates an infinite time-out period.

See Also

Reference

SocketOption Class
SocketOption Members


ReuseAddress Property

[image]
PowerTCP Sockets for .NET
ReuseAddress Property
See Also Send comments on this topic
Dart.Sockets Namespace > SocketOption Class : ReuseAddress Property

Glossary Item Box

When set to true, allows multiple socket bindings to the same address. Set this value to true to allow multiple sockets to bind to the same local address.

Syntax

Visual Basic (Declaration)
<DefaultValueAttribute()>
Public Property ReuseAddress As Boolean
Visual Basic (Usage) Copy Code
Dim instance As SocketOption
Dim value As Boolean

instance.ReuseAddress = value

value = instance.ReuseAddress
C#
[DefaultValue()]
public bool ReuseAddress {get; set;}
Managed Extensions for C++
[DefaultValue()]
public: __property bool get_ReuseAddress();
public: __property void set_ReuseAddress(
   bool value
);
C++/CLI
[DefaultValue()]
public:
property bool ReuseAddress {
   bool get();
   void set (    bool value);
}

Remarks

Set this value to true to allow multiple sockets to bind to the same local address.

See Also

Reference

SocketOption Class
SocketOption Members


SendBufferSize Property

[image]
PowerTCP Sockets for .NET
SendBufferSize Property
See Also Send comments on this topic
Dart.Sockets Namespace > SocketOption Class : SendBufferSize Property

Glossary Item Box

Gets or sets a value that specifies the size of the system send buffer.

Syntax

Visual Basic (Declaration)
<DefaultValueAttribute()>
Public Property SendBufferSize As Integer
Visual Basic (Usage) Copy Code
Dim instance As SocketOption
Dim value As Integer

instance.SendBufferSize = value

value = instance.SendBufferSize
C#
[DefaultValue()]
public int SendBufferSize {get; set;}
Managed Extensions for C++
[DefaultValue()]
public: __property int get_SendBufferSize();
public: __property void set_SendBufferSize(
   int value
);
C++/CLI
[DefaultValue()]
public:
property int SendBufferSize {
   int get();
   void set (    int value);
}

Property Value

An integer with a default value of 8192.

Remarks

Increasing the buffer size may help performance when transferring large amounts of data, or when high bandwidth, high latency connections (such as a satellite broadband provider) are used.

See Also

Reference

SocketOption Class
SocketOption Members


SendTimeout Property

[image]
PowerTCP Sockets for .NET
SendTimeout Property
See Also Send comments on this topic
Dart.Sockets Namespace > SocketOption Class : SendTimeout Property

Glossary Item Box

Gets or sets a value that specifies the amount of time after which the underlying Socket Send call will time out.

Syntax

Visual Basic (Declaration)
<DefaultValueAttribute()>
Public Property SendTimeout As Integer
Visual Basic (Usage) Copy Code
Dim instance As SocketOption
Dim value As Integer

instance.SendTimeout = value

value = instance.SendTimeout
C#
[DefaultValue()]
public int SendTimeout {get; set;}
Managed Extensions for C++
[DefaultValue()]
public: __property int get_SendTimeout();
public: __property void set_SendTimeout(
   int value
);
C++/CLI
[DefaultValue()]
public:
property int SendTimeout {
   int get();
   void set (    int value);
}

Property Value

The time-out value in milliseconds. The default value is 0, which indicates an infinite time-out period.

Remarks

Values between 1 and 499 will be changed to 500, as 500 is the minimum positive value. Values of 0 and -1 indicate an infinite time-out period.

This option has no affect on CF devices (the Write method will not time out).

See Also

Reference

SocketOption Class
SocketOption Members


Tcp Class

[image]
PowerTCP Sockets for .NET
Tcp Class
Members Example See Also Send comments on this topic
Dart.Sockets Namespace : Tcp Class

Glossary Item Box

The Tcp component simplifies the use of secure Tcp communications within any .NET application.

Object Model

Tcp ClassTcpSocketOption Class

Syntax

Visual Basic (Declaration)
Public Class Tcp
   Inherits PtyBase
Visual Basic (Usage) Copy Code
Dim instance As Tcp
C#
public class Tcp : PtyBase
Managed Extensions for C++
public __gc class Tcp : public PtyBase
C++/CLI
public ref class Tcp : public PtyBase

Remarks

The Tcp component establishes and manages TCP-level streams of data. Methods for establishing connections, and sending and receiving data simplify Tcp communications for the user, while still providing options for advanced customization. Secure SSL connections and worker thread operation are fully supported.

The Tcp component can optionally be bound to a display control for easy user-interactive development.

Using the Tcp Component

The Tcp component's clean interface provides clear, straight-forward use. All methods calls are blocking calls, making programming an intuitive step-by-step process. Functions can be passed to the Start method, to execute on worker threads without blocking the user interface. Marshaling data from these worker threads is made convenient using the overloaded Marshal methods. See the Asynchronous Operation page for more information on this topic.

  • Connecting: Use the Connect method. Once connected, establish an optional secure connection using AuthenticateAsClient.

  • Sending Data: Once a connection is established, send data using the Write method, which includes overloads for sending data as byte arrays or as strings.

  • Receiving Data: Receive data using the Read method. This method returns a Data object containing data read off the data stream. Data in this object can easily be converted to a string using its ToString method. The Read method includes overloads for reading until a specified delimiter is found. A set of delimiters can also be specified for situations in which one of several responses may be received. Marshal data to the Data event (on the UI thread) by calling the Marshal method.

Binding the Tcp Component to a Display

Set the Pty (pseudo terminal) property to bind the Telnet component to a display control derived from TextBoxBase (such as a standard TextBox), and call Connect to establish a connection to the specified host. Once connected, keystrokes will be sent automatically, and data received will appear in the text area.

Example

The following example demonstrates simple Tcp read and write operations on a worker thread, and marshaling the received data to the main thread.
C# Copy Code
private void button1_Click(object sender, EventArgs e)
{
    tcp1.Start(connectWriteRead, null);
}

private void connectWriteRead(object state)
{
    tcp1.Connect(new TcpSession(new Dart.Sockets.IPEndPoint(myEchoServer, 7)));
    tcp1.Write("hello world!");
    byte[] buffer = new byte[128];
    tcp1.Marshal(tcp1.Read(buffer), "", null);
    tcp1.Close();
}

void tcp1_Data(object sender, Dart.Sockets.DataEventArgs e)
{
    textBox1.AppendText(e.Data.ToString());
}
Visual Basic Copy Code
Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs)
    tcp1.Start(AddressOf connectWriteRead, Nothing)
End Sub

Private Sub connectWriteRead(ByVal state As Object)
    tcp1.Connect(New TcpSession(New Dart.Sockets.IPEndPoint(myEchoServer, 7)))
    tcp1.Write("hello world!")
    Dim buffer(127) As Byte
    tcp1.Marshal(tcp1.Read(buffer), "", Nothing)
    tcp1.Close()
End Sub

Private Sub tcp1_Data(ByVal sender As Object, ByVal e As Dart.Sockets.DataEventArgs)
    textBox1.AppendText(e.Data.ToString())
End Sub

Inheritance Hierarchy

System.Object
System.MarshalByRefObject
System.ComponentModel.Component
Dart.Sockets.ComponentBase
Dart.Sockets.SocketBase
Dart.Sockets.TcpBase
Dart.Sockets.PtyBase
Dart.Sockets.Tcp

See Also

Reference

Tcp Members
Dart.Sockets Namespace


Tcp Class Members

[image]
PowerTCP Sockets for .NET
Tcp Class Members
See Also Properties Methods Events Send comments on this topic
Dart.Sockets Namespace : Tcp Class

Glossary Item Box

The following tables list the members exposed by Tcp.

Public Constructors

 | Name | Description
Public Constructor | Tcp Constructor | Overloaded.
Top

Public Properties

 | Name | Description
Public Property | CloseTime | Returns the DateTime the connection was closed. (Inherited from Dart.Sockets.TcpBase)
Public Property | ConnectTime | Returns the DateTime the connection was established. (Inherited from Dart.Sockets.TcpBase)
Public Property | Container | (Inherited from System.ComponentModel.Component)
Public Property | CRLF | Set to true if the Pty property is used and a CR should be converted to a CRLF for sending. (Inherited from Dart.Sockets.PtyBase)
Public Property | Encoding | Character encoding used by the component. (Inherited from Dart.Sockets.ComponentBase)
Public Property | LocalEcho | Set to true if the Pty property is used and keystrokes should be displayed in the textbox. (Inherited from Dart.Sockets.PtyBase)
Public Property | NetworkStream | Returns the NetworkStream object created when Connect() is called. (Inherited from Dart.Sockets.TcpBase)
Public Property | Pty | Gets or sets a display control to use for automatic pseudo terminal support. (Inherited from Dart.Sockets.PtyBase)
Public Property | RemoteEndPoint | Gets the remote address and port of the connection. (Inherited from Dart.Sockets.TcpBase)
Public Property | Site | (Inherited from System.ComponentModel.Component)
Public Property | Socket | Gets the socket used by the component for communications. (Inherited from Dart.Sockets.SocketBase)
Public Property | SocketOption | Gets and sets the socket options for classes derived from TcpBase. (Inherited from Dart.Sockets.TcpBase)
Public Property | SslStream | Returns the SslStream object created when AuthenticateAsClient or AuthenticateAsServer are called. (Inherited from Dart.Sockets.TcpBase)
Public Property | State | Gets the status of the connection as of the last socket operation. (Inherited from Dart.Sockets.TcpBase)
Public Property | SynchronizingObject | Gets or sets the object used to marshal data to the UI thread (for raising events). (Inherited from Dart.Sockets.ComponentBase)
Public Property | SyncRoot | Gets an object that is used to synchronize access to the upper layer protocol in use. (Inherited from Dart.Sockets.ComponentBase)
Public Property | Tag | Gets or sets an object that stores any user data. (Inherited from Dart.Sockets.ComponentBase)
Top

Protected Properties

 | Name | Description
Protected Property | CanRaiseEvents | (Inherited from System.ComponentModel.Component)
Protected Property | DesignMode | (Inherited from System.ComponentModel.Component)
Protected Property | Events | (Inherited from System.ComponentModel.Component)
Top

Public Methods

 | Name | Description
Public Method | Abort | Performs a hard close of the connection. (Inherited from Dart.Sockets.TcpBase)
Public Method | AuthenticateAsClient | Overloaded. Authenticates the server when establishing a secure connection. (Inherited from Dart.Sockets.TcpBase)
Public Method | AuthenticateAsServer | Authenticates a client when establishing a secure connection. (Inherited from Dart.Sockets.TcpBase)
Public Method | Close | Gracefully closes the connection. (Inherited from Dart.Sockets.TcpBase)
Public Method | Connect | Connect to a server using the configuration specified by session. (Inherited from Dart.Sockets.TcpBase)
Public Method | ConnectAsync | Connect to a server using the configuration specified by session. (Inherited from Dart.Sockets.TcpBase)
Public Method | CreateObjRef | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from System.MarshalByRefObject)
Public Method | Deserialize | Deserialize a previously serialized object. (Inherited from Dart.Sockets.ComponentBase)
Public Method | Dispose | Overloaded. Disposes of TcpBase and its associated resources. (Inherited from Dart.Sockets.TcpBase)
Public Method | GetLifetimeService | Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | GetStream | Provides access to the underlying Stream. (Inherited from Dart.Sockets.TcpBase)
Public Method | InitializeLifetimeService | Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | Marshal | Overloaded. Marshals data to the UI thread. (Inherited from Dart.Sockets.TcpBase)
Public Method | Read | Overloaded. Receives data from the remote host. (Inherited from Dart.Sockets.TcpBase)
Public Method | ReadAsync | Start an asynchronous read on the socket. (Inherited from Dart.Sockets.TcpBase)
Public Method | ReadToCount | Read until count bytes are read, an exception is thrown, or the connection is closed. (Inherited from Dart.Sockets.TcpBase)
Public Method | ReadToDelimiter | Overloaded. Read until the delimiter is found, an exception is thrown, or the connection is closed. (Inherited from Dart.Sockets.TcpBase)
Public Method | ReadToEnd | Read until the connection is closed or an exception is thrown. (Inherited from Dart.Sockets.TcpBase)
Public Method | Serialize | Serialize an object to the provided destination stream. (Inherited from Dart.Sockets.ComponentBase)
Public Method | ShutdownSsl | Signals the remote host to shutdown the SSL connection. (Inherited from Dart.Sockets.TcpBase)
Public Method | Start | Start a worker thread on which the specified delegate function executes.
Public Method | ToString | (Inherited from System.ComponentModel.Component)
Public Method | Write | Overloaded. Sends data to the remote host. (Inherited from Dart.Sockets.TcpBase)
Public Method | WriteAsync | Start an asynchronous write on the socket. (Inherited from Dart.Sockets.TcpBase)
Top

Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from System.ComponentModel.Component)
Protected Method | GetService | (Inherited from System.ComponentModel.Component)
Protected Method | MemberwiseClone | Overloaded. Creates a shallow copy of the current System.MarshalByRefObject object. (Inherited from System.MarshalByRefObject)
Protected Method | OnData | Raises the TcpBase.Data event. (Inherited from Dart.Sockets.TcpBase)
Protected Method | OnError | Raises the Error event. (Inherited from Dart.Sockets.ComponentBase)
Protected Method | OnLog | Raises the TcpBase.Log event. (Inherited from Dart.Sockets.TcpBase)
Protected Method | OnStateChanged | Raises the TcpBase.StateChanged event. (Inherited from Dart.Sockets.TcpBase)
Protected Method | OnUserState | Raises the UserState event. (Inherited from Dart.Sockets.ComponentBase)
Top

Public Events

 | Name | Description
Public Event | Data | Raised when TcpBase.Marshal is used. (Inherited from Dart.Sockets.TcpBase)
Public Event | Disposed | (Inherited from System.ComponentModel.Component)
Public Event | Error | Raised when Marshal(Exception) is used or an unhandled Exception is thrown in a worker thread created using Start. (Inherited from Dart.Sockets.ComponentBase)
Public Event | Log | Raised when data is read or written. (Inherited from Dart.Sockets.TcpBase)
Public Event | StateChanged | Raised when the value of the State property changes. (Inherited from Dart.Sockets.TcpBase)
Public Event | UserState | Raised when Marshal(String,Object) is used. (Inherited from Dart.Sockets.ComponentBase)
Top

See Also

Reference

Tcp Class
Dart.Sockets Namespace


Tcp Constructor

[image]
PowerTCP Sockets for .NET
Tcp Constructor
See Also Send comments on this topic
Dart.Sockets Namespace > Tcp Class : Tcp Constructor

Glossary Item Box

Overload List

Overload | Description
Tcp Constructor() | Initializes a new instance of the Tcp component.
Tcp Constructor(IContainer) | Initializes a new Tcp object.
Tcp Constructor(Socket) | Create a Tcp object from an accepted System.Net.Sockets.Socket.

See Also

Reference

Tcp Class
Tcp Members


Tcp Constructor()

[image]
PowerTCP Sockets for .NET
Tcp Constructor()
See Also Send comments on this topic
Dart.Sockets Namespace > Tcp Class > Tcp Constructor : Tcp Constructor()

Glossary Item Box

Initializes a new instance of the Tcp component.

Syntax

Visual Basic (Declaration)
Public Function New()
Visual Basic (Usage) Copy Code
Dim instance As New Tcp()
C#
public Tcp()
Managed Extensions for C++
public: Tcp();
C++/CLI
public:
Tcp();

See Also

Reference

Tcp Class
Tcp Members
Overload List


Tcp Constructor(IContainer)

[image]
PowerTCP Sockets for .NET
Tcp Constructor(IContainer)
See Also Send comments on this topic
Dart.Sockets Namespace > Tcp Class > Tcp Constructor : Tcp Constructor(IContainer)

container
The IContainer which contains the object.

Glossary Item Box

Initializes a new Tcp object.

Syntax

Visual Basic (Declaration)
Public Function New( _
   ByVal container As IContainer _
)
Visual Basic (Usage) Copy Code
Dim container As IContainer

Dim instance As New Tcp(container)
C#
public Tcp(
   IContainer container
)
Managed Extensions for C++
public: Tcp(
   IContainer* container
)
C++/CLI
public:
Tcp(
   IContainer^ container
)

Parameters

container
The IContainer which contains the object.

See Also

Reference

Tcp Class
Tcp Members
Overload List


Tcp Constructor(Socket)

[image]
PowerTCP Sockets for .NET
Tcp Constructor(Socket)
See Also Send comments on this topic
Dart.Sockets Namespace > Tcp Class > Tcp Constructor : Tcp Constructor(Socket)

acceptedSocket
An existing Socket.

Glossary Item Box

Create a Tcp object from an accepted System.Net.Sockets.Socket.

Syntax

Visual Basic (Declaration)
Public Function New( _
   ByVal acceptedSocket As Socket _
)
Visual Basic (Usage) Copy Code
Dim acceptedSocket As Socket

Dim instance As New Tcp(acceptedSocket)
C#
public Tcp(
   Socket acceptedSocket
)
Managed Extensions for C++
public: Tcp(
   Socket* acceptedSocket
)
C++/CLI
public:
Tcp(
   Socket^ acceptedSocket
)

Parameters

acceptedSocket
An existing Socket.

See Also

Reference

Tcp Class
Tcp Members
Overload List


Tcp Class Methods

[image]
PowerTCP Sockets for .NET
Tcp Class Methods
See Also Send comments on this topic
Dart.Sockets Namespace : Tcp Class

Glossary Item Box

For a list of all members of this type, see Tcp members.

Public Methods

 | Name | Description
Public Method | Abort | Performs a hard close of the connection. (Inherited from Dart.Sockets.TcpBase)
Public Method | AuthenticateAsClient | Overloaded. Authenticates the server when establishing a secure connection. (Inherited from Dart.Sockets.TcpBase)
Public Method | AuthenticateAsServer | Authenticates a client when establishing a secure connection. (Inherited from Dart.Sockets.TcpBase)
Public Method | Close | Gracefully closes the connection. (Inherited from Dart.Sockets.TcpBase)
Public Method | Connect | Connect to a server using the configuration specified by session. (Inherited from Dart.Sockets.TcpBase)
Public Method | ConnectAsync | Connect to a server using the configuration specified by session. (Inherited from Dart.Sockets.TcpBase)
Public Method | CreateObjRef | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from System.MarshalByRefObject)
Public Method | Deserialize | Deserialize a previously serialized object. (Inherited from Dart.Sockets.ComponentBase)
Public Method | Dispose | Overloaded. Disposes of TcpBase and its associated resources. (Inherited from Dart.Sockets.TcpBase)
Public Method | GetLifetimeService | Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | GetStream | Provides access to the underlying Stream. (Inherited from Dart.Sockets.TcpBase)
Public Method | InitializeLifetimeService | Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | Marshal | Overloaded. Marshals data to the UI thread. (Inherited from Dart.Sockets.TcpBase)
Public Method | Read | Overloaded. Receives data from the remote host. (Inherited from Dart.Sockets.TcpBase)
Public Method | ReadAsync | Start an asynchronous read on the socket. (Inherited from Dart.Sockets.TcpBase)
Public Method | ReadToCount | Read until count bytes are read, an exception is thrown, or the connection is closed. (Inherited from Dart.Sockets.TcpBase)
Public Method | ReadToDelimiter | Overloaded. Read until the delimiter is found, an exception is thrown, or the connection is closed. (Inherited from Dart.Sockets.TcpBase)
Public Method | ReadToEnd | Read until the connection is closed or an exception is thrown. (Inherited from Dart.Sockets.TcpBase)
Public Method | Serialize | Serialize an object to the provided destination stream. (Inherited from Dart.Sockets.ComponentBase)
Public Method | ShutdownSsl | Signals the remote host to shutdown the SSL connection. (Inherited from Dart.Sockets.TcpBase)
Public Method | Start | Start a worker thread on which the specified delegate function executes.
Public Method | ToString | (Inherited from System.ComponentModel.Component)
Public Method | Write | Overloaded. Sends data to the remote host. (Inherited from Dart.Sockets.TcpBase)
Public Method | WriteAsync | Start an asynchronous write on the socket. (Inherited from Dart.Sockets.TcpBase)
Top

Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from System.ComponentModel.Component)
Protected Method | GetService | (Inherited from System.ComponentModel.Component)
Protected Method | MemberwiseClone | Overloaded. Creates a shallow copy of the current System.MarshalByRefObject object. (Inherited from System.MarshalByRefObject)
Protected Method | OnData | Raises the TcpBase.Data event. (Inherited from Dart.Sockets.TcpBase)
Protected Method | OnError | Raises the Error event. (Inherited from Dart.Sockets.ComponentBase)
Protected Method | OnLog | Raises the TcpBase.Log event. (Inherited from Dart.Sockets.TcpBase)
Protected Method | OnStateChanged | Raises the TcpBase.StateChanged event. (Inherited from Dart.Sockets.TcpBase)
Protected Method | OnUserState | Raises the UserState event. (Inherited from Dart.Sockets.ComponentBase)
Top

See Also

Reference

Tcp Class
Dart.Sockets Namespace


Start Method

[image]
PowerTCP Sockets for .NET
Start Method
See Also Example Send comments on this topic
Dart.Sockets Namespace > Tcp Class : Start Method

worker
System.Threading.WaitCallback delegate specifying the function to execute.
state
Information to pass to the worker delegate method; can be null.

Glossary Item Box

Start a worker thread on which the specified delegate function executes.

Syntax

Visual Basic (Declaration)
Public Sub Start( _
   ByVal worker As WaitCallback, _
   ByVal state As Object _
)
Visual Basic (Usage) Copy Code
Dim instance As Tcp
Dim worker As WaitCallback
Dim state As Object

instance.Start(worker, state)
C#
public void Start(
   WaitCallback worker,
   object state
)
Managed Extensions for C++
public: void Start(
   WaitCallback* worker,
   Object* state
)
C++/CLI
public:
void Start(
   WaitCallback^ worker,
   Object^ state
)

Parameters

worker
System.Threading.WaitCallback delegate specifying the function to execute.
state
Information to pass to the worker delegate method; can be null.

Remarks

This method provides an easy means for executing blocking functions on a worker thread. Applications with a UI thread should use this technique to execute processes (like Connect and Read) that can block the UI thread.

Unhandled exceptions occurring on the worker thread will be caught and reported by the Error event.

Example

The following example demonstrates simple Tcp read and write operations on a worker thread, and marshaling the received data to the main thread.
C# Copy Code
private void button1_Click(object sender, EventArgs e)
{
    tcp1.Start(connectWriteRead, null);
}

private void connectWriteRead(object state)
{
    tcp1.Connect(new TcpSession(new Dart.Sockets.IPEndPoint(myEchoServer, 7)));
    tcp1.Write("hello world!");
    byte[] buffer = new byte[128];
    tcp1.Marshal(tcp1.Read(buffer), "", null);
    tcp1.Close();
}

void tcp1_Data(object sender, Dart.Sockets.DataEventArgs e)
{
    textBox1.AppendText(e.Data.ToString());
}
Visual Basic Copy Code
Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs)
    tcp1.Start(AddressOf connectWriteRead, Nothing)
End Sub

Private Sub connectWriteRead(ByVal state As Object)
    tcp1.Connect(New TcpSession(New Dart.Sockets.IPEndPoint(myEchoServer, 7)))
    tcp1.Write("hello world!")
    Dim buffer(127) As Byte
    tcp1.Marshal(tcp1.Read(buffer), "", Nothing)
    tcp1.Close()
End Sub

Private Sub tcp1_Data(ByVal sender As Object, ByVal e As Dart.Sockets.DataEventArgs)
    textBox1.AppendText(e.Data.ToString())
End Sub

See Also

Reference

Tcp Class
Tcp Members


TcpBase Class

[image]
PowerTCP Sockets for .NET
TcpBase Class
Members See Also Send comments on this topic
Dart.Sockets Namespace : TcpBase Class

Glossary Item Box

Base class for components utilizing protocols built upon the TCP protocol.

Object Model

TcpBase ClassTcpSocketOption Class

Syntax

Visual Basic (Declaration)
Public Class TcpBase
   Inherits SocketBase
Visual Basic (Usage) Copy Code
Dim instance As TcpBase
C#
public class TcpBase : SocketBase
Managed Extensions for C++
public __gc class TcpBase : public SocketBase
C++/CLI
public ref class TcpBase : public SocketBase

Inheritance Hierarchy

System.Object
System.MarshalByRefObject
System.ComponentModel.Component
Dart.Sockets.ComponentBase
Dart.Sockets.SocketBase
Dart.Sockets.TcpBase
Dart.Sockets.PtyBase

See Also

Reference

TcpBase Members
Dart.Sockets Namespace


TcpBase Class Members

[image]
PowerTCP Sockets for .NET
TcpBase Class Members
See Also Properties Methods Events Send comments on this topic
Dart.Sockets Namespace : TcpBase Class

Glossary Item Box

The following tables list the members exposed by TcpBase.

Public Properties

 | Name | Description
Public Property | CloseTime | Returns the DateTime the connection was closed.
Public Property | ConnectTime | Returns the DateTime the connection was established.
Public Property | Container | (Inherited from System.ComponentModel.Component)
Public Property | Encoding | Character encoding used by the component. (Inherited from Dart.Sockets.ComponentBase)
Public Property | NetworkStream | Returns the NetworkStream object created when Connect() is called.
Public Property | RemoteEndPoint | Gets the remote address and port of the connection.
Public Property | Site | (Inherited from System.ComponentModel.Component)
Public Property | Socket | Gets the socket used by the component for communications. (Inherited from Dart.Sockets.SocketBase)
Public Property | SocketOption | Gets and sets the socket options for classes derived from TcpBase.
Public Property | SslStream | Returns the SslStream object created when AuthenticateAsClient or AuthenticateAsServer are called.
Public Property | State | Gets the status of the connection as of the last socket operation.
Public Property | SynchronizingObject | Gets or sets the object used to marshal data to the UI thread (for raising events). (Inherited from Dart.Sockets.ComponentBase)
Public Property | SyncRoot | Gets an object that is used to synchronize access to the upper layer protocol in use. (Inherited from Dart.Sockets.ComponentBase)
Public Property | Tag | Gets or sets an object that stores any user data. (Inherited from Dart.Sockets.ComponentBase)
Top

Protected Properties

 | Name | Description
Protected Property | CanRaiseEvents | (Inherited from System.ComponentModel.Component)
Protected Property | DesignMode | (Inherited from System.ComponentModel.Component)
Protected Property | Events | (Inherited from System.ComponentModel.Component)
Top

Public Methods

 | Name | Description
Public Method | Abort | Performs a hard close of the connection.
Public Method | AuthenticateAsClient | Overloaded. Authenticates the server when establishing a secure connection.
Public Method | AuthenticateAsServer | Authenticates a client when establishing a secure connection.
Public Method | Close | Gracefully closes the connection.
Public Method | Connect | Connect to a server using the configuration specified by session.
Public Method | ConnectAsync | Connect to a server using the configuration specified by session.
Public Method | CreateObjRef | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from System.MarshalByRefObject)
Public Method | Deserialize | Deserialize a previously serialized object. (Inherited from Dart.Sockets.ComponentBase)
Public Method | Dispose | Overloaded. Overridden. Disposes of TcpBase and its associated resources.
Public Method | GetLifetimeService | Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | GetStream | Provides access to the underlying Stream.
Public Method | InitializeLifetimeService | Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | Marshal | Overloaded. Marshals data to the UI thread.
Public Method | Read | Overloaded. Receives data from the remote host.
Public Method | ReadAsync | Start an asynchronous read on the socket.
Public Method | ReadToCount | Read until count bytes are read, an exception is thrown, or the connection is closed.
Public Method | ReadToDelimiter | Overloaded. Read until the delimiter is found, an exception is thrown, or the connection is closed.
Public Method | ReadToEnd | Read until the connection is closed or an exception is thrown.
Public Method | Serialize | Serialize an object to the provided destination stream. (Inherited from Dart.Sockets.ComponentBase)
Public Method | ShutdownSsl | Signals the remote host to shutdown the SSL connection.
Public Method | ToString | (Inherited from System.ComponentModel.Component)
Public Method | Write | Overloaded. Sends data to the remote host.
Public Method | WriteAsync | Start an asynchronous write on the socket.
Top

Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from System.ComponentModel.Component)
Protected Method | GetService | (Inherited from System.ComponentModel.Component)
Protected Method | MemberwiseClone | Overloaded. Creates a shallow copy of the current System.MarshalByRefObject object. (Inherited from System.MarshalByRefObject)
Protected Method | OnData | Raises the Data event.
Protected Method | OnError | Raises the Error event. (Inherited from Dart.Sockets.ComponentBase)
Protected Method | OnLog | Raises the Log event.
Protected Method | OnStateChanged | Raises the StateChanged event.
Protected Method | OnUserState | Raises the UserState event. (Inherited from Dart.Sockets.ComponentBase)
Top

Public Events

 | Name | Description
Public Event | Data | Raised when Marshal(Data,String,Object) is used.
Public Event | Disposed | (Inherited from System.ComponentModel.Component)
Public Event | Error | Raised when Marshal(Exception) is used or an unhandled Exception is thrown in a worker thread created using Start. (Inherited from Dart.Sockets.ComponentBase)
Public Event | Log | Raised when data is read or written.
Public Event | StateChanged | Raised when the value of the State property changes.
Public Event | UserState | Raised when Marshal(String,Object) is used. (Inherited from Dart.Sockets.ComponentBase)
Top

See Also

Reference

TcpBase Class
Dart.Sockets Namespace


TcpBase Class Methods

[image]
PowerTCP Sockets for .NET
TcpBase Class Methods
See Also Send comments on this topic
Dart.Sockets Namespace : TcpBase Class

Glossary Item Box

For a list of all members of this type, see TcpBase members.

Public Methods

 | Name | Description
Public Method | Abort | Performs a hard close of the connection.
Public Method | AuthenticateAsClient | Overloaded. Authenticates the server when establishing a secure connection.
Public Method | AuthenticateAsServer | Authenticates a client when establishing a secure connection.
Public Method | Close | Gracefully closes the connection.
Public Method | Connect | Connect to a server using the configuration specified by session.
Public Method | ConnectAsync | Connect to a server using the configuration specified by session.
Public Method | CreateObjRef | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from System.MarshalByRefObject)
Public Method | Deserialize | Deserialize a previously serialized object. (Inherited from Dart.Sockets.ComponentBase)
Public Method | Dispose | Overloaded. Overridden. Disposes of TcpBase and its associated resources.
Public Method | GetLifetimeService | Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | GetStream | Provides access to the underlying Stream.
Public Method | InitializeLifetimeService | Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | Marshal | Overloaded. Marshals data to the UI thread.
Public Method | Read | Overloaded. Receives data from the remote host.
Public Method | ReadAsync | Start an asynchronous read on the socket.
Public Method | ReadToCount | Read until count bytes are read, an exception is thrown, or the connection is closed.
Public Method | ReadToDelimiter | Overloaded. Read until the delimiter is found, an exception is thrown, or the connection is closed.
Public Method | ReadToEnd | Read until the connection is closed or an exception is thrown.
Public Method | Serialize | Serialize an object to the provided destination stream. (Inherited from Dart.Sockets.ComponentBase)
Public Method | ShutdownSsl | Signals the remote host to shutdown the SSL connection.
Public Method | ToString | (Inherited from System.ComponentModel.Component)
Public Method | Write | Overloaded. Sends data to the remote host.
Public Method | WriteAsync | Start an asynchronous write on the socket.
Top

Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from System.ComponentModel.Component)
Protected Method | GetService | (Inherited from System.ComponentModel.Component)
Protected Method | MemberwiseClone | Overloaded. Creates a shallow copy of the current System.MarshalByRefObject object. (Inherited from System.MarshalByRefObject)
Protected Method | OnData | Raises the Data event.
Protected Method | OnError | Raises the Error event. (Inherited from Dart.Sockets.ComponentBase)
Protected Method | OnLog | Raises the Log event.
Protected Method | OnStateChanged | Raises the StateChanged event.
Protected Method | OnUserState | Raises the UserState event. (Inherited from Dart.Sockets.ComponentBase)
Top

See Also

Reference

TcpBase Class
Dart.Sockets Namespace


Abort Method

[image]
PowerTCP Sockets for .NET
Abort Method
See Also Send comments on this topic
Dart.Sockets Namespace > TcpBase Class : Abort Method

Glossary Item Box

Performs a hard close of the connection.

Syntax

Visual Basic (Declaration)
Public Sub Abort()
Visual Basic (Usage) Copy Code
Dim instance As TcpBase

instance.Abort()
C#
public void Abort()
Managed Extensions for C++
public: void Abort();
C++/CLI
public:
void Abort();

Remarks

This method resets the connection and immediately clears the socket state.

See Also

Reference

TcpBase Class
TcpBase Members


AuthenticateAsClient Method

[image]
PowerTCP Sockets for .NET
AuthenticateAsClient Method
See Also Send comments on this topic
Dart.Sockets Namespace > TcpBase Class : AuthenticateAsClient Method

Glossary Item Box

Authenticates the server when establishing a secure connection.

Overload List

Overload | Description
AuthenticateAsClient(ClientSecurity) | Authenticates the server when establishing a secure connection.
AuthenticateAsClient(TcpSession) | Authenticates the server when establishing a secure connection.

See Also

Reference

TcpBase Class
TcpBase Members


AuthenticateAsClient(ClientSecurity) Method

[image]
PowerTCP Sockets for .NET
AuthenticateAsClient(ClientSecurity) Method
See Also Send comments on this topic
Dart.Sockets Namespace > TcpBase Class > AuthenticateAsClient Method : AuthenticateAsClient(ClientSecurity) Method

security
Security parameters used during authentication.

Glossary Item Box

Authenticates the server when establishing a secure connection.

Syntax

Visual Basic (Declaration)
<ObsoleteAttribute("Use AuthenticateAsClient(TcpSession) instead.")>
<SecuritySafeCriticalAttribute()>
Public Overloads Sub AuthenticateAsClient( _
   ByVal security As ClientSecurity _
)
Visual Basic (Usage) Copy Code
Dim instance As TcpBase
Dim security As ClientSecurity

instance.AuthenticateAsClient(security)
C#
[Obsolete("Use AuthenticateAsClient(TcpSession) instead.")]
[SecuritySafeCritical()]
public void AuthenticateAsClient(
   ClientSecurity security
)
Managed Extensions for C++
[Obsolete("Use AuthenticateAsClient(TcpSession) instead.")]
[SecuritySafeCritical()]
public: void AuthenticateAsClient(
   ClientSecurity* security
)
C++/CLI
[Obsolete("Use AuthenticateAsClient(TcpSession) instead.")]
[SecuritySafeCritical()]
public:
void AuthenticateAsClient(
   ClientSecurity^ security
)

Parameters

security
Security parameters used during authentication.

Remarks

The security.TargetHost should match the server certificate name. If authentication fails, an AuthenticationException will occur.

To accept or reject a certificate "on-the-fly" implement a ClientSecurity.ValidationCallback function.

To select a client certificate "on-the-fly" implement a ClientSecurity.SelectionCallback function.

See Also

Reference

TcpBase Class
TcpBase Members
Overload List


AuthenticateAsClient(TcpSession) Method

[image]
PowerTCP Sockets for .NET
AuthenticateAsClient(TcpSession) Method
See Also Example Send comments on this topic
Dart.Sockets Namespace > TcpBase Class > AuthenticateAsClient Method : AuthenticateAsClient(TcpSession) Method

session
Session parameters used during authentication.

Glossary Item Box

Authenticates the server when establishing a secure connection.

Syntax

Visual Basic (Declaration)
<SecuritySafeCriticalAttribute()>
Public Overloads Sub AuthenticateAsClient( _
   ByVal session As TcpSession _
)
Visual Basic (Usage) Copy Code
Dim instance As TcpBase
Dim session As TcpSession

instance.AuthenticateAsClient(session)
C#
[SecuritySafeCritical()]
public void AuthenticateAsClient(
   TcpSession session
)
Managed Extensions for C++
[SecuritySafeCritical()]
public: void AuthenticateAsClient(
   TcpSession* session
)
C++/CLI
[SecuritySafeCritical()]
public:
void AuthenticateAsClient(
   TcpSession^ session
)

Parameters

session
Session parameters used during authentication.

Remarks

Uses Session.RemoteEndPoint, TcpSession.Proxy and TcpSession.Security to specify Security.ValidationCallback, SelectionCallback, ClientSecurity.TargetHost, Certificates, Security.Protocols, and Security.CheckCertificateRevocation.

If session.Security.TargetHost is not specifed, then session.RemoteEndPoint.HostNameOrAddress will be used instead. session.Security.TargetHost should match the server certificate name. If authentication fails, an AuthenticationException will occur.

To accept or reject a certificate "on-the-fly" implement a TcpSession.Security.ValidationCallback function.

To select a client certificate "on-the-fly" implement a TcpSession.Security.SelectionCallback function.

Example

This example demonstrates the AuthenticateAsClient call, the callback that prompts for a local certificate, and the callback that executes when a certificate is received.
C# Copy Code
using System.Net.Security;
using System.Security.Authentication;
using System.Security.Cryptography.X509Certificates;

/// <summary>
/// Establishes SSL with the provided Tcp object. Typically called immediately after connecting to the server (implicit)
/// or after a command such as STARTTLS is sent to the server (explicit).
/// </summary>
/// <param name="myComponent">Object to establish SSL with</param>
/// <param name="session">The TcpSession object used for connecting to the server</param>
/// <param name="serverHostName">The name of the server</param>
/// <param name="protocols">Protocols the client will accept</param>
/// <param name="checkRevocation">Check certificate revocation list during authentication</param>
private void authenticateTcp(Tcp myComponent, TcpSession session, string serverHostName, SslProtocols protocols, bool checkRevocation)
{
    //Specify configuration and certificate callback function, and authenticate server
    //Specifying TargetHost is only necessary if TcpSession.RemoteEndPoint.HostNameOrAddress doesn't match the server's certificate
    session.Security.TargetHost = serverHostName;
    session.Security.Protocols = protocols;
    session.Security.CheckCertificateRevocation = checkRevocation;
    session.Security.ValidationCallback = certificateReceived;
    session.Security.SelectionCallback = selectLocalCertificate;
    myComponent.AuthenticateAsClient(session);
}

/// <summary>
/// Prompts the user to select a certificate for SSL authentication.
/// </summary>
/// <remarks>
/// This snippet assumes the presence of the Dart Test Certificate in the user's 'My' certificate store.
/// The Dart Test Certificate may be installed from the component's Start Menu program group.
/// For a UI-based certificate selection, please see the CertificateListForm included with our
/// WinForms samples.
/// </remarks>
/// <param name="targetHost">The host server specified by the client.</param>
/// <param name="localCertificates">A reference to ClientSecurity.Certificates</param>
/// <param name="remoteCertificate">The certificate used to authenticate the remote party.</param>
/// <param name="acceptableIssuers">A String array of certificate issuers acceptable to the remote party.</param>
/// <returns>An X509Certificate to use for establishing the SSL connection.</returns>
private X509Certificate selectLocalCertificate(Object sender, string targetHost,
    X509CertificateCollection localCertificates, X509Certificate remoteCertificate, string[] acceptableIssuers)
{
    //Try to find the Dart Test Certificate
    X509Store certificateStore = new X509Store(StoreName.My);
    certificateStore.Open(OpenFlags.ReadOnly);
    foreach (X509Certificate2 cert in certificateStore.Certificates)
        if (cert.GetNameInfo(X509NameType.SimpleName, true) == "DartdomCA")
        {
            certificateStore.Close();
            return cert;
        }
    //Certificate not found, return null
    return null;
}

/// <summary>
/// Presents the server's certificate for validation.
/// </summary>
/// <param name="certificate">The certificate presented by the server</param>
/// <param name="chain">The chain of certificate authorities associated with the remote certificate</param>
/// <param name="sslPolicyErrors">One or more errors associated with the server's certificate</param>
/// <returns>A Boolean value that specifies whether the presented certificate is accepted for authentication</returns>
private bool certificateReceived(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
{
    //Accept certificate if it passed standard validation.
    if (sslPolicyErrors == SslPolicyErrors.None)
        return true;

    string msg = "The server could not be validated for the following reason(s):";

    if ((sslPolicyErrors & SslPolicyErrors.RemoteCertificateNotAvailable) == SslPolicyErrors.RemoteCertificateNotAvailable)
        msg += Environment.NewLine + "    -The server did not present a certificate.";
    else
    {
        if ((sslPolicyErrors & SslPolicyErrors.RemoteCertificateNameMismatch) == SslPolicyErrors.RemoteCertificateNameMismatch)
            msg += Environment.NewLine + "    -Certificate name mismatch.";
        if ((sslPolicyErrors & SslPolicyErrors.RemoteCertificateChainErrors) == SslPolicyErrors.RemoteCertificateChainErrors)
        {
            msg += Environment.NewLine + "    -Certificate chain errors:" + Environment.NewLine;

            foreach (X509ChainStatus item in chain.ChainStatus)
                msg += "    --" + item.StatusInformation;
        }
    }

    //Prompt to override security check
    msg += Environment.NewLine + "Override security check?";
    if (MessageBox.Show(msg, "Security Alert: Server could not be validated", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes)
        return true;
    else
        return false;
}
Visual Basic Copy Code
Imports System.Net.Security
Imports System.Security.Authentication
Imports System.Security.Cryptography.X509Certificates

''' <summary>
''' Establishes SSL with the provided Tcp object. Typically called immediately after connecting to the server (implicit)
''' or after a command such as STARTTLS is sent to the server (explicit).
''' </summary>
''' <param name="myComponent">Object to establish SSL with</param>
''' <param name="session">The TcpSession object used for connecting to the server</param>
''' <param name="serverHostName">The name of the server</param>
''' <param name="protocols">Protocols the client will accept</param>
''' <param name="checkRevocation">Check certificate revocation list during authentication</param>
Private Sub authenticateTcp(ByVal myComponent As Tcp, ByVal session As TcpSession, ByVal serverHostName As String, ByVal protocols As SslProtocols, ByVal checkRevocation As Boolean)
    'Specify configuration and certificate callback function, and authenticate server
    'Specifying TargetHost is only necessary if TcpSession.RemoteEndPoint.HostNameOrAddress doesn't match the server's certificate
    session.Security.TargetHost = serverHostName
    session.Security.Protocols = protocols
    session.Security.CheckCertificateRevocation = checkRevocation
    session.Security.ValidationCallback = AddressOf certificateReceived
    session.Security.SelectionCallback = AddressOf selectLocalCertificate
    myComponent.AuthenticateAsClient(session)
End Sub

''' <summary>
''' Prompts the user to select a certificate for SSL authentication.
''' </summary>
''' <remarks>
''' This snippet assumes the presence of the Dart Test Certificate in the user's 'My' certificate store.
''' The Dart Test Certificate may be installed from the component's Start Menu program group.
''' For a UI-based certificate selection, please see the CertificateListForm included with our
''' WinForms samples.
''' </remarks>
''' <param name="targetHost">The host server specified by the client.</param>
''' <param name="localCertificates">A reference to ClientSecurity.Certificates</param>
''' <param name="remoteCertificate">The certificate used to authenticate the remote party.</param>
''' <param name="acceptableIssuers">A String array of certificate issuers acceptable to the remote party.</param>
''' <returns>An X509Certificate to use for establishing the SSL connection.</returns>
Private Function selectLocalCertificate(ByVal sender As Object, ByVal targetHost As String, ByVal localCertificates As X509CertificateCollection, ByVal remoteCertificate As X509Certificate, ByVal acceptableIssuers() As String) As X509Certificate
    'Try to find the Dart Test Certificate
    Dim certificateStore As New X509Store(StoreName.My)
    certificateStore.Open(OpenFlags.ReadOnly)
    For Each cert As X509Certificate2 In certificateStore.Certificates
        If cert.GetNameInfo(X509NameType.SimpleName, True) = "DartdomCA" Then
            certificateStore.Close()
            Return cert
        End If
    Next cert
    'Certificate not found, return null
    Return Nothing
End Function

''' <summary>
''' Presents the server's certificate for validation.
''' </summary>
''' <param name="certificate">The certificate presented by the server</param>
''' <param name="chain">The chain of certificate authorities associated with the remote certificate</param>
''' <param name="sslPolicyErrors">One or more errors associated with the server's certificate</param>
''' <returns>A Boolean value that specifies whether the presented certificate is accepted for authentication</returns>
Private Function certificateReceived(ByVal sender As Object, ByVal certificate As X509Certificate, ByVal chain As X509Chain, ByVal sslPolicyErrors As SslPolicyErrors) As Boolean
    'Accept certificate if it passed standard validation.
    If sslPolicyErrors = System.Net.Security.SslPolicyErrors.None Then
        Return True
    End If

    Dim msg As String = "The server could not be validated for the following reason(s):"

    If (sslPolicyErrors And System.Net.Security.SslPolicyErrors.RemoteCertificateNotAvailable) = System.Net.Security.SslPolicyErrors.RemoteCertificateNotAvailable Then
        msg &= Environment.NewLine & "    -The server did not present a certificate."
    Else
        If (sslPolicyErrors And System.Net.Security.SslPolicyErrors.RemoteCertificateNameMismatch) = System.Net.Security.SslPolicyErrors.RemoteCertificateNameMismatch Then
            msg &= Environment.NewLine & "    -Certificate name mismatch."
        End If
        If (sslPolicyErrors And System.Net.Security.SslPolicyErrors.RemoteCertificateChainErrors) = System.Net.Security.SslPolicyErrors.RemoteCertificateChainErrors Then
            msg &= Environment.NewLine & "    -Certificate chain errors:" & Environment.NewLine

            For Each item As X509ChainStatus In chain.ChainStatus
                msg &= "    --" & item.StatusInformation
            Next item
        End If
    End If

    'Prompt to override security check
    msg &= Environment.NewLine & "Override security check?"
    If MessageBox.Show(msg, "Security Alert: Server could not be validated", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) = System.Windows.Forms.DialogResult.Yes Then
        Return True
    Else
        Return False
    End If
End Function

See Also

Reference

TcpBase Class
TcpBase Members
Overload List


AuthenticateAsServer Method

[image]
PowerTCP Sockets for .NET
AuthenticateAsServer Method
See Also Example Send comments on this topic
Dart.Sockets Namespace > TcpBase Class : AuthenticateAsServer Method

security
Security parameters used during authentication.

Glossary Item Box

Authenticates a client when establishing a secure connection.

Syntax

Visual Basic (Declaration)
<SecuritySafeCriticalAttribute()>
Public Sub AuthenticateAsServer( _
   ByVal security As ServerSecurity _
)
Visual Basic (Usage) Copy Code
Dim instance As TcpBase
Dim security As ServerSecurity

instance.AuthenticateAsServer(security)
C#
[SecuritySafeCritical()]
public void AuthenticateAsServer(
   ServerSecurity security
)
Managed Extensions for C++
[SecuritySafeCritical()]
public: void AuthenticateAsServer(
   ServerSecurity* security
)
C++/CLI
[SecuritySafeCritical()]
public:
void AuthenticateAsServer(
   ServerSecurity^ security
)

Parameters

security
Security parameters used during authentication.

Remarks

To accept or reject a certificate "on-the-fly" implement a Security.ValidationCallback function.

Example

This example demonstrates AuthenticateAsServer().
C# Copy Code
using System.Net.Security;
using System.Security.Authentication;
using System.Security.Cryptography.X509Certificates;

/// <summary>
/// Object containing server security configuration
/// </summary>
ServerSecurity security = new ServerSecurity();

/// <summary>
/// Starts the server listening on port 7. server1_NewConnection will
/// be invoked on an IO completion thread as each clients connects.
/// </summary>
private void button1_Click(object sender, EventArgs e)
{
    //Select certificate and set client certificate validation callback
    ConfigSecurity();

    //Start the echo server on port 7
    server1.Start(server1_NewConnection, 7, null);
}

/// <summary>
/// Finds and loads the certificate used for authenticating the server, and sets the ValidationCallback.
/// </summary>
/// <remarks>
/// This snippet assumes the presence of the Dart Test Certificate in the user's 'My' certificate store.
/// The Dart Test Certificate may be installed from the component's Start Menu program group.
/// </remarks>
private void ConfigSecurity()
{
    //Try to find the Dart Test Certificate
    X509Store certificateStore = new X509Store(StoreName.My);
    certificateStore.Open(OpenFlags.ReadOnly);
    foreach (X509Certificate2 cert in certificateStore.Certificates)
        if (cert.GetNameInfo(X509NameType.SimpleName, true) == "DartdomCA")
        {
            security.Certificate = cert;
            break;
        }
    certificateStore.Close();

    security.ValidationCallback = ClientCertificateValidation;
}

/// <summary>
/// Invoked on an IO completion thread as each client connects.
/// </summary>
/// <param name="client">The connection to the client</param>
/// <param name="state">Used to pass in data from the 'state' parameter of Server.Start(). Not used in this snippet.</param>
private void server1_NewConnection(Tcp client, object state)
{
    //Establish SSL immediately after client connects. This is commonly known as implicit SSL.
    try
    {
        client.AuthenticateAsServer(security);
    }
    catch (Exception ex)
    {
        //If an error is encountered, disconnect the client. Otherwise the connection will remain open.
        client.Close();
        //Rethrow exception to be automatically marshaled to server1_Error event (not included in this snippet)
        throw ex;
    }

    //Implement protocol logic here, such as an echo server:
    byte[] buffer = new byte[1024];
    Data data = client.Read(buffer);
    while (data != null)
    {
        client.Write(data.Buffer, data.Offset, data.Count);
        data = client.Read(buffer);
    }
}

/// <summary>
/// Presents the client's certificate for validation.
/// </summary>
/// <param name="certificate">The certificate presented by the client.</param>
/// <param name="chain">The chain of certificate authorities associated with the remote certificate.</param>
/// <param name="sslPolicyErrors">One or more errors associated with the client's certificate.</param>
/// <returns>A Boolean value that specifies whether the provided certificate is accepted for authentication.</returns>
private bool ClientCertificateValidation(Object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
{
    //Accept all clients in this snippet. See the AuthenticateAsClient() snippet for a demonstration of examining sslPolicyErrors.
    return true;
}
Visual Basic Copy Code
Imports System.Net.Security
Imports System.Security.Authentication
Imports System.Security.Cryptography.X509Certificates

''' <summary>
''' Object containing server security configuration
''' </summary>
Private security As New ServerSecurity()

''' <summary>
''' Starts the server listening on port 7. server1_NewConnection will
''' be invoked on an IO completion thread as each clients connects.
''' </summary>
Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs)
    'Select certificate and set client certificate validation callback
    ConfigSecurity()

    'Start the echo server on port 7
    server1.Start(AddressOf server1_NewConnection, 7, Nothing)
End Sub

''' <summary>
''' Finds and loads the certificate used for authenticating the server, and sets the ValidationCallback.
''' </summary>
''' <remarks>
''' This snippet assumes the presence of the Dart Test Certificate in the user's 'My' certificate store.
''' The Dart Test Certificate may be installed from the component's Start Menu program group.
''' </remarks>
Private Sub ConfigSecurity()
    'Try to find the Dart Test Certificate
    Dim certificateStore As New X509Store(StoreName.My)
    certificateStore.Open(OpenFlags.ReadOnly)
    For Each cert As X509Certificate2 In certificateStore.Certificates
        If cert.GetNameInfo(X509NameType.SimpleName, True) = "DartdomCA" Then
            security.Certificate = cert
            Exit For
        End If
    Next cert
    certificateStore.Close()

    security.ValidationCallback = AddressOf ClientCertificateValidation
End Sub

''' <summary>
''' Invoked on an IO completion thread as each client connects.
''' </summary>
''' <param name="client">The connection to the client</param>
''' <param name="state">Used to pass in data from the 'state' parameter of Server.Start(). Not used in this snippet.</param>
Private Sub server1_NewConnection(ByVal client As Tcp, ByVal state As Object)
    'Establish SSL immediately after client connects. This is commonly known as implicit SSL.
    Try
        client.AuthenticateAsServer(security)
    Catch ex As Exception
        'If an error is encountered, disconnect the client. Otherwise the connection will remain open.
        client.Close()
        'Rethrow exception to be automatically marshaled to server1_Error event (not included in this snippet)
        Throw ex
    End Try

    'Implement protocol logic here, such as an echo server:
    Dim buffer(1023) As Byte
    Dim data As Data = client.Read(buffer)
    Do While data IsNot Nothing
        client.Write(data.Buffer, data.Offset, data.Count)
        data = client.Read(buffer)
    Loop
End Sub

''' <summary>
''' Presents the client's certificate for validation.
''' </summary>
''' <param name="certificate">The certificate presented by the client.</param>
''' <param name="chain">The chain of certificate authorities associated with the remote certificate.</param>
''' <param name="sslPolicyErrors">One or more errors associated with the client's certificate.</param>
''' <returns>A Boolean value that specifies whether the provided certificate is accepted for authentication.</returns>
Private Function ClientCertificateValidation(ByVal sender As Object, ByVal certificate As X509Certificate, ByVal chain As X509Chain, ByVal sslPolicyErrors As SslPolicyErrors) As Boolean
    'Accept all clients in this snippet. See the AuthenticateAsClient() snippet for a demonstration of examining sslPolicyErrors.
    Return True
End Function

See Also

Reference

TcpBase Class
TcpBase Members


Close() Method

[image]
PowerTCP Sockets for .NET
Close() Method
See Also Send comments on this topic
Dart.Sockets Namespace > TcpBase Class : Close() Method

Glossary Item Box

Gracefully closes the connection.

Syntax

Visual Basic (Declaration)
Public Overridable Sub Close()
Visual Basic (Usage) Copy Code
Dim instance As TcpBase

instance.Close()
C#
public virtual void Close()
Managed Extensions for C++
public: virtual void Close();
C++/CLI
public:
virtual void Close();

Remarks

This method enters a normal TIME_WAIT state after the connection is closed.

See Also

Reference

TcpBase Class
TcpBase Members


Connect Method

[image]
PowerTCP Sockets for .NET
Connect Method
See Also Send comments on this topic
Dart.Sockets Namespace > TcpBase Class : Connect Method

session
Used to specify the local and remote endpoints, and proxy configuration.

Glossary Item Box

Connect to a server using the configuration specified by session.

Syntax

Visual Basic (Declaration)
Public Sub Connect( _
   ByVal session As TcpSession _
)
Visual Basic (Usage) Copy Code
Dim instance As TcpBase
Dim session As TcpSession

instance.Connect(session)
C#
public void Connect(
   TcpSession session
)
Managed Extensions for C++
public: void Connect(
   TcpSession* session
)
C++/CLI
public:
void Connect(
   TcpSession^ session
)

Parameters

session
Used to specify the local and remote endpoints, and proxy configuration.

See Also

Reference

TcpBase Class
TcpBase Members


ConnectAsync Method

[image]
PowerTCP Sockets for .NET
ConnectAsync Method
See Also Send comments on this topic
Dart.Sockets Namespace > TcpBase Class : ConnectAsync Method

session
Used to specify the local and remote endpoints, and proxy configuration.
callback
A TcpAsyncCallback delegate referencing the method to invoke on an IO completion thread when the operation completes.
state
Object to pass into the callback method when the operation completes; can be null.

Glossary Item Box

Connect to a server using the configuration specified by session.

Syntax

Visual Basic (Declaration)
Public Sub ConnectAsync( _
   ByVal session As TcpSession, _
   ByVal callback As TcpAsyncCallback, _
   ByVal state As Object _
)
Visual Basic (Usage) Copy Code
Dim instance As TcpBase
Dim session As TcpSession
Dim callback As TcpAsyncCallback
Dim state As Object

instance.ConnectAsync(session, callback, state)
C#
public void ConnectAsync(
   TcpSession session,
   TcpAsyncCallback callback,
   object state
)
Managed Extensions for C++
public: void ConnectAsync(
   TcpSession* session,
   TcpAsyncCallback* callback,
   Object* state
)
C++/CLI
public:
void ConnectAsync(
   TcpSession^ session,
   TcpAsyncCallback^ callback,
   Object^ state
)

Parameters

session
Used to specify the local and remote endpoints, and proxy configuration.
callback
A TcpAsyncCallback delegate referencing the method to invoke on an IO completion thread when the operation completes.
state
Object to pass into the callback method when the operation completes; can be null.

See Also

Reference

TcpBase Class
TcpBase Members


Dispose Method

[image]
PowerTCP Sockets for .NET
Dispose Method
See Also Send comments on this topic
Dart.Sockets Namespace > TcpBase Class : Dispose Method

Glossary Item Box

Disposes of TcpBase and its associated resources.

Overload List

Overload | Description
Dispose(Boolean) | Disposes of TcpBase and its associated resources.
Dispose() | (Inherited from System.ComponentModel.Component)

See Also

Reference

TcpBase Class
TcpBase Members


Dispose(Boolean) Method

[image]
PowerTCP Sockets for .NET
Dispose(Boolean) Method
See Also Send comments on this topic
Dart.Sockets Namespace > TcpBase Class > Dispose Method : Dispose(Boolean) Method

disposing

Glossary Item Box

Disposes of TcpBase and its associated resources.

Syntax

Visual Basic (Declaration)
Protected Overloads Overrides Sub Dispose( _
   ByVal disposing As Boolean _
)
Visual Basic (Usage) Copy Code
Dim instance As TcpBase
Dim disposing As Boolean

instance.Dispose(disposing)
C#
protected override void Dispose(
   bool disposing
)
Managed Extensions for C++
protected: void Dispose(
   bool disposing
) override
C++/CLI
protected:
void Dispose(
   bool disposing
) override

Parameters

disposing

See Also

Reference

TcpBase Class
TcpBase Members
Overload List


GetStream Method

[image]
PowerTCP Sockets for .NET
GetStream Method
See Also Send comments on this topic
Dart.Sockets Namespace > TcpBase Class : GetStream Method

Glossary Item Box

Provides access to the underlying Stream.

Syntax

Visual Basic (Declaration)
Public Overridable Function GetStream() As Stream
Visual Basic (Usage) Copy Code
Dim instance As TcpBase
Dim value As Stream

value = instance.GetStream()
C#
public virtual Stream GetStream()
Managed Extensions for C++
public: virtual Stream* GetStream();
C++/CLI
public:
virtual Stream^ GetStream();

Return Value

The underlying Stream object used by the component.

Remarks

Derived classes can override this method to provide a stream that implements an upper-layer protocol.

See Also

Reference

TcpBase Class
TcpBase Members


Marshal Method

[image]
PowerTCP Sockets for .NET
Marshal Method
See Also Send comments on this topic
Dart.Sockets Namespace > TcpBase Class : Marshal Method

Glossary Item Box

Marshals data to the UI thread.

Overload List

Overload | Description
Marshal(Data,String,Object) | Marshals data to the UI thread.
Marshal(String,Object) | Marshals a string and/or object to the UI thread and raises the UserState event. (Inherited from Dart.Sockets.ComponentBase)
Marshal(Exception) | Marshals an exception to the UI thread and raises the Error event. (Inherited from Dart.Sockets.ComponentBase)

See Also

Reference

TcpBase Class
TcpBase Members


Marshal(Data,String,Object) Method

[image]
PowerTCP Sockets for .NET
Marshal(Data,String,Object) Method
See Also Example Send comments on this topic
Dart.Sockets Namespace > TcpBase Class > Marshal Method : Marshal(Data,String,Object) Method

data
Data to be marshaled.
message
Text message to be marshaled.
state
State information to be marshaled.

Glossary Item Box

Marshals data to the UI thread.

Syntax

Visual Basic (Declaration)
Public Overloads Sub Marshal( _
   ByVal data As Data, _
   ByVal message As String, _
   ByVal state As Object _
)
Visual Basic (Usage) Copy Code
Dim instance As TcpBase
Dim data As Data
Dim message As String
Dim state As Object

instance.Marshal(data, message, state)
C#
public void Marshal(
   Data data,
   string message,
   object state
)
Managed Extensions for C++
public: void Marshal(
   Data* data,
   string* message,
   Object* state
)
C++/CLI
public:
void Marshal(
   Data^ data,
   String^ message,
   Object^ state
)

Parameters

data
Data to be marshaled.
message
Text message to be marshaled.
state
State information to be marshaled.

Remarks

This method is used to marshal data from a worker thread to the UI thread for typical display purposes. It calls the OnData method, which raises the Data event.

See the SynchronizingObject property for information on updating UI controls in your event handler.

Example

This example demonstrates execution of a looping Read on a worker thread, and marshaling the data to the UI.
C# Copy Code
private void button1_Click(object sender, EventArgs e)
{
    myComponent.Start(readLoopWorker, null);
}

private void readLoopWorker(object state)
{
    byte[] buffer = new byte[1024];
    Data data = myComponent.Read(buffer);
    while (data != null)
    {
        myComponent.Marshal(data, "", null);
        data = myComponent.Read(buffer);
    }
    myComponent.Close();
}

void myComponent_Data(object sender, Dart.Sockets.DataEventArgs e)
{
    textBox1.AppendText(e.Data.ToString());
}
Visual Basic Copy Code
Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs)
    myComponent.Start(AddressOf readLoopWorker, Nothing)
End Sub

Private Sub readLoopWorker(ByVal state As Object)
    Dim buffer(1023) As Byte
    Dim data As Data = myComponent.Read(buffer)
    Do While data IsNot Nothing
        myComponent.Marshal(data, "", Nothing)
        data = myComponent.Read(buffer)
    Loop
    myComponent.Close()
End Sub

Private Sub myComponent_Data(ByVal sender As Object, ByVal e As Dart.Sockets.DataEventArgs)
    textBox1.AppendText(e.Data.ToString())
End Sub

See Also

Reference

TcpBase Class
TcpBase Members
Overload List


OnData Method

[image]
PowerTCP Sockets for .NET
OnData Method
See Also Send comments on this topic
Dart.Sockets Namespace > TcpBase Class : OnData Method

e
A DataEventArgs object that contains the event data.

Glossary Item Box

Raises the Data event.

Syntax

Visual Basic (Declaration)
Protected Overridable Sub OnData( _
   ByVal e As DataEventArgs _
)
Visual Basic (Usage) Copy Code
Dim instance As TcpBase
Dim e As DataEventArgs

instance.OnData(e)
C#
protected virtual void OnData(
   DataEventArgs e
)
Managed Extensions for C++
protected: virtual void OnData(
   DataEventArgs* e
)
C++/CLI
protected:
virtual void OnData(
   DataEventArgs^ e
)

Parameters

e
A DataEventArgs object that contains the event data.

Remarks

If the Synchronizing property is set, this method synchronously invokes the Data event on the UI thread. If the Synchronizing property is null, this method invokes the event on the executing thread.

The OnData method allows derived classes to handle the event without attaching a delegate, but marshaling is not provided. This is the preferred technique for handling the event in a derived class.

Note to Inheritors: When overriding OnData in a derived class, be sure to call the base class OnData method, so that registered delegates receive the event.

See the SynchronizingObject property for information on updating UI controls in your event handler.

See Also

Reference

TcpBase Class
TcpBase Members


OnLog Method

[image]
PowerTCP Sockets for .NET
OnLog Method
See Also Send comments on this topic
Dart.Sockets Namespace > TcpBase Class : OnLog Method

e
A DataEventArgs object containing data to log.

Glossary Item Box

Raises the Log event.

Syntax

Visual Basic (Declaration)
Protected Overridable Sub OnLog( _
   ByVal e As DataEventArgs _
)
Visual Basic (Usage) Copy Code
Dim instance As TcpBase
Dim e As DataEventArgs

instance.OnLog(e)
C#
protected virtual void OnLog(
   DataEventArgs e
)
Managed Extensions for C++
protected: virtual void OnLog(
   DataEventArgs* e
)
C++/CLI
protected:
virtual void OnLog(
   DataEventArgs^ e
)

Parameters

e
A DataEventArgs object containing data to log.

Remarks

If the Synchronizing property is set, this method asynchronously invokes the event on the UI thread. If the Synchronizing property is null, this method invokes the event on the executing thread.

The OnLog method allows derived classes to handle the event without attaching a delegate, but marshaling is not provided. This is the preferred technique for handling the event in a derived class.

Note to Inheritors: When overriding OnLog in a derived class, be sure to call the base class OnLog method, so that registered delegates receive the event.

See the SynchronizingObject property for information on updating UI controls in your event handler.

See Also

Reference

TcpBase Class
TcpBase Members


OnStateChanged Method

[image]
PowerTCP Sockets for .NET
OnStateChanged Method
See Also Send comments on this topic
Dart.Sockets Namespace > TcpBase Class : OnStateChanged Method

e
An EventArgs.

Glossary Item Box

Raises the StateChanged event.

Syntax

Visual Basic (Declaration)
Protected Overridable Sub OnStateChanged( _
   ByVal e As EventArgs _
)
Visual Basic (Usage) Copy Code
Dim instance As TcpBase
Dim e As EventArgs

instance.OnStateChanged(e)
C#
protected virtual void OnStateChanged(
   EventArgs e
)
Managed Extensions for C++
protected: virtual void OnStateChanged(
   EventArgs* e
)
C++/CLI
protected:
virtual void OnStateChanged(
   EventArgs^ e
)

Parameters

e
An EventArgs.

Remarks

If the Synchronizing property is set, this method synchronously invokes the event on the UI thread. If the Synchronizing property is null, this method invokes the event on the executing thread.

The OnStateChanged method allows derived classes to handle the event without attaching a delegate, but marshaling is not provided. This is the preferred technique for handling the event in a derived class.

Note to Inheritors: When overriding OnStateChanged in a derived class, be sure to call the base class OnStateChanged method, so that registered delegates receive the event.

See the SynchronizingObject property for information on updating UI controls in your event handler.

See Also

Reference

TcpBase Class
TcpBase Members


Read Method

[image]
PowerTCP Sockets for .NET
Read Method
See Also Send comments on this topic
Dart.Sockets Namespace > TcpBase Class : Read Method

Glossary Item Box

Receives data from the remote host.

Overload List

Overload | Description
Read(Byte[],Int32,Int32) | Receives data from the remote host.
Read(Byte[]) | Receives data from the remote host.

See Also

Reference

TcpBase Class
TcpBase Members


Read(Byte[],Int32,Int32) Method

[image]
PowerTCP Sockets for .NET
Read(Byte[],Int32,Int32) Method
See Also Send comments on this topic
Dart.Sockets Namespace > TcpBase Class > Read Method : Read(Byte[],Int32,Int32) Method

buffer
The byte array used to store the received data.
offset
The position in the buffer to store the data.
count
The maximum number of bytes to receive.

Glossary Item Box

Receives data from the remote host.

Syntax

Visual Basic (Declaration)
Public Overloads Function Read( _
   ByVal buffer() As Byte, _
   ByVal offset As Integer, _
   ByVal count As Integer _
) As Data
Visual Basic (Usage) Copy Code
Dim instance As TcpBase
Dim buffer() As Byte
Dim offset As Integer
Dim count As Integer
Dim value As Data

value = instance.Read(buffer, offset, count)
C#
public Data Read(
   byte[] buffer,
   int offset,
   int count
)
Managed Extensions for C++
public: Data* Read(
   byte[]* buffer,
   int offset,
   int count
)
C++/CLI
public:
Data^ Read(
   array<byte>^ buffer,
   int offset,
   int count
)

Parameters

buffer
The byte array used to store the received data.
offset
The position in the buffer to store the data.
count
The maximum number of bytes to receive.

Return Value

A Data object encapsulating the received data. Returns null if the socket is closed.

Remarks

This method performs a single socket read, blocking until at least one byte is read, up to as much data as is available on the socket, count bytes, or buffer.Length, whichever is lowest. A SocketException indicating SocketError.Timeout will not result in the socket being closed; other SocketExceptions are fatal and the socket is automatically closed by the class.

The ReceiveTimeout property controls how long this method will block before throwing a Timeout exception.

See Also

Reference

TcpBase Class
TcpBase Members
Overload List


Read(Byte[]) Method

[image]
PowerTCP Sockets for .NET
Read(Byte[]) Method
See Also Example Send comments on this topic
Dart.Sockets Namespace > TcpBase Class > Read Method : Read(Byte[]) Method

buffer
The byte array used to store the received data.

Glossary Item Box

Receives data from the remote host.

Syntax

Visual Basic (Declaration)
Public Overloads Function Read( _
   ByVal buffer() As Byte _
) As Data
Visual Basic (Usage) Copy Code
Dim instance As TcpBase
Dim buffer() As Byte
Dim value As Data

value = instance.Read(buffer)
C#
public Data Read(
   byte[] buffer
)
Managed Extensions for C++
public: Data* Read(
   byte[]* buffer
)
C++/CLI
public:
Data^ Read(
   array<byte>^ buffer
)

Parameters

buffer
The byte array used to store the received data.

Return Value

A Data object encapsulating the received data. Returns null if the socket is closed.

Remarks

This method performs a single socket read, blocking until at least one byte is read, up to as much data as is available on the socket or buffer.Length, whichever is lowest.

This method will block until data is available or the ReceiveTimeout has expired.

Example

This example demonstrates execution of a looping Read on a worker thread, and marshaling the data to the UI.
C# Copy Code
private void button1_Click(object sender, EventArgs e)
{
    myComponent.Start(readLoopWorker, null);
}

private void readLoopWorker(object state)
{
    byte[] buffer = new byte[1024];
    Data data = myComponent.Read(buffer);
    while (data != null)
    {
        myComponent.Marshal(data, "", null);
        data = myComponent.Read(buffer);
    }
    myComponent.Close();
}

void myComponent_Data(object sender, Dart.Sockets.DataEventArgs e)
{
    textBox1.AppendText(e.Data.ToString());
}
Visual Basic Copy Code
Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs)
    myComponent.Start(AddressOf readLoopWorker, Nothing)
End Sub

Private Sub readLoopWorker(ByVal state As Object)
    Dim buffer(1023) As Byte
    Dim data As Data = myComponent.Read(buffer)
    Do While data IsNot Nothing
        myComponent.Marshal(data, "", Nothing)
        data = myComponent.Read(buffer)
    Loop
    myComponent.Close()
End Sub

Private Sub myComponent_Data(ByVal sender As Object, ByVal e As Dart.Sockets.DataEventArgs)
    textBox1.AppendText(e.Data.ToString())
End Sub

See Also

Reference

TcpBase Class
TcpBase Members
Overload List


ReadAsync Method

[image]
PowerTCP Sockets for .NET
ReadAsync Method
See Also Example Send comments on this topic
Dart.Sockets Namespace > TcpBase Class : ReadAsync Method

buffer
The byte array used to store the received data.
offset
The position in the buffer to store the data.
count
The maximum number of bytes to receive.
callback
A TcpAsyncCallback delegate referencing the method to invoke on an IO completion thread when the operation completes.
state
Object to pass into the callback method when the operation completes; can be null.

Glossary Item Box

Start an asynchronous read on the socket.

Syntax

Visual Basic (Declaration)
Public Sub ReadAsync( _
   ByVal buffer() As Byte, _
   ByVal offset As Integer, _
   ByVal count As Integer, _
   ByVal callback As TcpAsyncCallback, _
   ByVal state As Object _
)
Visual Basic (Usage) Copy Code
Dim instance As TcpBase
Dim buffer() As Byte
Dim offset As Integer
Dim count As Integer
Dim callback As TcpAsyncCallback
Dim state As Object

instance.ReadAsync(buffer, offset, count, callback, state)
C#
public void ReadAsync(
   byte[] buffer,
   int offset,
   int count,
   TcpAsyncCallback callback,
   object state
)
Managed Extensions for C++
public: void ReadAsync(
   byte[]* buffer,
   int offset,
   int count,
   TcpAsyncCallback* callback,
   Object* state
)
C++/CLI
public:
void ReadAsync(
   array<byte>^ buffer,
   int offset,
   int count,
   TcpAsyncCallback^ callback,
   Object^ state
)

Parameters

buffer
The byte array used to store the received data.
offset
The position in the buffer to store the data.
count
The maximum number of bytes to receive.
callback
A TcpAsyncCallback delegate referencing the method to invoke on an IO completion thread when the operation completes.
state
Object to pass into the callback method when the operation completes; can be null.

Remarks

The TCP component is typically used by making blocking calls on a worker (non-UI) thread. This technique keeps development simple as there is no need for saving state information, but does require a dedicated thread for each connection. If a dedicated worker thread for each socket is not scalable enough, such as in server applications, developers can instead use the Async methods which utilize IO completion ports. The Async methods do not require a dedicated worker thread for each connection, and the specified callback is invoked on an IO completion thread when the operation completes. This is the best way to create a high-performance server without using dedicated worker threads.

Example

The following example demonstrates an echo server using asynchronous read and write methods that utilize IO completion ports.
C# Copy Code
private void button1_Click(object sender, EventArgs e)
{
    //Start the echo server on port 7
    server1.Start(server1_NewConnection, 7, null);
}

private void server1_NewConnection(Tcp client, object state)
{
    //Read first data sent by client
    byte[] buffer = new byte[1024];
    client.ReadAsync(buffer, 0, buffer.Length, client_ReadAsyncCompleted, null);
}

private void client_ReadAsyncCompleted(TcpBase client, Data data, Exception ex, object state)
{
    //Echo data received back to client.
    //Data is null if client is not connected.
    if (data != null)
        client.WriteAsync(data.Buffer, data.Offset, data.Count, client_WriteAsyncCompleted, null);
}

private void client_WriteAsyncCompleted(TcpBase client, Data data, Exception ex, object state)
{
    //Read for more data.
    client.ReadAsync(data.Buffer, 0, data.Buffer.Length, client_ReadAsyncCompleted, null);
}
Visual Basic Copy Code
Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs)
    'Start the echo server on port 7
    server1.Start(AddressOf server1_NewConnection, 7, Nothing)
End Sub

Private Sub server1_NewConnection(ByVal client As Tcp, ByVal state As Object)
    'Read first data sent by client
    Dim buffer(1023) As Byte
    client.ReadAsync(buffer, 0, buffer.Length, AddressOf client_ReadAsyncCompleted, Nothing)
End Sub

Private Sub client_ReadAsyncCompleted(ByVal client As TcpBase, ByVal data As Data, ByVal ex As Exception, ByVal state As Object)
    'Echo data received back to client.
    'Data is null if client is not connected.
    If data IsNot Nothing Then
        client.WriteAsync(data.Buffer, data.Offset, data.Count, AddressOf client_WriteAsyncCompleted, Nothing)
    End If
End Sub

Private Sub client_WriteAsyncCompleted(ByVal client As TcpBase, ByVal data As Data, ByVal ex As Exception, ByVal state As Object)
    'Read for more data.
    client.ReadAsync(data.Buffer, 0, data.Buffer.Length, AddressOf client_ReadAsyncCompleted, Nothing)
End Sub

See Also

Reference

TcpBase Class
TcpBase Members


ReadToCount Method

[image]
PowerTCP Sockets for .NET
ReadToCount Method
See Also Send comments on this topic
Dart.Sockets Namespace > TcpBase Class : ReadToCount Method

buffer
The byte array used to store the received data.
offset
The position in the buffer to store the data.
count
The number of byte to read.

Glossary Item Box

Read until count bytes are read, an exception is thrown, or the connection is closed.

Syntax

Visual Basic (Declaration)
Public Function ReadToCount( _
   ByVal buffer() As Byte, _
   ByVal offset As Integer, _
   ByVal count As Integer _
) As Data
Visual Basic (Usage) Copy Code
Dim instance As TcpBase
Dim buffer() As Byte
Dim offset As Integer
Dim count As Integer
Dim value As Data

value = instance.ReadToCount(buffer, offset, count)
C#
public Data ReadToCount(
   byte[] buffer,
   int offset,
   int count
)
Managed Extensions for C++
public: Data* ReadToCount(
   byte[]* buffer,
   int offset,
   int count
)
C++/CLI
public:
Data^ ReadToCount(
   array<byte>^ buffer,
   int offset,
   int count
)

Parameters

buffer
The byte array used to store the received data.
offset
The position in the buffer to store the data.
count
The number of byte to read.

Return Value

A Data object encapsulating the received data.

Exceptions

Exception | Description
DataException | Count bytes could not be read. The DataException.DataRead property contains any data received before the failure occurred.

Remarks

If a DataException is thrown, the DataException.DataRead property contains any data received prior to the exception.

See Also

Reference

TcpBase Class
TcpBase Members


ReadToDelimiter Method

[image]
PowerTCP Sockets for .NET
ReadToDelimiter Method
See Also Send comments on this topic
Dart.Sockets Namespace > TcpBase Class : ReadToDelimiter Method

Glossary Item Box

Read until the delimiter is found, an exception is thrown, or the connection is closed.

Overload List

Overload | Description
ReadToDelimiter(String) | Read until the delimiter is found, an exception is thrown, or the connection is closed.
ReadToDelimiter(Byte[]) | Read until the delimiter is found, an exception is thrown, or the connection is closed.
ReadToDelimiter(String[]) | Read until a delimiter is found, an exception is thrown, or the connection is closed.
ReadToDelimiter(List<Byte[]>) | Read until a delimiter is found, an exception is thrown, or the connection is closed.

See Also

Reference

TcpBase Class
TcpBase Members


ReadToDelimiter(String) Method

[image]
PowerTCP Sockets for .NET
ReadToDelimiter(String) Method
See Also Send comments on this topic
Dart.Sockets Namespace > TcpBase Class > ReadToDelimiter Method : ReadToDelimiter(String) Method

delimiter
A delimiter to search for.

Glossary Item Box

Read until the delimiter is found, an exception is thrown, or the connection is closed.

Syntax

Visual Basic (Declaration)
Public Overloads Function ReadToDelimiter( _
   ByVal delimiter As String _
) As Data
Visual Basic (Usage) Copy Code
Dim instance As TcpBase
Dim delimiter As String
Dim value As Data

value = instance.ReadToDelimiter(delimiter)
C#
public Data ReadToDelimiter(
   string delimiter
)
Managed Extensions for C++
public: Data* ReadToDelimiter(
   string* delimiter
)
C++/CLI
public:
Data^ ReadToDelimiter(
   String^ delimiter
)

Parameters

delimiter
A delimiter to search for.

Return Value

A Data object encapsulating the received data.

Exceptions

Exception | Description
DataException | The delimiter was not found. The DataException.DataRead property contains any data received before the failure occurred.

Remarks

This method blocks until the delimiter is found, an exception is thrown, or the server closes the connection. The value of Data.Delimiter is set to the found delimiter, if any.

If a DataException is thrown, the DataException.DataRead property contains any data received prior to the exception.

See Also

Reference

TcpBase Class
TcpBase Members
Overload List


ReadToDelimiter(Byte[]) Method

[image]
PowerTCP Sockets for .NET
ReadToDelimiter(Byte[]) Method
See Also Send comments on this topic
Dart.Sockets Namespace > TcpBase Class > ReadToDelimiter Method : ReadToDelimiter(Byte[]) Method

delimiter
The delimiter to search for.

Glossary Item Box

Read until the delimiter is found, an exception is thrown, or the connection is closed.

Syntax

Visual Basic (Declaration)
Public Overloads Function ReadToDelimiter( _
   ByVal delimiter() As Byte _
) As Data
Visual Basic (Usage) Copy Code
Dim instance As TcpBase
Dim delimiter() As Byte
Dim value As Data

value = instance.ReadToDelimiter(delimiter)
C#
public Data ReadToDelimiter(
   byte[] delimiter
)
Managed Extensions for C++
public: Data* ReadToDelimiter(
   byte[]* delimiter
)
C++/CLI
public:
Data^ ReadToDelimiter(
   array<byte>^ delimiter
)

Parameters

delimiter
The delimiter to search for.

Return Value

A Data object encapsulating the received data.

Exceptions

Exception | Description
DataException | The delimiter was not found. The DataException.DataRead property contains any data received before the failure occurred.

Remarks

This method blocks until the delimiter is found, an exception is thrown, or the server closes the connection. The value of Data.Delimiter is set to the found delimiter, if any.

If a DataException is thrown, the DataException.DataRead property contains any data received prior to the exception.

See Also

Reference

TcpBase Class
TcpBase Members
Overload List


ReadToDelimiter(String[]) Method

[image]
PowerTCP Sockets for .NET
ReadToDelimiter(String[]) Method
See Also Send comments on this topic
Dart.Sockets Namespace > TcpBase Class > ReadToDelimiter Method : ReadToDelimiter(String[]) Method

delimiters
An array of delimiters to search for.

Glossary Item Box

Read until a delimiter is found, an exception is thrown, or the connection is closed.

Syntax

Visual Basic (Declaration)
Public Overloads Function ReadToDelimiter( _
   ByVal delimiters() As String _
) As Data
Visual Basic (Usage) Copy Code
Dim instance As TcpBase
Dim delimiters() As String
Dim value As Data

value = instance.ReadToDelimiter(delimiters)
C#
public Data ReadToDelimiter(
   string[] delimiters
)
Managed Extensions for C++
public: Data* ReadToDelimiter(
   string*[]* delimiters
)
C++/CLI
public:
Data^ ReadToDelimiter(
   array<String^>^ delimiters
)

Parameters

delimiters
An array of delimiters to search for.

Return Value

Data object encapsulating the received data.

Exceptions

Exception | Description
DataException | The delimiter was not found. The DataException.DataRead property contains any data received before the failure occurred.

Remarks

This method blocks until a delimiter is found, an exception is thrown, or the server closes the connection. The value of Data.Delimiter is set to the found delimiter, if any.

If a DataException is thrown, the DataException.DataRead property contains any data received prior to the exception.

See Also

Reference

TcpBase Class
TcpBase Members
Overload List


ReadToDelimiter(List<Byte[]>) Method

[image]
PowerTCP Sockets for .NET
ReadToDelimiter(List<Byte[]>) Method
See Also Send comments on this topic
Dart.Sockets Namespace > TcpBase Class > ReadToDelimiter Method : ReadToDelimiter(List<Byte[]>) Method

delimiters
A list of delimiters to search for.

Glossary Item Box

Read until a delimiter is found, an exception is thrown, or the connection is closed.

Syntax

Visual Basic (Declaration)
Public Overloads Function ReadToDelimiter( _
   ByVal delimiters As List(Of Byte()) _
) As Data
Visual Basic (Usage) Copy Code
Dim instance As TcpBase
Dim delimiters As List(Of Byte())
Dim value As Data

value = instance.ReadToDelimiter(delimiters)
C#
public Data ReadToDelimiter(
   List<byte[]> delimiters
)
Managed Extensions for C++
public: Data* ReadToDelimiter(
   List<byte[]>* delimiters
)
C++/CLI
public:
Data^ ReadToDelimiter(
   List<array<byte>>^ delimiters
)

Parameters

delimiters
A list of delimiters to search for.

Return Value

A Data object encapsulating the received data.

Exceptions

Exception | Description
DataException | The delimiter was not found. The DataException.DataRead property contains any data received before the failure occurred.

Remarks

This method blocks until a delimiter is found, an exception is thrown, or the server closes the connection. The value of Data.Delimiter is set to the found delimiter, if any.

If a DataException is thrown, the DataException.DataRead property contains any data received prior to the exception.

See Also

Reference

TcpBase Class
TcpBase Members
Overload List


ReadToEnd Method

[image]
PowerTCP Sockets for .NET
ReadToEnd Method
See Also Send comments on this topic
Dart.Sockets Namespace > TcpBase Class : ReadToEnd Method

Glossary Item Box

Read until the connection is closed or an exception is thrown.

Syntax

Visual Basic (Declaration)
Public Function ReadToEnd() As Data
Visual Basic (Usage) Copy Code
Dim instance As TcpBase
Dim value As Data

value = instance.ReadToEnd()
C#
public Data ReadToEnd()
Managed Extensions for C++
public: Data* ReadToEnd();
C++/CLI
public:
Data^ ReadToEnd();

Return Value

A Data object encapsulating the received data. Returns null if the socket is closed.

Exceptions

Exception | Description
DataException | A failure occurred before the normal end of stream was found. The DataException.DataRead property contains any data received before the failure occurred.

Remarks

If a DataException is thrown, the DataException.DataRead property contains any data received prior to the exception.

See Also

Reference

TcpBase Class
TcpBase Members


ShutdownSsl Method

[image]
PowerTCP Sockets for .NET
ShutdownSsl Method
See Also Send comments on this topic
Dart.Sockets Namespace > TcpBase Class : ShutdownSsl Method

Glossary Item Box

Signals the remote host to shutdown the SSL connection.

Syntax

Visual Basic (Declaration)
Public Sub ShutdownSsl()
Visual Basic (Usage) Copy Code
Dim instance As TcpBase

instance.ShutdownSsl()
C#
public void ShutdownSsl()
Managed Extensions for C++
public: void ShutdownSsl();
C++/CLI
public:
void ShutdownSsl();

Remarks

This method provides a means for switching a secure connection to a non-secure connection.

See Also

Reference

TcpBase Class
TcpBase Members


Write Method

[image]
PowerTCP Sockets for .NET
Write Method
See Also Send comments on this topic
Dart.Sockets Namespace > TcpBase Class : Write Method

Glossary Item Box

Sends data to the remote host.

Overload List

Overload | Description
Write(Byte[]) | Sends data to the remote host.
Write(String) | Sends data to the remote host.
Write(Byte[],Int32,Int32) | Sends data to the remote host.

See Also

Reference

TcpBase Class
TcpBase Members


Write(Byte[]) Method

[image]
PowerTCP Sockets for .NET
Write(Byte[]) Method
See Also Send comments on this topic
Dart.Sockets Namespace > TcpBase Class > Write Method : Write(Byte[]) Method

buffer
Byte array of data to send.

Glossary Item Box

Sends data to the remote host.

Syntax

Visual Basic (Declaration)
Public Overloads Function Write( _
   ByVal buffer() As Byte _
) As Data
Visual Basic (Usage) Copy Code
Dim instance As TcpBase
Dim buffer() As Byte
Dim value As Data

value = instance.Write(buffer)
C#
public Data Write(
   byte[] buffer
)
Managed Extensions for C++
public: Data* Write(
   byte[]* buffer
)
C++/CLI
public:
Data^ Write(
   array<byte>^ buffer
)

Parameters

buffer
Byte array of data to send.

Return Value

A Data object encapsulating the sent data. Returns null if the socket is closed.

Remarks

This method synchronously sends data to the remote host over an existing connection. It will block until a buffer is available to accept the data or SocketOption.SendTimeout has expired.

See Also

Reference

TcpBase Class
TcpBase Members
Overload List


Write(String) Method

[image]
PowerTCP Sockets for .NET
Write(String) Method
See Also Send comments on this topic
Dart.Sockets Namespace > TcpBase Class > Write Method : Write(String) Method

data
String of data to send.

Glossary Item Box

Sends data to the remote host.

Syntax

Visual Basic (Declaration)
Public Overloads Function Write( _
   ByVal data As String _
) As Data
Visual Basic (Usage) Copy Code
Dim instance As TcpBase
Dim data As String
Dim value As Data

value = instance.Write(data)
C#
public Data Write(
   string data
)
Managed Extensions for C++
public: Data* Write(
   string* data
)
C++/CLI
public:
Data^ Write(
   String^ data
)

Parameters

data
String of data to send.

Return Value

A Data object encapsulating the sent data. Returns null if the socket is closed.

Remarks

This method synchronously sends data to the remote host over an existing connection. It will block until a buffer is available to accept the data or SocketOption.SendTimeout has expired.

See Also

Reference

TcpBase Class
TcpBase Members
Overload List


Write(Byte[],Int32,Int32) Method

[image]
PowerTCP Sockets for .NET
Write(Byte[],Int32,Int32) Method
See Also Send comments on this topic
Dart.Sockets Namespace > TcpBase Class > Write Method : Write(Byte[],Int32,Int32) Method

buffer
Byte array of data to send.
offset
The position in the data buffer at which to begin sending data.
count
The number of bytes to send.

Glossary Item Box

Sends data to the remote host.

Syntax

Visual Basic (Declaration)
Public Overloads Function Write( _
   ByVal buffer() As Byte, _
   ByVal offset As Integer, _
   ByVal count As Integer _
) As Data
Visual Basic (Usage) Copy Code
Dim instance As TcpBase
Dim buffer() As Byte
Dim offset As Integer
Dim count As Integer
Dim value As Data

value = instance.Write(buffer, offset, count)
C#
public Data Write(
   byte[] buffer,
   int offset,
   int count
)
Managed Extensions for C++
public: Data* Write(
   byte[]* buffer,
   int offset,
   int count
)
C++/CLI
public:
Data^ Write(
   array<byte>^ buffer,
   int offset,
   int count
)

Parameters

buffer
Byte array of data to send.
offset
The position in the data buffer at which to begin sending data.
count
The number of bytes to send.

Return Value

A Data object encapsulating the sent data. Returns null if the socket is closed.

Remarks

This method synchronously sends data to the remote host over an existing connection. It will block until a buffer is available to accept the data or SocketOption.SendTimeout has expired.

See Also

Reference

TcpBase Class
TcpBase Members
Overload List


WriteAsync Method

[image]
PowerTCP Sockets for .NET
WriteAsync Method
See Also Example Send comments on this topic
Dart.Sockets Namespace > TcpBase Class : WriteAsync Method

buffer
The byte array containing data to be written.
offset
The position in the buffer to start writing data from.
count
The number of bytes to write.
callback
A TcpAsyncCallback delegate referencing the method to invoke on an IO completion thread when the operation completes.
state
Object to pass into the callback method when the operation completes; can be null.

Glossary Item Box

Start an asynchronous write on the socket.

Syntax

Visual Basic (Declaration)
Public Sub WriteAsync( _
   ByVal buffer() As Byte, _
   ByVal offset As Integer, _
   ByVal count As Integer, _
   ByVal callback As TcpAsyncCallback, _
   ByVal state As Object _
)
Visual Basic (Usage) Copy Code
Dim instance As TcpBase
Dim buffer() As Byte
Dim offset As Integer
Dim count As Integer
Dim callback As TcpAsyncCallback
Dim state As Object

instance.WriteAsync(buffer, offset, count, callback, state)
C#
public void WriteAsync(
   byte[] buffer,
   int offset,
   int count,
   TcpAsyncCallback callback,
   object state
)
Managed Extensions for C++
public: void WriteAsync(
   byte[]* buffer,
   int offset,
   int count,
   TcpAsyncCallback* callback,
   Object* state
)
C++/CLI
public:
void WriteAsync(
   array<byte>^ buffer,
   int offset,
   int count,
   TcpAsyncCallback^ callback,
   Object^ state
)

Parameters

buffer
The byte array containing data to be written.
offset
The position in the buffer to start writing data from.
count
The number of bytes to write.
callback
A TcpAsyncCallback delegate referencing the method to invoke on an IO completion thread when the operation completes.
state
Object to pass into the callback method when the operation completes; can be null.

Remarks

The TCP component is typically used by making blocking calls on a worker (non-UI) thread. This technique keeps development simple as there is no need for saving state information, but requires a dedicated thread for each connection. If a dedicated worker thread for each socket is not scalable enough, such as in server applications, developers can use Async methods which utilize IO completion ports. Async methods do not require a dedicated worker thread for each connection, and the specified callback is invoked on an IO completion thread when the operation completes. This is the best way to create a scalable, high-performance server.

Example

The following example demonstrates an echo server using asynchronous read and write methods that utilize IO completion ports.
C# Copy Code
private void button1_Click(object sender, EventArgs e)
{
    //Start the echo server on port 7
    server1.Start(server1_NewConnection, 7, null);
}

private void server1_NewConnection(Tcp client, object state)
{
    //Read first data sent by client
    byte[] buffer = new byte[1024];
    client.ReadAsync(buffer, 0, buffer.Length, client_ReadAsyncCompleted, null);
}

private void client_ReadAsyncCompleted(TcpBase client, Data data, Exception ex, object state)
{
    //Echo data received back to client.
    //Data is null if client is not connected.
    if (data != null)
        client.WriteAsync(data.Buffer, data.Offset, data.Count, client_WriteAsyncCompleted, null);
}

private void client_WriteAsyncCompleted(TcpBase client, Data data, Exception ex, object state)
{
    //Read for more data.
    client.ReadAsync(data.Buffer, 0, data.Buffer.Length, client_ReadAsyncCompleted, null);
}
Visual Basic Copy Code
Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs)
    'Start the echo server on port 7
    server1.Start(AddressOf server1_NewConnection, 7, Nothing)
End Sub

Private Sub server1_NewConnection(ByVal client As Tcp, ByVal state As Object)
    'Read first data sent by client
    Dim buffer(1023) As Byte
    client.ReadAsync(buffer, 0, buffer.Length, AddressOf client_ReadAsyncCompleted, Nothing)
End Sub

Private Sub client_ReadAsyncCompleted(ByVal client As TcpBase, ByVal data As Data, ByVal ex As Exception, ByVal state As Object)
    'Echo data received back to client.
    'Data is null if client is not connected.
    If data IsNot Nothing Then
        client.WriteAsync(data.Buffer, data.Offset, data.Count, AddressOf client_WriteAsyncCompleted, Nothing)
    End If
End Sub

Private Sub client_WriteAsyncCompleted(ByVal client As TcpBase, ByVal data As Data, ByVal ex As Exception, ByVal state As Object)
    'Read for more data.
    client.ReadAsync(data.Buffer, 0, data.Buffer.Length, AddressOf client_ReadAsyncCompleted, Nothing)
End Sub

See Also

Reference

TcpBase Class
TcpBase Members


TcpBase Class Properties

[image]
PowerTCP Sockets for .NET
TcpBase Class Properties
See Also Send comments on this topic
Dart.Sockets Namespace : TcpBase Class

Glossary Item Box

For a list of all members of this type, see TcpBase members.

Public Properties

 | Name | Description
Public Property | CloseTime | Returns the DateTime the connection was closed.
Public Property | ConnectTime | Returns the DateTime the connection was established.
Public Property | Container | (Inherited from System.ComponentModel.Component)
Public Property | Encoding | Character encoding used by the component. (Inherited from Dart.Sockets.ComponentBase)
Public Property | NetworkStream | Returns the NetworkStream object created when Connect() is called.
Public Property | RemoteEndPoint | Gets the remote address and port of the connection.
Public Property | Site | (Inherited from System.ComponentModel.Component)
Public Property | Socket | Gets the socket used by the component for communications. (Inherited from Dart.Sockets.SocketBase)
Public Property | SocketOption | Gets and sets the socket options for classes derived from TcpBase.
Public Property | SslStream | Returns the SslStream object created when AuthenticateAsClient or AuthenticateAsServer are called.
Public Property | State | Gets the status of the connection as of the last socket operation.
Public Property | SynchronizingObject | Gets or sets the object used to marshal data to the UI thread (for raising events). (Inherited from Dart.Sockets.ComponentBase)
Public Property | SyncRoot | Gets an object that is used to synchronize access to the upper layer protocol in use. (Inherited from Dart.Sockets.ComponentBase)
Public Property | Tag | Gets or sets an object that stores any user data. (Inherited from Dart.Sockets.ComponentBase)
Top

Protected Properties

 | Name | Description
Protected Property | CanRaiseEvents | (Inherited from System.ComponentModel.Component)
Protected Property | DesignMode | (Inherited from System.ComponentModel.Component)
Protected Property | Events | (Inherited from System.ComponentModel.Component)
Top

See Also

Reference

TcpBase Class
Dart.Sockets Namespace


CloseTime Property

[image]
PowerTCP Sockets for .NET
CloseTime Property
See Also Send comments on this topic
Dart.Sockets Namespace > TcpBase Class : CloseTime Property

Glossary Item Box

Returns the DateTime the connection was closed.

Syntax

Visual Basic (Declaration)
Public ReadOnly Property CloseTime As Date
Visual Basic (Usage) Copy Code
Dim instance As TcpBase
Dim value As Date

value = instance.CloseTime
C#
public DateTime CloseTime {get;}
Managed Extensions for C++
public: __property DateTime get_CloseTime();
C++/CLI
public:
property DateTime CloseTime {
   DateTime get();
}

See Also

Reference

TcpBase Class
TcpBase Members


ConnectTime Property

[image]
PowerTCP Sockets for .NET
ConnectTime Property
See Also Send comments on this topic
Dart.Sockets Namespace > TcpBase Class : ConnectTime Property

Glossary Item Box

Returns the DateTime the connection was established.

Syntax

Visual Basic (Declaration)
Public ReadOnly Property ConnectTime As Date
Visual Basic (Usage) Copy Code
Dim instance As TcpBase
Dim value As Date

value = instance.ConnectTime
C#
public DateTime ConnectTime {get;}
Managed Extensions for C++
public: __property DateTime get_ConnectTime();
C++/CLI
public:
property DateTime ConnectTime {
   DateTime get();
}

See Also

Reference

TcpBase Class
TcpBase Members


NetworkStream Property

[image]
PowerTCP Sockets for .NET
NetworkStream Property
See Also Send comments on this topic
Dart.Sockets Namespace > TcpBase Class : NetworkStream Property

Glossary Item Box

Returns the NetworkStream object created when Connect() is called.

Syntax

Visual Basic (Declaration)
Public ReadOnly Property NetworkStream As NetworkStream
Visual Basic (Usage) Copy Code
Dim instance As TcpBase
Dim value As NetworkStream

value = instance.NetworkStream
C#
public NetworkStream NetworkStream {get;}
Managed Extensions for C++
public: __property NetworkStream* get_NetworkStream();
C++/CLI
public:
property NetworkStream^ NetworkStream {
   NetworkStream^ get();
}

Remarks

Returns null when no TCP connection exists.

See Also

Reference

TcpBase Class
TcpBase Members


RemoteEndPoint Property

[image]
PowerTCP Sockets for .NET
RemoteEndPoint Property
See Also Example Send comments on this topic
Dart.Sockets Namespace > TcpBase Class : RemoteEndPoint Property

Glossary Item Box

Gets the remote address and port of the connection.

Syntax

Visual Basic (Declaration)
Public ReadOnly Property RemoteEndPoint As IPEndPoint
Visual Basic (Usage) Copy Code
Dim instance As TcpBase
Dim value As IPEndPoint

value = instance.RemoteEndPoint
C#
public IPEndPoint RemoteEndPoint {get;}
Managed Extensions for C++
public: __property IPEndPoint* get_RemoteEndPoint();
C++/CLI
public:
property IPEndPoint^ RemoteEndPoint {
   IPEndPoint^ get();
}

Property Value

The Socket.RemoteEndPoint. This value persists after the connection is closed.

Example

This example demonstrates using the StateChanged event and State property to update the UI.
C# Copy Code
private void myComponent_StateChanged(object sender, EventArgs e)
{
    if (myComponent.State == ConnectionState.Closed)
        this.Text = "Not Connected";
    else if (myComponent.State == ConnectionState.Connected)
        this.Text = "Connected to " + myComponent.RemoteEndPoint.ToString();
    else
        this.Text = "Securely connected to " + myComponent.RemoteEndPoint.ToString();
}
Visual Basic Copy Code
Private Sub myComponent_StateChanged(ByVal sender As Object, ByVal e As EventArgs)
    If myComponent.State = ConnectionState.Closed Then
        Me.Text = "Not Connected"
    ElseIf myComponent.State = ConnectionState.Connected Then
        Me.Text = "Connected to " & myComponent.RemoteEndPoint.ToString()
    Else
        Me.Text = "Securely connected to " & myComponent.RemoteEndPoint.ToString()
    End If
End Sub

See Also

Reference

TcpBase Class
TcpBase Members


SocketOption Property

[image]
PowerTCP Sockets for .NET
SocketOption Property
See Also Send comments on this topic
Dart.Sockets Namespace > TcpBase Class : SocketOption Property

Glossary Item Box

Gets and sets the socket options for classes derived from TcpBase.

Syntax

Visual Basic (Declaration)
Public Property SocketOption As TcpSocketOption
Visual Basic (Usage) Copy Code
Dim instance As TcpBase
Dim value As TcpSocketOption

instance.SocketOption = value

value = instance.SocketOption
C#
public TcpSocketOption SocketOption {get; set;}
Managed Extensions for C++
public: __property TcpSocketOption* get_SocketOption();
public: __property void set_SocketOption(
   TcpSocketOption* value
);
C++/CLI
public:
property TcpSocketOption^ SocketOption {
   TcpSocketOption^ get();
   void set (    TcpSocketOption^ value);
}

See Also

Reference

TcpBase Class
TcpBase Members


SslStream Property

[image]
PowerTCP Sockets for .NET
SslStream Property
See Also Send comments on this topic
Dart.Sockets Namespace > TcpBase Class : SslStream Property

Glossary Item Box

Returns the SslStream object created when AuthenticateAsClient or AuthenticateAsServer are called.

Syntax

Visual Basic (Declaration)
Public ReadOnly Property SslStream As SslStream
Visual Basic (Usage) Copy Code
Dim instance As TcpBase
Dim value As SslStream

value = instance.SslStream
C#
public SslStream SslStream {get;}
Managed Extensions for C++
public: __property SslStream* get_SslStream();
C++/CLI
public:
property SslStream^ SslStream {
   SslStream^ get();
}

Remarks

Returns null when no secure connection exists.

See Also

Reference

TcpBase Class
TcpBase Members


State Property

[image]
PowerTCP Sockets for .NET
State Property
See Also Example Send comments on this topic
Dart.Sockets Namespace > TcpBase Class : State Property

Glossary Item Box

Gets the status of the connection as of the last socket operation.

Syntax

Visual Basic (Declaration)
Public ReadOnly Property State As ConnectionState
Visual Basic (Usage) Copy Code
Dim instance As TcpBase
Dim value As ConnectionState

value = instance.State
C#
public ConnectionState State {get;}
Managed Extensions for C++
public: __property ConnectionState get_State();
C++/CLI
public:
property ConnectionState State {
   ConnectionState get();
}

Example

This example demonstrates using the StateChanged event and State property to update the UI.
C# Copy Code
private void myComponent_StateChanged(object sender, EventArgs e)
{
    if (myComponent.State == ConnectionState.Closed)
        this.Text = "Not Connected";
    else if (myComponent.State == ConnectionState.Connected)
        this.Text = "Connected to " + myComponent.RemoteEndPoint.ToString();
    else
        this.Text = "Securely connected to " + myComponent.RemoteEndPoint.ToString();
}
Visual Basic Copy Code
Private Sub myComponent_StateChanged(ByVal sender As Object, ByVal e As EventArgs)
    If myComponent.State = ConnectionState.Closed Then
        Me.Text = "Not Connected"
    ElseIf myComponent.State = ConnectionState.Connected Then
        Me.Text = "Connected to " & myComponent.RemoteEndPoint.ToString()
    Else
        Me.Text = "Securely connected to " & myComponent.RemoteEndPoint.ToString()
    End If
End Sub

See Also

Reference

TcpBase Class
TcpBase Members


TcpBase Class Events

[image]
PowerTCP Sockets for .NET
TcpBase Class Events
See Also Send comments on this topic
Dart.Sockets Namespace : TcpBase Class

Glossary Item Box

For a list of all members of this type, see TcpBase members.

Public Events

 | Name | Description
Public Event | Data | Raised when Marshal(Data,String,Object) is used.
Public Event | Disposed | (Inherited from System.ComponentModel.Component)
Public Event | Error | Raised when Marshal(Exception) is used or an unhandled Exception is thrown in a worker thread created using Start. (Inherited from Dart.Sockets.ComponentBase)
Public Event | Log | Raised when data is read or written.
Public Event | StateChanged | Raised when the value of the State property changes.
Public Event | UserState | Raised when Marshal(String,Object) is used. (Inherited from Dart.Sockets.ComponentBase)
Top

See Also

Reference

TcpBase Class
Dart.Sockets Namespace


Data Event

[image]
PowerTCP Sockets for .NET
Data Event
See Also Send comments on this topic
Dart.Sockets Namespace > TcpBase Class : Data Event

Glossary Item Box

Raised when Marshal(Data,String,Object) is used.

Syntax

Visual Basic (Declaration)
Public Event Data As EventHandler(Of DataEventArgs)
Visual Basic (Usage) Copy Code
Dim instance As TcpBase
Dim handler As EventHandler(Of DataEventArgs)

AddHandler instance.Data, handler
C#
public event EventHandler<DataEventArgs> Data
Managed Extensions for C++
public: __event EventHandler<DataEventArgs*>* Data
C++/CLI
public:
event EventHandler<DataEventArgs^>^ Data

Event Data

The event handler receives an argument of type DataEventArgs containing data related to this event. The following DataEventArgs properties provide information specific to this event.

Property | Description
Data | Gets data provided by Data and Log events.
Message | Returns the message argument provided by the Marshal method. (Inherited from Dart.Sockets.UserStateEventArgs)
UserState | Returns the user state argument provided by the Marshal method. (Inherited from Dart.Sockets.UserStateEventArgs)

Remarks

See the SynchronizingObject property for information on updating UI controls in your event handler.

See Also

Reference

TcpBase Class
TcpBase Members


Log Event

[image]
PowerTCP Sockets for .NET
Log Event
See Also Example Send comments on this topic
Dart.Sockets Namespace > TcpBase Class : Log Event

Glossary Item Box

Raised when data is read or written.

Syntax

Visual Basic (Declaration)
Public Event Log As EventHandler(Of DataEventArgs)
Visual Basic (Usage) Copy Code
Dim instance As TcpBase
Dim handler As EventHandler(Of DataEventArgs)

AddHandler instance.Log, handler
C#
public event EventHandler<DataEventArgs> Log
Managed Extensions for C++
public: __event EventHandler<DataEventArgs*>* Log
C++/CLI
public:
event EventHandler<DataEventArgs^>^ Log

Event Data

The event handler receives an argument of type DataEventArgs containing data related to this event. The following DataEventArgs properties provide information specific to this event.

Property | Description
Data | Gets data provided by Data and Log events.
Message | Returns the message argument provided by the Marshal method. (Inherited from Dart.Sockets.UserStateEventArgs)
UserState | Returns the user state argument provided by the Marshal method. (Inherited from Dart.Sockets.UserStateEventArgs)

Remarks

The handler must be added before connecting. See the SynchronizingObject property for information on updating UI controls in your event handler.

Example

This example demonstrates logging sent and received data to a textbox.
C# Copy Code
private void myComponent_Log(object sender, DataEventArgs e)
{
    string prompt = (e.Data.Direction == DataDirection.In) ? "Recv: " : "Sent: ";
    textBox1.AppendText(prompt + e.Data.ToString() + Environment.NewLine);
}
Visual Basic Copy Code
Private Sub myComponent_Log(ByVal sender As Object, ByVal e As DataEventArgs)
    Dim prompt As String = If(e.Data.Direction = DataDirection.In, "Recv: ", "Sent: ")
    textBox1.AppendText(prompt & e.Data.ToString() & Environment.NewLine)
End Sub

See Also

Reference

TcpBase Class
TcpBase Members


StateChanged Event

[image]
PowerTCP Sockets for .NET
StateChanged Event
See Also Example Send comments on this topic
Dart.Sockets Namespace > TcpBase Class : StateChanged Event

Glossary Item Box

Raised when the value of the State property changes.

Syntax

Visual Basic (Declaration)
Public Event StateChanged As EventHandler
Visual Basic (Usage) Copy Code
Dim instance As TcpBase
Dim handler As EventHandler

AddHandler instance.StateChanged, handler
C#
public event EventHandler StateChanged
Managed Extensions for C++
public: __event EventHandler* StateChanged
C++/CLI
public:
event EventHandler^ StateChanged

Remarks

See the SynchronizingObject property for information on updating UI controls in your event handler.

This event can be raised during a Read call if the remote host closes the connection. In this scenario, a form should not be disposed of within this event handler if the Dart component was created on the form (this includes calling Form.Close if Form.Show was used to show it). Instead, the component can be created elsewhere and passed to the form, or the form can be disposed of after the posted Read returns.

Example

This example demonstrates using the StateChanged event and State property to update the UI.
C# Copy Code
private void myComponent_StateChanged(object sender, EventArgs e)
{
    if (myComponent.State == ConnectionState.Closed)
        this.Text = "Not Connected";
    else if (myComponent.State == ConnectionState.Connected)
        this.Text = "Connected to " + myComponent.RemoteEndPoint.ToString();
    else
        this.Text = "Securely connected to " + myComponent.RemoteEndPoint.ToString();
}
Visual Basic Copy Code
Private Sub myComponent_StateChanged(ByVal sender As Object, ByVal e As EventArgs)
    If myComponent.State = ConnectionState.Closed Then
        Me.Text = "Not Connected"
    ElseIf myComponent.State = ConnectionState.Connected Then
        Me.Text = "Connected to " & myComponent.RemoteEndPoint.ToString()
    Else
        Me.Text = "Securely connected to " & myComponent.RemoteEndPoint.ToString()
    End If
End Sub

See Also

Reference

TcpBase Class
TcpBase Members


TcpSession Class

[image]
PowerTCP Sockets for .NET
TcpSession Class
Members See Also Send comments on this topic
Dart.Sockets Namespace : TcpSession Class

Glossary Item Box

Holds the configuration used by TCP.

Object Model

TcpSession ClassIPEndPoint ClassProxy ClassIPEndPoint ClassClientSecurity Class

Syntax

Visual Basic (Declaration)
<SerializableAttribute()>
Public Class TcpSession
   Inherits Session
Visual Basic (Usage) Copy Code
Dim instance As TcpSession
C#
[Serializable()]
public class TcpSession : Session
Managed Extensions for C++
[Serializable()]
public __gc class TcpSession : public Session
C++/CLI
[Serializable()]
public ref class TcpSession : public Session

Inheritance Hierarchy

System.Object
Dart.Sockets.Session
Dart.Sockets.TcpSession

See Also

Reference

TcpSession Members
Dart.Sockets Namespace


TcpSession Class Members

[image]
PowerTCP Sockets for .NET
TcpSession Class Members
See Also Properties Send comments on this topic
Dart.Sockets Namespace : TcpSession Class

Glossary Item Box

The following tables list the members exposed by TcpSession.

Public Constructors

 | Name | Description
Public Constructor | TcpSession Constructor | Overloaded.
Top

Public Properties

 | Name | Description
Public Property | ConnectTimeout | Gets or sets a value that specifies the amount of time (in milliseconds) after which a call to TcpBase.Connect will time out.
Public Property | LocalEndPoint | EndPoint to bind to locally. (Inherited from Dart.Sockets.Session)
Public Property | Proxy | Defines the optional server proxy configuration.
Public Property | RemoteEndPoint | EndPoint of the remote host to connect to. (Inherited from Dart.Sockets.Session)
Public Property | Security | Specifies the client-side SSL options. See the ClientSecurity class for more information.
Top

See Also

Reference

TcpSession Class
Dart.Sockets Namespace


TcpSession Constructor

[image]
PowerTCP Sockets for .NET
TcpSession Constructor
See Also Send comments on this topic
Dart.Sockets Namespace > TcpSession Class : TcpSession Constructor

Glossary Item Box

Overload List

Overload | Description
TcpSession Constructor() | Default constructor for TcpSession.
TcpSession Constructor(IPEndPoint) | Constructor for TcpSession with a Remote IPEndPoint parameter.

See Also

Reference

TcpSession Class
TcpSession Members


TcpSession Constructor()

[image]
PowerTCP Sockets for .NET
TcpSession Constructor()
See Also Send comments on this topic
Dart.Sockets Namespace > TcpSession Class > TcpSession Constructor : TcpSession Constructor()

Glossary Item Box

Default constructor for TcpSession.

Syntax

Visual Basic (Declaration)
Public Function New()
Visual Basic (Usage) Copy Code
Dim instance As New TcpSession()
C#
public TcpSession()
Managed Extensions for C++
public: TcpSession();
C++/CLI
public:
TcpSession();

See Also

Reference

TcpSession Class
TcpSession Members
Overload List


TcpSession Constructor(IPEndPoint)

[image]
PowerTCP Sockets for .NET
TcpSession Constructor(IPEndPoint)
See Also Send comments on this topic
Dart.Sockets Namespace > TcpSession Class > TcpSession Constructor : TcpSession Constructor(IPEndPoint)

remoteEP
The remote IPEndPoint to connect to.

Glossary Item Box

Constructor for TcpSession with a Remote IPEndPoint parameter.

Syntax

Visual Basic (Declaration)
Public Function New( _
   ByVal remoteEP As IPEndPoint _
)
Visual Basic (Usage) Copy Code
Dim remoteEP As IPEndPoint

Dim instance As New TcpSession(remoteEP)
C#
public TcpSession(
   IPEndPoint remoteEP
)
Managed Extensions for C++
public: TcpSession(
   IPEndPoint* remoteEP
)
C++/CLI
public:
TcpSession(
   IPEndPoint^ remoteEP
)

Parameters

remoteEP
The remote IPEndPoint to connect to.

See Also

Reference

TcpSession Class
TcpSession Members
Overload List


TcpSession Class Properties

[image]
PowerTCP Sockets for .NET
TcpSession Class Properties
See Also Send comments on this topic
Dart.Sockets Namespace : TcpSession Class

Glossary Item Box

For a list of all members of this type, see TcpSession members.

Public Properties

 | Name | Description
Public Property | ConnectTimeout | Gets or sets a value that specifies the amount of time (in milliseconds) after which a call to TcpBase.Connect will time out.
Public Property | LocalEndPoint | EndPoint to bind to locally. (Inherited from Dart.Sockets.Session)
Public Property | Proxy | Defines the optional server proxy configuration.
Public Property | RemoteEndPoint | EndPoint of the remote host to connect to. (Inherited from Dart.Sockets.Session)
Public Property | Security | Specifies the client-side SSL options. See the ClientSecurity class for more information.
Top

See Also

Reference

TcpSession Class
Dart.Sockets Namespace


ConnectTimeout Property

[image]
PowerTCP Sockets for .NET
ConnectTimeout Property
See Also Send comments on this topic
Dart.Sockets Namespace > TcpSession Class : ConnectTimeout Property

Glossary Item Box

Gets or sets a value that specifies the amount of time (in milliseconds) after which a call to TcpBase.Connect will time out.

Syntax

Visual Basic (Declaration)
<DefaultValueAttribute()>
Public Property ConnectTimeout As Integer
Visual Basic (Usage) Copy Code
Dim instance As TcpSession
Dim value As Integer

instance.ConnectTimeout = value

value = instance.ConnectTimeout
C#
[DefaultValue()]
public int ConnectTimeout {get; set;}
Managed Extensions for C++
[DefaultValue()]
public: __property int get_ConnectTimeout();
public: __property void set_ConnectTimeout(
   int value
);
C++/CLI
[DefaultValue()]
public:
property int ConnectTimeout {
   int get();
   void set (    int value);
}

Property Value

The timeout value in milliseconds. The default value is -1, which defers to the system timeout.

Remarks

This property is used to cancel a connect request early; it does not override the system-level connect timeout.

See Also

Reference

TcpSession Class
TcpSession Members


Proxy Property

[image]
PowerTCP Sockets for .NET
Proxy Property
See Also Send comments on this topic
Dart.Sockets Namespace > TcpSession Class : Proxy Property

Glossary Item Box

Defines the optional server proxy configuration.

Syntax

Visual Basic (Declaration)
Public Property Proxy As Proxy
Visual Basic (Usage) Copy Code
Dim instance As TcpSession
Dim value As Proxy

instance.Proxy = value

value = instance.Proxy
C#
public Proxy Proxy {get; set;}
Managed Extensions for C++
public: __property Proxy* get_Proxy();
public: __property void set_Proxy(
   Proxy* value
);
C++/CLI
public:
property Proxy^ Proxy {
   Proxy^ get();
   void set (    Proxy^ value);
}

Remarks

Use this property to define the server proxy configuration.

See Also

Reference

TcpSession Class
TcpSession Members


Security Property

[image]
PowerTCP Sockets for .NET
Security Property
See Also Send comments on this topic
Dart.Sockets Namespace > TcpSession Class : Security Property

Glossary Item Box

Specifies the client-side SSL options. See the ClientSecurity class for more information.

Syntax

Visual Basic (Declaration)
Public Property Security As ClientSecurity
Visual Basic (Usage) Copy Code
Dim instance As TcpSession
Dim value As ClientSecurity

instance.Security = value

value = instance.Security
C#
public ClientSecurity Security {get; set;}
Managed Extensions for C++
public: __property ClientSecurity* get_Security();
public: __property void set_Security(
   ClientSecurity* value
);
C++/CLI
public:
property ClientSecurity^ Security {
   ClientSecurity^ get();
   void set (    ClientSecurity^ value);
}

Property Value

ClientSecurity

See Also

Reference

TcpSession Class
TcpSession Members


TcpSocketOption Class

[image]
PowerTCP Sockets for .NET
TcpSocketOption Class
Members See Also Send comments on this topic
Dart.Sockets Namespace : TcpSocketOption Class

Glossary Item Box

Contains socket options that may be set by TCP sockets.

Object Model

TcpSocketOption Class

Syntax

Visual Basic (Declaration)
<SerializableAttribute()>
Public Class TcpSocketOption
   Inherits SocketOption
Visual Basic (Usage) Copy Code
Dim instance As TcpSocketOption
C#
[Serializable()]
public class TcpSocketOption : SocketOption
Managed Extensions for C++
[Serializable()]
public __gc class TcpSocketOption : public SocketOption
C++/CLI
[Serializable()]
public ref class TcpSocketOption : public SocketOption

Inheritance Hierarchy

System.Object
Dart.Sockets.SocketOption
Dart.Sockets.TcpSocketOption

See Also

Reference

TcpSocketOption Members
Dart.Sockets Namespace


TcpSocketOption Class Members

[image]
PowerTCP Sockets for .NET
TcpSocketOption Class Members
See Also Properties Send comments on this topic
Dart.Sockets Namespace : TcpSocketOption Class

Glossary Item Box

The following tables list the members exposed by TcpSocketOption.

Public Properties

 | Name | Description
Public Property | ExclusiveAddressUse | When set to true, forbids multiple socket bindings to the same address. Set this value to true to ensure you have exclusive use of the local endpoint. Socket.ExclusiveAddressUse is set to this value before Socket.Bind is used. (Inherited from Dart.Sockets.SocketOption)
Public Property | KeepAliveInterval | The time in milliseconds between retransmission of keepalives once the KeepAliveTime has expired.
Public Property | KeepAliveTime | The connection idle time in milliseconds before TCP will begin sending keepalives.
Public Property | NoDelay | Gets or sets a value that disables the use of Nagle's algorithm so that data is sent immediately.
Public Property | OutOfBandInline | Gets or sets a value that indicates whether out-of-band (urgent) data is read as normal in-line data.
Public Property | ReceiveBufferSize | Gets or sets a value that specifies the size of the system receive buffer. (Inherited from Dart.Sockets.SocketOption)
Public Property | ReceiveTimeout | Overridden. Gets or sets a value that specifies the amount of time after which the underlying TCP Socket.Receive call will time out.
Public Property | ReuseAddress | When set to true, allows multiple socket bindings to the same address. Set this value to true to allow multiple sockets to bind to the same local address. (Inherited from Dart.Sockets.SocketOption)
Public Property | SendBufferSize | Gets or sets a value that specifies the size of the system send buffer. (Inherited from Dart.Sockets.SocketOption)
Public Property | SendTimeout | Gets or sets a value that specifies the amount of time after which the underlying Socket Send call will time out. (Inherited from Dart.Sockets.SocketOption)
Top

See Also

Reference

TcpSocketOption Class
Dart.Sockets Namespace


TcpSocketOption Class Properties

[image]
PowerTCP Sockets for .NET
TcpSocketOption Class Properties
See Also Send comments on this topic
Dart.Sockets Namespace : TcpSocketOption Class

Glossary Item Box

For a list of all members of this type, see TcpSocketOption members.

Public Properties

 | Name | Description
Public Property | ExclusiveAddressUse | When set to true, forbids multiple socket bindings to the same address. Set this value to true to ensure you have exclusive use of the local endpoint. Socket.ExclusiveAddressUse is set to this value before Socket.Bind is used. (Inherited from Dart.Sockets.SocketOption)
Public Property | KeepAliveInterval | The time in milliseconds between retransmission of keepalives once the KeepAliveTime has expired.
Public Property | KeepAliveTime | The connection idle time in milliseconds before TCP will begin sending keepalives.
Public Property | NoDelay | Gets or sets a value that disables the use of Nagle's algorithm so that data is sent immediately.
Public Property | OutOfBandInline | Gets or sets a value that indicates whether out-of-band (urgent) data is read as normal in-line data.
Public Property | ReceiveBufferSize | Gets or sets a value that specifies the size of the system receive buffer. (Inherited from Dart.Sockets.SocketOption)
Public Property | ReceiveTimeout | Overridden. Gets or sets a value that specifies the amount of time after which the underlying TCP Socket.Receive call will time out.
Public Property | ReuseAddress | When set to true, allows multiple socket bindings to the same address. Set this value to true to allow multiple sockets to bind to the same local address. (Inherited from Dart.Sockets.SocketOption)
Public Property | SendBufferSize | Gets or sets a value that specifies the size of the system send buffer. (Inherited from Dart.Sockets.SocketOption)
Public Property | SendTimeout | Gets or sets a value that specifies the amount of time after which the underlying Socket Send call will time out. (Inherited from Dart.Sockets.SocketOption)
Top

See Also

Reference

TcpSocketOption Class
Dart.Sockets Namespace


KeepAliveInterval Property

[image]
PowerTCP Sockets for .NET
KeepAliveInterval Property
See Also Send comments on this topic
Dart.Sockets Namespace > TcpSocketOption Class : KeepAliveInterval Property

Glossary Item Box

The time in milliseconds between retransmission of keepalives once the KeepAliveTime has expired.

Syntax

Visual Basic (Declaration)
<DefaultValueAttribute()>
Public Property KeepAliveInterval As Integer
Visual Basic (Usage) Copy Code
Dim instance As TcpSocketOption
Dim value As Integer

instance.KeepAliveInterval = value

value = instance.KeepAliveInterval
C#
[DefaultValue()]
public int KeepAliveInterval {get; set;}
Managed Extensions for C++
[DefaultValue()]
public: __property int get_KeepAliveInterval();
public: __property void set_KeepAliveInterval(
   int value
);
C++/CLI
[DefaultValue()]
public:
property int KeepAliveInterval {
   int get();
   void set (    int value);
}

Remarks

Once KeepAliveTime has expired, keepalives are sent every KeepAliveInterval milliseconds until a response is received, up to the maximum established by TcpMaxDataRetransmissions (OS-level configuration) before the connection is terminated. The default is 1000 (1 sec).

This property is not implemented in MONO.

See Also

Reference

TcpSocketOption Class
TcpSocketOption Members


KeepAliveTime Property

[image]
PowerTCP Sockets for .NET
KeepAliveTime Property
See Also Send comments on this topic
Dart.Sockets Namespace > TcpSocketOption Class : KeepAliveTime Property

Glossary Item Box

The connection idle time in milliseconds before TCP will begin sending keepalives.

Syntax

Visual Basic (Declaration)
<DefaultValueAttribute()>
Public Property KeepAliveTime As Integer
Visual Basic (Usage) Copy Code
Dim instance As TcpSocketOption
Dim value As Integer

instance.KeepAliveTime = value

value = instance.KeepAliveTime
C#
[DefaultValue()]
public int KeepAliveTime {get; set;}
Managed Extensions for C++
[DefaultValue()]
public: __property int get_KeepAliveTime();
public: __property void set_KeepAliveTime(
   int value
);
C++/CLI
[DefaultValue()]
public:
property int KeepAliveTime {
   int get();
   void set (    int value);
}

Remarks

Set to 0 to disable keepalives. Defaults to 7,200,000 (2 hours).

This property is not implemented in MONO.

See Also

Reference

TcpSocketOption Class
TcpSocketOption Members


NoDelay Property

[image]
PowerTCP Sockets for .NET
NoDelay Property
See Also Send comments on this topic
Dart.Sockets Namespace > TcpSocketOption Class : NoDelay Property

Glossary Item Box

Gets or sets a value that disables the use of Nagle's algorithm so that data is sent immediately.

Syntax

Visual Basic (Declaration)
<DefaultValueAttribute()>
Public Property NoDelay As Boolean
Visual Basic (Usage) Copy Code
Dim instance As TcpSocketOption
Dim value As Boolean

instance.NoDelay = value

value = instance.NoDelay
C#
[DefaultValue()]
public bool NoDelay {get; set;}
Managed Extensions for C++
[DefaultValue()]
public: __property bool get_NoDelay();
public: __property void set_NoDelay(
   bool value
);
C++/CLI
[DefaultValue()]
public:
property bool NoDelay {
   bool get();
   void set (    bool value);
}

Property Value

False if Nagle's algorithm is used; otherwise true. The default value is false.

Remarks

When small pieces of data (such as single bytes) are send many times consecutively, inefficient packets can be sent with one byte of useful data and 40 bytes of header information. Nagle's algorithm specifies that this type of data should be automatically concatenated and sent in a single packet. When true, Nagle's algorithm is defeated and data is immediately sent in a dedicated packet. When false, Nagle's algorithm is used and consecutive Socket Send calls might send data in a single (more efficient) packet.

Setting this property to true may result in a speed optimization (because packets are sent immediately, without having to wait to see if Send is called again). Setting this property to false results in data being transmitted more efficiently.

See Also

Reference

TcpSocketOption Class
TcpSocketOption Members


OutOfBandInline Property

[image]
PowerTCP Sockets for .NET
OutOfBandInline Property
See Also Send comments on this topic
Dart.Sockets Namespace > TcpSocketOption Class : OutOfBandInline Property

Glossary Item Box

Gets or sets a value that indicates whether out-of-band (urgent) data is read as normal in-line data.

Syntax

Visual Basic (Declaration)
<DefaultValueAttribute()>
Public Property OutOfBandInline As Boolean
Visual Basic (Usage) Copy Code
Dim instance As TcpSocketOption
Dim value As Boolean

instance.OutOfBandInline = value

value = instance.OutOfBandInline
C#
[DefaultValue()]
public bool OutOfBandInline {get; set;}
Managed Extensions for C++
[DefaultValue()]
public: __property bool get_OutOfBandInline();
public: __property void set_OutOfBandInline(
   bool value
);
C++/CLI
[DefaultValue()]
public:
property bool OutOfBandInline {
   bool get();
   void set (    bool value);
}

Property Value

True if urgent data is to be read as normal in-line data, otherwise false. The default value is false.

Remarks

When the "urgent" socket flag is set, the packet contains data that should be acted upon before "non-urgent" data. Setting this property to true will cause this urgent data to be read in-line. To minimize interoperability problems, developers are advised not to use out-of-band data unless it is required to interoperate with an existing service.

See Also

Reference

TcpSocketOption Class
TcpSocketOption Members


ReceiveTimeout Property

[image]
PowerTCP Sockets for .NET
ReceiveTimeout Property
See Also Send comments on this topic
Dart.Sockets Namespace > TcpSocketOption Class : ReceiveTimeout Property

Glossary Item Box

Gets or sets a value that specifies the amount of time after which the underlying TCP Socket.Receive call will time out.

Syntax

Visual Basic (Declaration)
<DefaultValueAttribute()>
Public Overrides Property ReceiveTimeout As Integer
Visual Basic (Usage) Copy Code
Dim instance As TcpSocketOption
Dim value As Integer

instance.ReceiveTimeout = value

value = instance.ReceiveTimeout
C#
[DefaultValue()]
public override int ReceiveTimeout {get; set;}
Managed Extensions for C++
[DefaultValue()]
public: __property int get_ReceiveTimeout() override;
public: __property void set_ReceiveTimeout(
   int value
) override;
C++/CLI
[DefaultValue()]
public:
property int ReceiveTimeout {
   int get() override;
   void set (    int value) override;
}

Property Value

The time-out value in milliseconds. The default value is 0, which indicates an infinite time-out period.

Remarks

Values between 1 and 499 will be changed to 500, as 500 is the minimum positive value. A value of 0 or -1 indicates an infinite time-out period.

See Also

Reference

TcpSocketOption Class
TcpSocketOption Members


Udp Class

[image]
PowerTCP Sockets for .NET
Udp Class
Members Example See Also Send comments on this topic
Dart.Sockets Namespace : Udp Class

Glossary Item Box

The Udp component provides comprehensive User Datagram Protocol support.

Object Model

Udp ClassUdpSocketOption Class

Syntax

Visual Basic (Declaration)
Public Class Udp
   Inherits UdpBase
Visual Basic (Usage) Copy Code
Dim instance As Udp
C#
public class Udp : UdpBase
Managed Extensions for C++
public __gc class Udp : public UdpBase
C++/CLI
public ref class Udp : public UdpBase

Remarks

Use the Udp component to send and receive UDP datagrams.

Use the UdpBase.Open method to bind to a socket prior to sending and receiving.

Use the UdpBase.Send and UdpBase.Receive methods to send/receive datagrams.

Use UdpBase.JoinMulticastGroup to join a multicast group, and UdpBase.LeaveMulticastGroup to leave a multicast group.

Use Start to send or receive datagrams asynchronously, on a worker thread.

Example

The following example demonstrates sending and receiving between two Udp components. The following example demonstrates joining a multicast group, sending data to it, receiving that data, and leaving the multicast group.
C# Copy Code
private void buttonStartServer_Click(object sender, EventArgs e)
{
    //Start worker thread to bind to the socket and start echoing data.
    udpServer.Start(udpServer_Open, null);
}

private void buttonStopServer_Click(object sender, EventArgs e)
{
    udpServer.Close();
}

private void buttonDoEcho_Click(object sender, EventArgs e)
{
    //Start a Udp component to act as client
    udpClient.Start(udpClient_DoEcho, null);
}

private void udpServer_Open(object state)
{
    byte[] buffer = new byte[1024];
    udpServer.Open(7);
    Datagram datagram = udpServer.Receive(buffer);
    //Datagram is null when local socket has been closed
    while (datagram != null)
    {
        if (datagram.Count > 0)
            udpServer.Send(buffer, datagram.Origin);
        datagram = udpServer.Receive(buffer);
    }
}

private void udpClient_DoEcho(object state)
{
    //Send message, receive response and close
    byte[] buffer = new byte[1024];
    udpClient.Open(0);
    udpClient.Send("hello world!", "127.0.0.1", 7);
    Datagram datagram = udpClient.Receive(buffer);
    //marshal data to UI thread
    udpClient.Marshal(datagram.ToString(), null);
    udpClient.Close();
}

private void udpClient_UserState(object sender, UserStateEventArgs e)
{
    textBox1.AppendText(e.Message);
}
Visual Basic Copy Code
Private Sub buttonStartServer_Click(ByVal sender As Object, ByVal e As EventArgs)
    'Start worker thread to bind to the socket and start echoing data.
    udpServer.Start(AddressOf udpServer_Open, Nothing)
End Sub

Private Sub buttonStopServer_Click(ByVal sender As Object, ByVal e As EventArgs)
    udpServer.Close()
End Sub

Private Sub buttonDoEcho_Click(ByVal sender As Object, ByVal e As EventArgs) Handles buttonDoEcho.Click
    'Start a Udp component to act as client
    udpClient.Start(AddressOf udpClient_DoEcho, Nothing)
End Sub

Private Sub udpServer_Open(ByVal state As Object)
    Dim buffer(1023) As Byte
    udpServer.Open(7)
    Dim datagram As Datagram = udpServer.Receive(buffer)
    'Datagram is null when local socket has been closed
    Do While datagram IsNot Nothing
        If datagram.Count > 0 Then
            udpServer.Send(buffer, datagram.Origin)
        End If
        datagram = udpServer.Receive(buffer)
    Loop
End Sub

Private Sub udpClient_DoEcho(ByVal state As Object)
    'Send message, receive response and close
    Dim buffer(1023) As Byte
    udpClient.Open(0)
    udpClient.Send("hello world!", "127.0.0.1", 7)
    Dim datagram As Datagram = udpClient.Receive(buffer)
    'marshal data to UI thread
    udpClient.Marshal(datagram.ToString(), Nothing)
    udpClient.Close()
End Sub

Private Sub udpClient_UserState(ByVal sender As Object, ByVal e As UserStateEventArgs)
    textBox1.AppendText(e.Message)
End Sub
C# Copy Code
private void button1_Click(object sender, EventArgs e)
{
    udp1.Start(multicastWorker, null);
}

private void multicastWorker(object state)
{
    IPEndPoint groupEndPoint = new IPEndPoint("239.0.0.1", 32000);
    udp1.Open(32000);
    udp1.JoinMulticastGroup(groupEndPoint.Address);
    udp1.Send("hello world!", groupEndPoint);
    byte[] buffer = new byte[1024];
    Datagram datagram = udp1.Receive(buffer);
    //Marshal data to UI for display
    udp1.Marshal(datagram.ToString(), null);
    udp1.LeaveMulticastGroup(groupEndPoint.Address);
    udp1.Close();
}

void udp1_UserState(object sender, UserStateEventArgs e)
{
    textBox1.AppendText(e.Message);
}
Visual Basic Copy Code
Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles button1.Click
    udp1.Start(AddressOf multicastWorker, Nothing)
End Sub

Private Sub multicastWorker(ByVal state As Object)
    Dim groupEndPoint As New IPEndPoint("239.0.0.1", 32000)
    udp1.Open(32000)
    udp1.JoinMulticastGroup(groupEndPoint.Address)
    udp1.Send("hello world!", groupEndPoint)
    Dim buffer(1023) As Byte
    Dim datagram As Datagram = udp1.Receive(buffer)
    'Marshal data to UI for display
    udp1.Marshal(datagram.ToString(), Nothing)
    udp1.LeaveMulticastGroup(groupEndPoint.Address)
    udp1.Close()
End Sub

Private Sub udp1_UserState(ByVal sender As Object, ByVal e As UserStateEventArgs)
    textBox1.AppendText(e.Message)
End Sub

Inheritance Hierarchy

System.Object
System.MarshalByRefObject
System.ComponentModel.Component
Dart.Sockets.ComponentBase
Dart.Sockets.SocketBase
Dart.Sockets.UdpBase
Dart.Sockets.Udp

See Also

Reference

Udp Members
Dart.Sockets Namespace


Udp Class Members

[image]
PowerTCP Sockets for .NET
Udp Class Members
See Also Properties Methods Events Send comments on this topic
Dart.Sockets Namespace : Udp Class

Glossary Item Box

The following tables list the members exposed by Udp.

Public Constructors

 | Name | Description
Public Constructor | Udp Constructor | Overloaded.
Top

Public Properties

 | Name | Description
Public Property | Container | (Inherited from System.ComponentModel.Component)
Public Property | Encoding | Character encoding used by the component. (Inherited from Dart.Sockets.ComponentBase)
Public Property | Site | (Inherited from System.ComponentModel.Component)
Public Property | Socket | Gets the socket used by the component for communications. (Inherited from Dart.Sockets.SocketBase)
Public Property | SocketOption | Gets the socket options for classes derived from UdpBase. (Inherited from Dart.Sockets.UdpBase)
Public Property | SynchronizingObject | Gets or sets the object used to marshal data to the UI thread (for raising events). (Inherited from Dart.Sockets.ComponentBase)
Public Property | SyncRoot | Gets an object that is used to synchronize access to the upper layer protocol in use. (Inherited from Dart.Sockets.ComponentBase)
Public Property | Tag | Gets or sets an object that stores any user data. (Inherited from Dart.Sockets.ComponentBase)
Top

Protected Properties

 | Name | Description
Protected Property | CanRaiseEvents | (Inherited from System.ComponentModel.Component)
Protected Property | DesignMode | (Inherited from System.ComponentModel.Component)
Protected Property | Events | (Inherited from System.ComponentModel.Component)
Top

Public Methods

 | Name | Description
Public Method | Close | Close the socket and release all resources. (Inherited from Dart.Sockets.UdpBase)
Public Method | CreateObjRef | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from System.MarshalByRefObject)
Public Method | Deserialize | Deserialize a previously serialized object. (Inherited from Dart.Sockets.ComponentBase)
Public Method | Dispose | Overloaded. Overridden. Releases all resources associated with the object.
Public Method | GetLifetimeService | Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | InitializeLifetimeService | Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | JoinMulticastGroup | Join the specified multicast group for receiving datagrams. (Inherited from Dart.Sockets.UdpBase)
Public Method | LeaveMulticastGroup | Leave the specified multicast group for receiving datagrams. (Inherited from Dart.Sockets.UdpBase)
Public Method | Marshal | Overloaded. Marshals a string and/or object to the UI thread and raises the UserState event. (Inherited from Dart.Sockets.ComponentBase)
Public Method | Open | Overloaded. Opens a socket on all IPv4 network interfaces and the specified port. (Inherited from Dart.Sockets.UdpBase)
Public Method | Receive | Overloaded. Receive a datagram. (Inherited from Dart.Sockets.UdpBase)
Public Method | ReceiveAsync | Receive a datagram asynchronously. (Inherited from Dart.Sockets.UdpBase)
Public Method | Send | Overloaded. Send a datagram to the specified remote address and port. (Inherited from Dart.Sockets.UdpBase)
Public Method | SendAsync | Send a datagram to the specified IPEndPoint asynchronously, specifying a buffer, offset, length and SocketFlags value. (Inherited from Dart.Sockets.UdpBase)
Public Method | Serialize | Serialize an object to the provided destination stream. (Inherited from Dart.Sockets.ComponentBase)
Public Method | Start | Starts a worker thread on which the specified delegate method executes.
Public Method | ToString | (Inherited from System.ComponentModel.Component)
Top

Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from System.ComponentModel.Component)
Protected Method | GetService | (Inherited from System.ComponentModel.Component)
Protected Method | MemberwiseClone | Overloaded. Creates a shallow copy of the current System.MarshalByRefObject object. (Inherited from System.MarshalByRefObject)
Protected Method | OnError | Raises the Error event. (Inherited from Dart.Sockets.ComponentBase)
Protected Method | OnUserState | Raises the UserState event. (Inherited from Dart.Sockets.ComponentBase)
Top

Public Events

 | Name | Description
Public Event | Disposed | (Inherited from System.ComponentModel.Component)
Public Event | Error | Raised when Marshal(Exception) is used or an unhandled Exception is thrown in a worker thread created using Start. (Inherited from Dart.Sockets.ComponentBase)
Public Event | UserState | Raised when Marshal(String,Object) is used. (Inherited from Dart.Sockets.ComponentBase)
Top

See Also

Reference

Udp Class
Dart.Sockets Namespace


Udp Constructor

[image]
PowerTCP Sockets for .NET
Udp Constructor
See Also Send comments on this topic
Dart.Sockets Namespace > Udp Class : Udp Constructor

Glossary Item Box

Overload List

Overload | Description
Udp Constructor() | Initializes a new Udp object.
Udp Constructor(IContainer) | Initializes a new Udp object.

See Also

Reference

Udp Class
Udp Members


Udp Constructor()

[image]
PowerTCP Sockets for .NET
Udp Constructor()
See Also Send comments on this topic
Dart.Sockets Namespace > Udp Class > Udp Constructor : Udp Constructor()

Glossary Item Box

Initializes a new Udp object.

Syntax

Visual Basic (Declaration)
Public Function New()
Visual Basic (Usage) Copy Code
Dim instance As New Udp()
C#
public Udp()
Managed Extensions for C++
public: Udp();
C++/CLI
public:
Udp();

Remarks

The default constructor initializes a new Udp object.

See Also

Reference

Udp Class
Udp Members
Overload List


Udp Constructor(IContainer)

[image]
PowerTCP Sockets for .NET
Udp Constructor(IContainer)
See Also Send comments on this topic
Dart.Sockets Namespace > Udp Class > Udp Constructor : Udp Constructor(IContainer)

container
The IContainer which contains the object.

Glossary Item Box

Initializes a new Udp object.

Syntax

Visual Basic (Declaration)
Public Function New( _
   ByVal container As IContainer _
)
Visual Basic (Usage) Copy Code
Dim container As IContainer

Dim instance As New Udp(container)
C#
public Udp(
   IContainer container
)
Managed Extensions for C++
public: Udp(
   IContainer* container
)
C++/CLI
public:
Udp(
   IContainer^ container
)

Parameters

container
The IContainer which contains the object.

See Also

Reference

Udp Class
Udp Members
Overload List


Udp Class Methods

[image]
PowerTCP Sockets for .NET
Udp Class Methods
See Also Send comments on this topic
Dart.Sockets Namespace : Udp Class

Glossary Item Box

For a list of all members of this type, see Udp members.

Public Methods

 | Name | Description
Public Method | Close | Close the socket and release all resources. (Inherited from Dart.Sockets.UdpBase)
Public Method | CreateObjRef | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from System.MarshalByRefObject)
Public Method | Deserialize | Deserialize a previously serialized object. (Inherited from Dart.Sockets.ComponentBase)
Public Method | Dispose | Overloaded. Overridden. Releases all resources associated with the object.
Public Method | GetLifetimeService | Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | InitializeLifetimeService | Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | JoinMulticastGroup | Join the specified multicast group for receiving datagrams. (Inherited from Dart.Sockets.UdpBase)
Public Method | LeaveMulticastGroup | Leave the specified multicast group for receiving datagrams. (Inherited from Dart.Sockets.UdpBase)
Public Method | Marshal | Overloaded. Marshals a string and/or object to the UI thread and raises the UserState event. (Inherited from Dart.Sockets.ComponentBase)
Public Method | Open | Overloaded. Opens a socket on all IPv4 network interfaces and the specified port. (Inherited from Dart.Sockets.UdpBase)
Public Method | Receive | Overloaded. Receive a datagram. (Inherited from Dart.Sockets.UdpBase)
Public Method | ReceiveAsync | Receive a datagram asynchronously. (Inherited from Dart.Sockets.UdpBase)
Public Method | Send | Overloaded. Send a datagram to the specified remote address and port. (Inherited from Dart.Sockets.UdpBase)
Public Method | SendAsync | Send a datagram to the specified IPEndPoint asynchronously, specifying a buffer, offset, length and SocketFlags value. (Inherited from Dart.Sockets.UdpBase)
Public Method | Serialize | Serialize an object to the provided destination stream. (Inherited from Dart.Sockets.ComponentBase)
Public Method | Start | Starts a worker thread on which the specified delegate method executes.
Public Method | ToString | (Inherited from System.ComponentModel.Component)
Top

Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from System.ComponentModel.Component)
Protected Method | GetService | (Inherited from System.ComponentModel.Component)
Protected Method | MemberwiseClone | Overloaded. Creates a shallow copy of the current System.MarshalByRefObject object. (Inherited from System.MarshalByRefObject)
Protected Method | OnError | Raises the Error event. (Inherited from Dart.Sockets.ComponentBase)
Protected Method | OnUserState | Raises the UserState event. (Inherited from Dart.Sockets.ComponentBase)
Top

See Also

Reference

Udp Class
Dart.Sockets Namespace


Dispose Method

[image]
PowerTCP Sockets for .NET
Dispose Method
See Also Send comments on this topic
Dart.Sockets Namespace > Udp Class : Dispose Method

Glossary Item Box

Releases all resources associated with the object.

Overload List

Overload | Description
Dispose(Boolean) | Releases all resources associated with the object.
Dispose() | (Inherited from System.ComponentModel.Component)

See Also

Reference

Udp Class
Udp Members


Dispose(Boolean) Method

[image]
PowerTCP Sockets for .NET
Dispose(Boolean) Method
See Also Send comments on this topic
Dart.Sockets Namespace > Udp Class > Dispose Method : Dispose(Boolean) Method

disposing
true when a user calls Dispose; false when called by a finalizer.

Glossary Item Box

Releases all resources associated with the object.

Syntax

Visual Basic (Declaration)
Protected Overloads Overrides Sub Dispose( _
   ByVal disposing As Boolean _
)
Visual Basic (Usage) Copy Code
Dim instance As Udp
Dim disposing As Boolean

instance.Dispose(disposing)
C#
protected override void Dispose(
   bool disposing
)
Managed Extensions for C++
protected: void Dispose(
   bool disposing
) override
C++/CLI
protected:
void Dispose(
   bool disposing
) override

Parameters

disposing
true when a user calls Dispose; false when called by a finalizer.

See Also

Reference

Udp Class
Udp Members
Overload List


Start Method

[image]
PowerTCP Sockets for .NET
Start Method
See Also Example Send comments on this topic
Dart.Sockets Namespace > Udp Class : Start Method

worker
System.Threading.WaitCallback delegate specifying the function to execute.
state
Information to pass to the worker delegate function; can be null.

Glossary Item Box

Starts a worker thread on which the specified delegate method executes.

Syntax

Visual Basic (Declaration)
Public Sub Start( _
   ByVal worker As WaitCallback, _
   ByVal state As Object _
)
Visual Basic (Usage) Copy Code
Dim instance As Udp
Dim worker As WaitCallback
Dim state As Object

instance.Start(worker, state)
C#
public void Start(
   WaitCallback worker,
   object state
)
Managed Extensions for C++
public: void Start(
   WaitCallback* worker,
   Object* state
)
C++/CLI
public:
void Start(
   WaitCallback^ worker,
   Object^ state
)

Parameters

worker
System.Threading.WaitCallback delegate specifying the function to execute.
state
Information to pass to the worker delegate function; can be null.

Remarks

This method provides an easy means for executing blocking functions on a worker thread. Applications with a UI thread should use this technique to execute processes (like Receive) that can block the UI thread.

The state parameter can be null for cases in which no state information needs to be passed to the worker delegate function.

Unhandled exceptions occurring on the worker thread will be caught and reported by the Error event.

Example

The following example demonstrates sending and receiving between two Udp components.
C# Copy Code
private void buttonStartServer_Click(object sender, EventArgs e)
{
    //Start worker thread to bind to the socket and start echoing data.
    udpServer.Start(udpServer_Open, null);
}

private void buttonStopServer_Click(object sender, EventArgs e)
{
    udpServer.Close();
}

private void buttonDoEcho_Click(object sender, EventArgs e)
{
    //Start a Udp component to act as client
    udpClient.Start(udpClient_DoEcho, null);
}

private void udpServer_Open(object state)
{
    byte[] buffer = new byte[1024];
    udpServer.Open(7);
    Datagram datagram = udpServer.Receive(buffer);
    //Datagram is null when local socket has been closed
    while (datagram != null)
    {
        if (datagram.Count > 0)
            udpServer.Send(buffer, datagram.Origin);
        datagram = udpServer.Receive(buffer);
    }
}

private void udpClient_DoEcho(object state)
{
    //Send message, receive response and close
    byte[] buffer = new byte[1024];
    udpClient.Open(0);
    udpClient.Send("hello world!", "127.0.0.1", 7);
    Datagram datagram = udpClient.Receive(buffer);
    //marshal data to UI thread
    udpClient.Marshal(datagram.ToString(), null);
    udpClient.Close();
}

private void udpClient_UserState(object sender, UserStateEventArgs e)
{
    textBox1.AppendText(e.Message);
}
Visual Basic Copy Code
Private Sub buttonStartServer_Click(ByVal sender As Object, ByVal e As EventArgs)
    'Start worker thread to bind to the socket and start echoing data.
    udpServer.Start(AddressOf udpServer_Open, Nothing)
End Sub

Private Sub buttonStopServer_Click(ByVal sender As Object, ByVal e As EventArgs)
    udpServer.Close()
End Sub

Private Sub buttonDoEcho_Click(ByVal sender As Object, ByVal e As EventArgs) Handles buttonDoEcho.Click
    'Start a Udp component to act as client
    udpClient.Start(AddressOf udpClient_DoEcho, Nothing)
End Sub

Private Sub udpServer_Open(ByVal state As Object)
    Dim buffer(1023) As Byte
    udpServer.Open(7)
    Dim datagram As Datagram = udpServer.Receive(buffer)
    'Datagram is null when local socket has been closed
    Do While datagram IsNot Nothing
        If datagram.Count > 0 Then
            udpServer.Send(buffer, datagram.Origin)
        End If
        datagram = udpServer.Receive(buffer)
    Loop
End Sub

Private Sub udpClient_DoEcho(ByVal state As Object)
    'Send message, receive response and close
    Dim buffer(1023) As Byte
    udpClient.Open(0)
    udpClient.Send("hello world!", "127.0.0.1", 7)
    Dim datagram As Datagram = udpClient.Receive(buffer)
    'marshal data to UI thread
    udpClient.Marshal(datagram.ToString(), Nothing)
    udpClient.Close()
End Sub

Private Sub udpClient_UserState(ByVal sender As Object, ByVal e As UserStateEventArgs)
    textBox1.AppendText(e.Message)
End Sub

See Also

Reference

Udp Class
Udp Members


UdpBase Class

[image]
PowerTCP Sockets for .NET
UdpBase Class
Members See Also Send comments on this topic
Dart.Sockets Namespace : UdpBase Class

Glossary Item Box

Base class for upper-layer protocols based on UDP.

Object Model

UdpBase ClassUdpSocketOption Class

Syntax

Visual Basic (Declaration)
Public Class UdpBase
   Inherits SocketBase
Visual Basic (Usage) Copy Code
Dim instance As UdpBase
C#
public class UdpBase : SocketBase
Managed Extensions for C++
public __gc class UdpBase : public SocketBase
C++/CLI
public ref class UdpBase : public SocketBase

Inheritance Hierarchy

System.Object
System.MarshalByRefObject
System.ComponentModel.Component
Dart.Sockets.ComponentBase
Dart.Sockets.SocketBase
Dart.Sockets.UdpBase
Dart.Sockets.Udp

See Also

Reference

UdpBase Members
Dart.Sockets Namespace


UdpBase Class Members

[image]
PowerTCP Sockets for .NET
UdpBase Class Members
See Also Properties Methods Events Send comments on this topic
Dart.Sockets Namespace : UdpBase Class

Glossary Item Box

The following tables list the members exposed by UdpBase.

Public Constructors

 | Name | Description
Public Constructor | UdpBase Constructor | Default constructor for UdpBase
Top

Public Properties

 | Name | Description
Public Property | Container | (Inherited from System.ComponentModel.Component)
Public Property | Encoding | Character encoding used by the component. (Inherited from Dart.Sockets.ComponentBase)
Public Property | Site | (Inherited from System.ComponentModel.Component)
Public Property | Socket | Gets the socket used by the component for communications. (Inherited from Dart.Sockets.SocketBase)
Public Property | SocketOption | Gets the socket options for classes derived from UdpBase.
Public Property | SynchronizingObject | Gets or sets the object used to marshal data to the UI thread (for raising events). (Inherited from Dart.Sockets.ComponentBase)
Public Property | SyncRoot | Gets an object that is used to synchronize access to the upper layer protocol in use. (Inherited from Dart.Sockets.ComponentBase)
Public Property | Tag | Gets or sets an object that stores any user data. (Inherited from Dart.Sockets.ComponentBase)
Top

Protected Properties

 | Name | Description
Protected Property | CanRaiseEvents | (Inherited from System.ComponentModel.Component)
Protected Property | DesignMode | (Inherited from System.ComponentModel.Component)
Protected Property | Events | (Inherited from System.ComponentModel.Component)
Top

Public Methods

 | Name | Description
Public Method | Close | Close the socket and release all resources.
Public Method | CreateObjRef | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from System.MarshalByRefObject)
Public Method | Deserialize | Deserialize a previously serialized object. (Inherited from Dart.Sockets.ComponentBase)
Public Method | Dispose | Overloaded. Disposes of SocketBase and its associated resources. (Inherited from Dart.Sockets.SocketBase)
Public Method | GetLifetimeService | Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | InitializeLifetimeService | Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | JoinMulticastGroup | Join the specified multicast group for receiving datagrams.
Public Method | LeaveMulticastGroup | Leave the specified multicast group for receiving datagrams.
Public Method | Marshal | Overloaded. Marshals a string and/or object to the UI thread and raises the UserState event. (Inherited from Dart.Sockets.ComponentBase)
Public Method | Open | Overloaded. Opens a socket on all IPv4 network interfaces and the specified port.
Public Method | Receive | Overloaded. Receive a datagram.
Public Method | ReceiveAsync | Receive a datagram asynchronously.
Public Method | Send | Overloaded. Send a datagram to the specified remote address and port.
Public Method | SendAsync | Send a datagram to the specified IPEndPoint asynchronously, specifying a buffer, offset, length and SocketFlags value.
Public Method | Serialize | Serialize an object to the provided destination stream. (Inherited from Dart.Sockets.ComponentBase)
Public Method | ToString | (Inherited from System.ComponentModel.Component)
Top

Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from System.ComponentModel.Component)
Protected Method | GetService | (Inherited from System.ComponentModel.Component)
Protected Method | MemberwiseClone | Overloaded. Creates a shallow copy of the current System.MarshalByRefObject object. (Inherited from System.MarshalByRefObject)
Protected Method | OnError | Raises the Error event. (Inherited from Dart.Sockets.ComponentBase)
Protected Method | OnUserState | Raises the UserState event. (Inherited from Dart.Sockets.ComponentBase)
Top

Public Events

 | Name | Description
Public Event | Disposed | (Inherited from System.ComponentModel.Component)
Public Event | Error | Raised when Marshal(Exception) is used or an unhandled Exception is thrown in a worker thread created using Start. (Inherited from Dart.Sockets.ComponentBase)
Public Event | UserState | Raised when Marshal(String,Object) is used. (Inherited from Dart.Sockets.ComponentBase)
Top

See Also

Reference

UdpBase Class
Dart.Sockets Namespace


UdpBase Constructor

[image]
PowerTCP Sockets for .NET
UdpBase Constructor
See Also Send comments on this topic
Dart.Sockets Namespace > UdpBase Class : UdpBase Constructor

Glossary Item Box

Default constructor for UdpBase

Syntax

Visual Basic (Declaration)
Public Function New()
Visual Basic (Usage) Copy Code
Dim instance As New UdpBase()
C#
public UdpBase()
Managed Extensions for C++
public: UdpBase();
C++/CLI
public:
UdpBase();

See Also

Reference

UdpBase Class
UdpBase Members


UdpBase Class Methods

[image]
PowerTCP Sockets for .NET
UdpBase Class Methods
See Also Send comments on this topic
Dart.Sockets Namespace : UdpBase Class

Glossary Item Box

For a list of all members of this type, see UdpBase members.

Public Methods

 | Name | Description
Public Method | Close | Close the socket and release all resources.
Public Method | CreateObjRef | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from System.MarshalByRefObject)
Public Method | Deserialize | Deserialize a previously serialized object. (Inherited from Dart.Sockets.ComponentBase)
Public Method | Dispose | Overloaded. Disposes of SocketBase and its associated resources. (Inherited from Dart.Sockets.SocketBase)
Public Method | GetLifetimeService | Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | InitializeLifetimeService | Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | JoinMulticastGroup | Join the specified multicast group for receiving datagrams.
Public Method | LeaveMulticastGroup | Leave the specified multicast group for receiving datagrams.
Public Method | Marshal | Overloaded. Marshals a string and/or object to the UI thread and raises the UserState event. (Inherited from Dart.Sockets.ComponentBase)
Public Method | Open | Overloaded. Opens a socket on all IPv4 network interfaces and the specified port.
Public Method | Receive | Overloaded. Receive a datagram.
Public Method | ReceiveAsync | Receive a datagram asynchronously.
Public Method | Send | Overloaded. Send a datagram to the specified remote address and port.
Public Method | SendAsync | Send a datagram to the specified IPEndPoint asynchronously, specifying a buffer, offset, length and SocketFlags value.
Public Method | Serialize | Serialize an object to the provided destination stream. (Inherited from Dart.Sockets.ComponentBase)
Public Method | ToString | (Inherited from System.ComponentModel.Component)
Top

Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from System.ComponentModel.Component)
Protected Method | GetService | (Inherited from System.ComponentModel.Component)
Protected Method | MemberwiseClone | Overloaded. Creates a shallow copy of the current System.MarshalByRefObject object. (Inherited from System.MarshalByRefObject)
Protected Method | OnError | Raises the Error event. (Inherited from Dart.Sockets.ComponentBase)
Protected Method | OnUserState | Raises the UserState event. (Inherited from Dart.Sockets.ComponentBase)
Top

See Also

Reference

UdpBase Class
Dart.Sockets Namespace


Close Method

[image]
PowerTCP Sockets for .NET
Close Method
See Also Send comments on this topic
Dart.Sockets Namespace > UdpBase Class : Close Method

Glossary Item Box

Close the socket and release all resources.

Syntax

Visual Basic (Declaration)
Public Sub Close()
Visual Basic (Usage) Copy Code
Dim instance As UdpBase

instance.Close()
C#
public void Close()
Managed Extensions for C++
public: void Close();
C++/CLI
public:
void Close();

See Also

Reference

UdpBase Class
UdpBase Members


JoinMulticastGroup Method

[image]
PowerTCP Sockets for .NET
JoinMulticastGroup Method
See Also Example Send comments on this topic
Dart.Sockets Namespace > UdpBase Class : JoinMulticastGroup Method

groupAddress
The System.Net.IPAddress specifying the multicast group address to join.

Glossary Item Box

Join the specified multicast group for receiving datagrams.

Syntax

Visual Basic (Declaration)
<SecuritySafeCriticalAttribute()>
Public Sub JoinMulticastGroup( _
   ByVal groupAddress As IPAddress _
)
Visual Basic (Usage) Copy Code
Dim instance As UdpBase
Dim groupAddress As IPAddress

instance.JoinMulticastGroup(groupAddress)
C#
[SecuritySafeCritical()]
public void JoinMulticastGroup(
   IPAddress groupAddress
)
Managed Extensions for C++
[SecuritySafeCritical()]
public: void JoinMulticastGroup(
   IPAddress* groupAddress
)
C++/CLI
[SecuritySafeCritical()]
public:
void JoinMulticastGroup(
   IPAddress^ groupAddress
)

Parameters

groupAddress
The System.Net.IPAddress specifying the multicast group address to join.

Exceptions

Exception | Description
System.Net.Sockets.SocketException | The multicast address is unknown, invalid, or unable to be resolved.

Remarks

Use the JoinMulticastGroup method to join a multicast group. Useful when you wish for datagrams to be sent to multiple hosts. The host is able to receive all datagrams sent to the specified multicast address and port.

Multicast groups are specified as an IP Address within a specified range of addresses. This group of addresses, also know as class D IP Addresses, are in the range from 224.0.0.0 through 239.255.255.255. In order to receive packets sent to a multicast group (using Receive), you must first join the group using this method.

Using multicasting over broadcasting reduces the load on hosts that are not interested in the data sent.

Example

The following example demonstrates joining a multicast group, sending data to it, receiving that data, and leaving the multicast group.
C# Copy Code
private void button1_Click(object sender, EventArgs e)
{
    udp1.Start(multicastWorker, null);
}

private void multicastWorker(object state)
{
    IPEndPoint groupEndPoint = new IPEndPoint("239.0.0.1", 32000);
    udp1.Open(32000);
    udp1.JoinMulticastGroup(groupEndPoint.Address);
    udp1.Send("hello world!", groupEndPoint);
    byte[] buffer = new byte[1024];
    Datagram datagram = udp1.Receive(buffer);
    //Marshal data to UI for display
    udp1.Marshal(datagram.ToString(), null);
    udp1.LeaveMulticastGroup(groupEndPoint.Address);
    udp1.Close();
}

void udp1_UserState(object sender, UserStateEventArgs e)
{
    textBox1.AppendText(e.Message);
}
Visual Basic Copy Code
Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles button1.Click
    udp1.Start(AddressOf multicastWorker, Nothing)
End Sub

Private Sub multicastWorker(ByVal state As Object)
    Dim groupEndPoint As New IPEndPoint("239.0.0.1", 32000)
    udp1.Open(32000)
    udp1.JoinMulticastGroup(groupEndPoint.Address)
    udp1.Send("hello world!", groupEndPoint)
    Dim buffer(1023) As Byte
    Dim datagram As Datagram = udp1.Receive(buffer)
    'Marshal data to UI for display
    udp1.Marshal(datagram.ToString(), Nothing)
    udp1.LeaveMulticastGroup(groupEndPoint.Address)
    udp1.Close()
End Sub

Private Sub udp1_UserState(ByVal sender As Object, ByVal e As UserStateEventArgs)
    textBox1.AppendText(e.Message)
End Sub

See Also

Reference

UdpBase Class
UdpBase Members


LeaveMulticastGroup Method

[image]
PowerTCP Sockets for .NET
LeaveMulticastGroup Method
See Also Example Send comments on this topic
Dart.Sockets Namespace > UdpBase Class : LeaveMulticastGroup Method

groupAddress
The System.Net.IPAddress specifying the multicast group address to leave.

Glossary Item Box

Leave the specified multicast group for receiving datagrams.

Syntax

Visual Basic (Declaration)
Public Sub LeaveMulticastGroup( _
   ByVal groupAddress As IPAddress _
)
Visual Basic (Usage) Copy Code
Dim instance As UdpBase
Dim groupAddress As IPAddress

instance.LeaveMulticastGroup(groupAddress)
C#
public void LeaveMulticastGroup(
   IPAddress groupAddress
)
Managed Extensions for C++
public: void LeaveMulticastGroup(
   IPAddress* groupAddress
)
C++/CLI
public:
void LeaveMulticastGroup(
   IPAddress^ groupAddress
)

Parameters

groupAddress
The System.Net.IPAddress specifying the multicast group address to leave.

Exceptions

Exception | Description
System.Net.Sockets.SocketException | The multicast address is unknown, invalid, or unable to be resolved.

Remarks

Use LeaveMulticastGroup to leave a multicast group. groupAddress specifies the multicast address group to leave. The host will no longer be able to receive datagrams sent to the multicasted address group. The host will still be listening and will still be able to receive datagrams sent to the host's local address/port.

Example

The following example demonstrates joining a multicast group, sending data to it, receiving that data, and leaving the multicast group.
C# Copy Code
private void button1_Click(object sender, EventArgs e)
{
    udp1.Start(multicastWorker, null);
}

private void multicastWorker(object state)
{
    IPEndPoint groupEndPoint = new IPEndPoint("239.0.0.1", 32000);
    udp1.Open(32000);
    udp1.JoinMulticastGroup(groupEndPoint.Address);
    udp1.Send("hello world!", groupEndPoint);
    byte[] buffer = new byte[1024];
    Datagram datagram = udp1.Receive(buffer);
    //Marshal data to UI for display
    udp1.Marshal(datagram.ToString(), null);
    udp1.LeaveMulticastGroup(groupEndPoint.Address);
    udp1.Close();
}

void udp1_UserState(object sender, UserStateEventArgs e)
{
    textBox1.AppendText(e.Message);
}
Visual Basic Copy Code
Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles button1.Click
    udp1.Start(AddressOf multicastWorker, Nothing)
End Sub

Private Sub multicastWorker(ByVal state As Object)
    Dim groupEndPoint As New IPEndPoint("239.0.0.1", 32000)
    udp1.Open(32000)
    udp1.JoinMulticastGroup(groupEndPoint.Address)
    udp1.Send("hello world!", groupEndPoint)
    Dim buffer(1023) As Byte
    Dim datagram As Datagram = udp1.Receive(buffer)
    'Marshal data to UI for display
    udp1.Marshal(datagram.ToString(), Nothing)
    udp1.LeaveMulticastGroup(groupEndPoint.Address)
    udp1.Close()
End Sub

Private Sub udp1_UserState(ByVal sender As Object, ByVal e As UserStateEventArgs)
    textBox1.AppendText(e.Message)
End Sub

See Also

Reference

UdpBase Class
UdpBase Members


Open Method

[image]
PowerTCP Sockets for .NET
Open Method
See Also Send comments on this topic
Dart.Sockets Namespace > UdpBase Class : Open Method

Glossary Item Box

Opens a socket on all IPv4 network interfaces and the specified port.

Overload List

Overload | Description
Open(Int32) | Opens a socket on all IPv4 network interfaces and the specified port.
Open(IPEndPoint) | Opens a socket on the specified local IPEndPoint.

See Also

Reference

UdpBase Class
UdpBase Members


Open(Int32) Method

[image]
PowerTCP Sockets for .NET
Open(Int32) Method
See Also Send comments on this topic
Dart.Sockets Namespace > UdpBase Class > Open Method : Open(Int32) Method

port
The port to send and receive datagrams from.

Glossary Item Box

Opens a socket on all IPv4 network interfaces and the specified port.

Syntax

Visual Basic (Declaration)
Public Overloads Sub Open( _
   ByVal port As Integer _
)
Visual Basic (Usage) Copy Code
Dim instance As UdpBase
Dim port As Integer

instance.Open(port)
C#
public void Open(
   int port
)
Managed Extensions for C++
public: void Open(
   int port
)
C++/CLI
public:
void Open(
   int port
)

Parameters

port
The port to send and receive datagrams from.

See Also

Reference

UdpBase Class
UdpBase Members
Overload List


Open(IPEndPoint) Method

[image]
PowerTCP Sockets for .NET
Open(IPEndPoint) Method
See Also Send comments on this topic
Dart.Sockets Namespace > UdpBase Class > Open Method : Open(IPEndPoint) Method

localEP
The System.Net.IPEndPoint to send and receive datagrams from. Can specify a port range by using IPEndPoint.

Glossary Item Box

Opens a socket on the specified local IPEndPoint.

Syntax

Visual Basic (Declaration)
<SecuritySafeCriticalAttribute()>
Public Overloads Sub Open( _
   ByVal localEP As IPEndPoint _
)
Visual Basic (Usage) Copy Code
Dim instance As UdpBase
Dim localEP As IPEndPoint

instance.Open(localEP)
C#
[SecuritySafeCritical()]
public void Open(
   IPEndPoint localEP
)
Managed Extensions for C++
[SecuritySafeCritical()]
public: void Open(
   IPEndPoint* localEP
)
C++/CLI
[SecuritySafeCritical()]
public:
void Open(
   IPEndPoint^ localEP
)

Parameters

localEP
The System.Net.IPEndPoint to send and receive datagrams from. Can specify a port range by using IPEndPoint.

See Also

Reference

UdpBase Class
UdpBase Members
Overload List


Receive Method

[image]
PowerTCP Sockets for .NET
Receive Method
See Also Send comments on this topic
Dart.Sockets Namespace > UdpBase Class : Receive Method

Glossary Item Box

Receive a datagram.

Overload List

Overload | Description
Receive(Byte[]) | Receive a datagram.
Receive(Byte[],Int32,Int32,SocketFlags) | Receive a datagram.

See Also

Reference

UdpBase Class
UdpBase Members


Receive(Byte[]) Method

[image]
PowerTCP Sockets for .NET
Receive(Byte[]) Method
See Also Send comments on this topic
Dart.Sockets Namespace > UdpBase Class > Receive Method : Receive(Byte[]) Method

buffer
A byte array to be filled with the data received.

Glossary Item Box

Receive a datagram.

Syntax

Visual Basic (Declaration)
Public Overloads Function Receive( _
   ByVal buffer() As Byte _
) As Datagram
Visual Basic (Usage) Copy Code
Dim instance As UdpBase
Dim buffer() As Byte
Dim value As Datagram

value = instance.Receive(buffer)
C#
public Datagram Receive(
   byte[] buffer
)
Managed Extensions for C++
public: Datagram* Receive(
   byte[]* buffer
)
C++/CLI
public:
Datagram^ Receive(
   array<byte>^ buffer
)

Parameters

buffer
A byte array to be filled with the data received.

Return Value

A Datagram object encapsulating the datagram received. Returns null when the local socket is closed.

Exceptions

Exception | Description
System.ArgumentNullException | buffer is null.

Remarks

Use the Receive method to receive a datagram into buffer. This method also returns a Datagram object encapsulating the datagram received. Segment.Buffer contains the actual datagram data (equivalent to buffer). Datagram.Origin contains the endpoint of the remote host from which the datagram was sent.

A UDP datagram provides little functionality over an IP datagram, adding a port number field (allows demultiplexing on the receiving host) and a checksum field (provides basic error handling). Unlike TCP, UDP datagrams are sent as a unit. If Send is called 3 times to send 3 datagrams to a host, the receiving host will have to call Receive 3 times. Also, the size of each datagram sent will equal the size of each datagram received by the receiving host. In addition, since UDP is a connectionless protocol, datagrams sent to the host are not guaranteed to be delivered. Therefore, any required error checking (outside of UDP's checksum implementation) will have to be done by the application-layer protocol.

See Also

Reference

UdpBase Class
UdpBase Members
Overload List


Receive(Byte[],Int32,Int32,SocketFlags) Method

[image]
PowerTCP Sockets for .NET
Receive(Byte[],Int32,Int32,SocketFlags) Method
See Also Send comments on this topic
Dart.Sockets Namespace > UdpBase Class > Receive Method : Receive(Byte[],Int32,Int32,SocketFlags) Method

buffer
A byte array to be filled with the data received.
offset
Location where received bytes are to placed.
size
The number of bytes to receive.
socketFlags
User specified SocketFlags.

Glossary Item Box

Receive a datagram.

Syntax

Visual Basic (Declaration)
<SecuritySafeCriticalAttribute()>
Public Overloads Function Receive( _
   ByVal buffer() As Byte, _
   ByVal offset As Integer, _
   ByVal size As Integer, _
   ByVal socketFlags As SocketFlags _
) As Datagram
Visual Basic (Usage) Copy Code
Dim instance As UdpBase
Dim buffer() As Byte
Dim offset As Integer
Dim size As Integer
Dim socketFlags As SocketFlags
Dim value As Datagram

value = instance.Receive(buffer, offset, size, socketFlags)
C#
[SecuritySafeCritical()]
public Datagram Receive(
   byte[] buffer,
   int offset,
   int size,
   SocketFlags socketFlags
)
Managed Extensions for C++
[SecuritySafeCritical()]
public: Datagram* Receive(
   byte[]* buffer,
   int offset,
   int size,
   SocketFlags socketFlags
)
C++/CLI
[SecuritySafeCritical()]
public:
Datagram^ Receive(
   array<byte>^ buffer,
   int offset,
   int size,
   SocketFlags socketFlags
)

Parameters

buffer
A byte array to be filled with the data received.
offset
Location where received bytes are to placed.
size
The number of bytes to receive.
socketFlags
User specified SocketFlags.

Return Value

A Datagram object encapsulating the datagram received. Returns null when the local socket is closed.

Exceptions

Exception | Description
System.ArgumentNullException | buffer is null.

Remarks

Use the Receive method to receive a datagram into buffer. This method also returns a Datagram object encapsulating the datagram received. Segment.Buffer contains the actual datagram data (equivalent to buffer). Datagram.Origin contains the endpoint of the remote host from which the datagram was sent.

A UDP datagram provides little functionality over an IP datagram, adding a port number field (allows demultiplexing on the receiving host) and a checksum field (provides basic error handling). Unlike TCP, UDP datagrams are sent as a unit. If Send is called 3 times to send 3 datagrams to a host, the receiving host will have to call Receive 3 times. Also, the size of each datagram sent will equal the size of each datagram received by the receiving host. In addition, since UDP is a connectionless protocol, datagrams sent to the host are not guaranteed to be delivered. Therefore, any required error checking (outside of UDP's checksum implementation) will have to be done by the application-layer protocol.

See Also

Reference

UdpBase Class
UdpBase Members
Overload List


ReceiveAsync Method

[image]
PowerTCP Sockets for .NET
ReceiveAsync Method
See Also Send comments on this topic
Dart.Sockets Namespace > UdpBase Class : ReceiveAsync Method

buffer
A byte array to be filled with the data received.
offset
Location where received bytes are to placed.
size
The number of bytes to receive.
socketFlags
User specified SocketFlags.
callback
A UdpAsyncCallback delegate referencing the method to invoke on an IO completion thread when the operation completes.
state
Object to pass into the callback method when the operation completes; can be null.

Glossary Item Box

Receive a datagram asynchronously.

Syntax

Visual Basic (Declaration)
<SecuritySafeCriticalAttribute()>
Public Sub ReceiveAsync( _
   ByVal buffer() As Byte, _
   ByVal offset As Integer, _
   ByVal size As Integer, _
   ByVal socketFlags As SocketFlags, _
   ByVal callback As UdpAsyncCallback, _
   ByVal state As Object _
)
Visual Basic (Usage) Copy Code
Dim instance As UdpBase
Dim buffer() As Byte
Dim offset As Integer
Dim size As Integer
Dim socketFlags As SocketFlags
Dim callback As UdpAsyncCallback
Dim state As Object

instance.ReceiveAsync(buffer, offset, size, socketFlags, callback, state)
C#
[SecuritySafeCritical()]
public void ReceiveAsync(
   byte[] buffer,
   int offset,
   int size,
   SocketFlags socketFlags,
   UdpAsyncCallback callback,
   object state
)
Managed Extensions for C++
[SecuritySafeCritical()]
public: void ReceiveAsync(
   byte[]* buffer,
   int offset,
   int size,
   SocketFlags socketFlags,
   UdpAsyncCallback* callback,
   Object* state
)
C++/CLI
[SecuritySafeCritical()]
public:
void ReceiveAsync(
   array<byte>^ buffer,
   int offset,
   int size,
   SocketFlags socketFlags,
   UdpAsyncCallback^ callback,
   Object^ state
)

Parameters

buffer
A byte array to be filled with the data received.
offset
Location where received bytes are to placed.
size
The number of bytes to receive.
socketFlags
User specified SocketFlags.
callback
A UdpAsyncCallback delegate referencing the method to invoke on an IO completion thread when the operation completes.
state
Object to pass into the callback method when the operation completes; can be null.

Exceptions

Exception | Description
System.ArgumentNullException | buffer is null.

Remarks

Use the ReceiveAsync method to receive a datagram into buffer asynchronously. This method returns immediately and invokes the provided UdpAsyncCompleted delegate on an IO Completion thread after a datagram has been received.

A UDP datagram provides little functionality over an IP datagram, adding a port number field (allows demultiplexing on the receiving host) and a checksum field (provides basic error handling). Unlike TCP, UDP datagrams are sent as a unit. If Send is called 3 times to send 3 datagrams to a host, the receiving host will have to call Receive 3 times. Also, the size of each datagram sent will equal the size of each datagram received by the receiving host. In addition, since UDP is a connectionless protocol, datagrams sent to the host are not guaranteed to be delivered. Therefore, any required error checking (outside of UDP's checksum implementation) will have to be done by the application-layer protocol.

See Also

Reference

UdpBase Class
UdpBase Members


Send Method

[image]
PowerTCP Sockets for .NET
Send Method
See Also Send comments on this topic
Dart.Sockets Namespace > UdpBase Class : Send Method

Glossary Item Box

Send a datagram to the specified remote address and port.

Overload List

Overload | Description
Send(String,String,Int32) | Send a datagram to the specified remote address and port.
Send(Byte[],String,Int32) | Send a datagram to the specified remote address and port.
Send(String,IPEndPoint) | Send a datagram to the specified IPEndPoint.
Send(Byte[],IPEndPoint) | Send a datagram to the specified IPEndPoint.
Send(Byte[],Int32,Int32,SocketFlags,IPEndPoint) | Send a datagram to the specified IPEndPoint, specifying a buffer, offset, length and SocketFlags value.

See Also

Reference

UdpBase Class
UdpBase Members


Send(String,String,Int32) Method

[image]
PowerTCP Sockets for .NET
Send(String,String,Int32) Method
See Also Send comments on this topic
Dart.Sockets Namespace > UdpBase Class > Send Method : Send(String,String,Int32) Method

buffer
A string containing the data to send.
hostNameOrAddress
The host address (either dot address or hostname) to send the datagram to.
port
The host port to send the datagram to.

Glossary Item Box

Send a datagram to the specified remote address and port.

Syntax

Visual Basic (Declaration)
Public Overloads Function Send( _
   ByVal buffer As String, _
   ByVal hostNameOrAddress As String, _
   ByVal port As Integer _
) As Datagram
Visual Basic (Usage) Copy Code
Dim instance As UdpBase
Dim buffer As String
Dim hostNameOrAddress As String
Dim port As Integer
Dim value As Datagram

value = instance.Send(buffer, hostNameOrAddress, port)
C#
public Datagram Send(
   string buffer,
   string hostNameOrAddress,
   int port
)
Managed Extensions for C++
public: Datagram* Send(
   string* buffer,
   string* hostNameOrAddress,
   int port
)
C++/CLI
public:
Datagram^ Send(
   String^ buffer,
   String^ hostNameOrAddress,
   int port
)

Parameters

buffer
A string containing the data to send.
hostNameOrAddress
The host address (either dot address or hostname) to send the datagram to.
port
The host port to send the datagram to.

Return Value

A Datagram object encapsulating the datagram sent.

Exceptions

Exception | Description
System.ArgumentNullException | buffer is null.
System.Net.Sockets.SocketException | The remote address is unknown, invalid, or unable to be resolved.
System.ArgumentOutOfRangeException | The remote port is out of the range of valid values.

Remarks

Use the Send method to sent a datagram created from the data contained in buffer to the specified hostNameOrAddress and port. buffer is converted to a byte array before sending.

A UDP datagram provides little functionality over an IP datagram, adding a port number field (allows demultiplexing on the receiving host) and a checksum field (provides basic error handling). Unlike TCP, UDP datagrams are sent as a unit. If Send is called 3 times to send 3 datagrams to a host, the receiving host will have to call Receive 3 times. Also, the size of each datagram sent will equal the size of each datagram received by the receiving host. In addition, since UDP is a connectionless protocol, any datagrams sent to the host are not guaranteed to be delivered. Therefore, any required error checking (outside of UDP's checksum implementation) will have to be done by the application-layer protocol.

To send a broadcast datagram, use "255.255.255.255" as the remote address. To send a multicast datagram, use the multicast group address as the remote address after first joining a multicast group by using JoinMulitcastGroup.

See Also

Reference

UdpBase Class
UdpBase Members
Overload List


Send(Byte[],String,Int32) Method

[image]
PowerTCP Sockets for .NET
Send(Byte[],String,Int32) Method
See Also Send comments on this topic
Dart.Sockets Namespace > UdpBase Class > Send Method : Send(Byte[],String,Int32) Method

buffer
A byte array containing the data to send.
hostNameOrAddress
The host address (either dot address or hostname) to send the datagram to.
port
The host port to send the datagram to.

Glossary Item Box

Send a datagram to the specified remote address and port.

Syntax

Visual Basic (Declaration)
Public Overloads Function Send( _
   ByVal buffer() As Byte, _
   ByVal hostNameOrAddress As String, _
   ByVal port As Integer _
) As Datagram
Visual Basic (Usage) Copy Code
Dim instance As UdpBase
Dim buffer() As Byte
Dim hostNameOrAddress As String
Dim port As Integer
Dim value As Datagram

value = instance.Send(buffer, hostNameOrAddress, port)
C#
public Datagram Send(
   byte[] buffer,
   string hostNameOrAddress,
   int port
)
Managed Extensions for C++
public: Datagram* Send(
   byte[]* buffer,
   string* hostNameOrAddress,
   int port
)
C++/CLI
public:
Datagram^ Send(
   array<byte>^ buffer,
   String^ hostNameOrAddress,
   int port
)

Parameters

buffer
A byte array containing the data to send.
hostNameOrAddress
The host address (either dot address or hostname) to send the datagram to.
port
The host port to send the datagram to.

Return Value

A Datagram object encapsulating the datagram sent.

Exceptions

Exception | Description
System.ArgumentNullException | buffer is null.
System.Net.Sockets.SocketException | The remote address is unknown, invalid, or unable to be resolved.
System.ArgumentOutOfRangeException | The remote port is out of the range of valid values.

Remarks

Use the Send method to sent a datagram created from the data contained in buffer to the specified hostNameOrAddress and port.

A UDP datagram provides little functionality over an IP datagram, adding a port number field (allows demultiplexing on the receiving host) and a checksum field (provides basic error handling). Unlike TCP, UDP datagrams are sent as a unit. If Send is called 3 times to send 3 datagrams to a host, the receiving host will have to call Receive 3 times. Also, the size of each datagram sent will equal the size of each datagram received by the receiving host. In addition, since UDP is a connectionless protocol, any datagrams sent to the host are not guaranteed to be delivered. Therefore, any required error checking (outside of UDP's checksum implementation) will have to be done by the application-layer protocol.

To send a broadcast datagram, use "255.255.255.255" as the remote address. To send a multicast datagram, use the multicast group address as the remote address after first joining a multicast group by using JoinMulitcastGroup.

See Also

Reference

UdpBase Class
UdpBase Members
Overload List


Send(String,IPEndPoint) Method

[image]
PowerTCP Sockets for .NET
Send(String,IPEndPoint) Method
See Also Send comments on this topic
Dart.Sockets Namespace > UdpBase Class > Send Method : Send(String,IPEndPoint) Method

buffer
A string containing the data to send.
destination
The System.Net.IPEndPoint representing the remote hosts's IP address and port.

Glossary Item Box

Send a datagram to the specified IPEndPoint.

Syntax

Visual Basic (Declaration)
Public Overloads Function Send( _
   ByVal buffer As String, _
   ByVal destination As IPEndPoint _
) As Datagram
Visual Basic (Usage) Copy Code
Dim instance As UdpBase
Dim buffer As String
Dim destination As IPEndPoint
Dim value As Datagram

value = instance.Send(buffer, destination)
C#
public Datagram Send(
   string buffer,
   IPEndPoint destination
)
Managed Extensions for C++
public: Datagram* Send(
   string* buffer,
   IPEndPoint* destination
)
C++/CLI
public:
Datagram^ Send(
   String^ buffer,
   IPEndPoint^ destination
)

Parameters

buffer
A string containing the data to send.
destination
The System.Net.IPEndPoint representing the remote hosts's IP address and port.

Return Value

A Datagram object encapsulating the datagram sent.

Exceptions

Exception | Description
System.ArgumentNullException | buffer is null.
System.Net.Sockets.SocketException | The remote address is unknown, invalid, or unable to be resolved.
System.ArgumentOutOfRangeException | The remote port is out of the range of valid values.

Remarks

Use the Send method to send a datagram created from the data contained in buffer to the specified hostNameOrAddress. buffer is converted to a byte array before sending.

A UDP datagram provides little functionality over an IP datagram, adding a port number field (allows demultiplexing on the receiving host) and a checksum field (provides basic error handling). Unlike TCP, UDP datagrams are sent as a unit. If Send is called 3 times to send 3 datagrams to a host, the receiving host will have to call Receive 3 times. Also, the size of each datagram sent will equal the size of each datagram received by the receiving host. In addition, since UDP is a connectionless protocol, any datagrams sent to the host are not guaranteed to be delivered. Therefore, any required error checking (outside of UDP's checksum implementation) will have to be done by the application-layer protocol.

To send a broadcast datagram, use "255.255.255.255" as the remote address. To send a multicast datagram, use the multicast group address as the remote address after first joining a multicast group by using JoinMulitcastGroup.

See Also

Reference

UdpBase Class
UdpBase Members
Overload List


Send(Byte[],IPEndPoint) Method

[image]
PowerTCP Sockets for .NET
Send(Byte[],IPEndPoint) Method
See Also Send comments on this topic
Dart.Sockets Namespace > UdpBase Class > Send Method : Send(Byte[],IPEndPoint) Method

buffer
A byte array containing the data to send.
destination
The System.Net.IPEndPoint representing the remote hosts's IP address and port.

Glossary Item Box

Send a datagram to the specified IPEndPoint.

Syntax

Visual Basic (Declaration)
Public Overloads Function Send( _
   ByVal buffer() As Byte, _
   ByVal destination As IPEndPoint _
) As Datagram
Visual Basic (Usage) Copy Code
Dim instance As UdpBase
Dim buffer() As Byte
Dim destination As IPEndPoint
Dim value As Datagram

value = instance.Send(buffer, destination)
C#
public Datagram Send(
   byte[] buffer,
   IPEndPoint destination
)
Managed Extensions for C++
public: Datagram* Send(
   byte[]* buffer,
   IPEndPoint* destination
)
C++/CLI
public:
Datagram^ Send(
   array<byte>^ buffer,
   IPEndPoint^ destination
)

Parameters

buffer
A byte array containing the data to send.
destination
The System.Net.IPEndPoint representing the remote hosts's IP address and port.

Return Value

A Datagram object encapsulating the datagram sent.

Exceptions

Exception | Description
System.ArgumentNullException | buffer is null.
System.Net.Sockets.SocketException | The remote address is unknown, invalid, or unable to be resolved.
System.ArgumentOutOfRangeException | The remote port is out of the range of valid values.

Remarks

Use the Send method to sent a datagram created from the data contained in buffer to the specified hostNameOrAddress.

A UDP datagram provides little functionality over an IP datagram, adding a port number field (allows demultiplexing on the receiving host) and a checksum field (provides basic error handling). Unlike TCP, UDP datagrams are sent as a unit. If Send is called 3 times to send 3 datagrams to a host, the receiving host will have to call Receive 3 times. Also, the size of each datagram sent will equal the size of each datagram received by the receiving host. In addition, since UDP is a connectionless protocol, any datagrams sent to the host are not guaranteed to be delivered. Therefore, any required error checking (outside of UDP's checksum implementation) will have to be done by the application-layer protocol.

To send a broadcast datagram, use "255.255.255.255" as the remote address. To send a multicast datagram, use the multicast group address as the remote address after first joining a multicast group by using JoinMulitcastGroup.

See Also

Reference

UdpBase Class
UdpBase Members
Overload List


Send(Byte[],Int32,Int32,SocketFlags,IPEndPoint) Method

[image]
PowerTCP Sockets for .NET
Send(Byte[],Int32,Int32,SocketFlags,IPEndPoint) Method
See Also Send comments on this topic
Dart.Sockets Namespace > UdpBase Class > Send Method : Send(Byte[],Int32,Int32,SocketFlags,IPEndPoint) Method

buffer
A byte array containing the data to send.
offset
Starting offset within buffer for sending.
count
Number of bytes to send.
socketFlags
A bitwise combination of special use sending parameters.
destination
The System.Net.IPEndPoint representing the remote hosts's IP address and port.

Glossary Item Box

Send a datagram to the specified IPEndPoint, specifying a buffer, offset, length and SocketFlags value.

Syntax

Visual Basic (Declaration)
<SecuritySafeCriticalAttribute()>
Public Overloads Function Send( _
   ByVal buffer() As Byte, _
   ByVal offset As Integer, _
   ByVal count As Integer, _
   ByVal socketFlags As SocketFlags, _
   ByVal destination As IPEndPoint _
) As Datagram
Visual Basic (Usage) Copy Code
Dim instance As UdpBase
Dim buffer() As Byte
Dim offset As Integer
Dim count As Integer
Dim socketFlags As SocketFlags
Dim destination As IPEndPoint
Dim value As Datagram

value = instance.Send(buffer, offset, count, socketFlags, destination)
C#
[SecuritySafeCritical()]
public Datagram Send(
   byte[] buffer,
   int offset,
   int count,
   SocketFlags socketFlags,
   IPEndPoint destination
)
Managed Extensions for C++
[SecuritySafeCritical()]
public: Datagram* Send(
   byte[]* buffer,
   int offset,
   int count,
   SocketFlags socketFlags,
   IPEndPoint* destination
)
C++/CLI
[SecuritySafeCritical()]
public:
Datagram^ Send(
   array<byte>^ buffer,
   int offset,
   int count,
   SocketFlags socketFlags,
   IPEndPoint^ destination
)

Parameters

buffer
A byte array containing the data to send.
offset
Starting offset within buffer for sending.
count
Number of bytes to send.
socketFlags
A bitwise combination of special use sending parameters.
destination
The System.Net.IPEndPoint representing the remote hosts's IP address and port.

Return Value

A Datagram object encapsulating the datagram sent.

Exceptions

Exception | Description
System.ArgumentNullException | buffer is null.
System.Net.Sockets.SocketException | The remote address is unknown, invalid, or unable to be resolved.
System.ArgumentOutOfRangeException | The remote port is out of the range of valid values. --or-- offset or count is less than 0.
System.ArgumentException | offset + count is greater than the length of buffer.

Remarks

Use the Send method to sent a datagram created from the data contained in buffer to the specified hostNameOrAddress.

A UDP datagram provides little functionality over an IP datagram, adding a port number field (allows demultiplexing on the receiving host) and a checksum field (provides basic error handling). Unlike TCP, UDP datagrams are sent as a unit. If Send is called 3 times to send 3 datagrams to a host, the receiving host will have to call Receive 3 times. Also, the size of each datagram sent will equal the size of each datagram received by the receiving host. In addition, since UDP is a connectionless protocol, any datagrams sent to the host are not guaranteed to be delivered. Therefore, any required error checking (outside of UDP's checksum implementation) will have to be done by the application-layer protocol.

To send a broadcast datagram, use "255.255.255.255" as the remote address. To send a multicast datagram, use the multicast group address as the remote address after first joining a multicast group by using JoinMulitcastGroup.

See Also

Reference

UdpBase Class
UdpBase Members
Overload List


SendAsync Method

[image]
PowerTCP Sockets for .NET
SendAsync Method
See Also Send comments on this topic
Dart.Sockets Namespace > UdpBase Class : SendAsync Method

buffer
A byte array containing the data to send.
offset
Starting offset within buffer for sending.
count
Number of bytes to send.
socketFlags
A bitwise combination of special use sending parameters.
destination
The System.Net.IPEndPoint representing the remote hosts's IP address and port.
callback
A UdpAsyncCallback delegate referencing the method to invoke on an IO completion thread when the operation completes.
state
Object to pass into the callback method when the operation completes; can be null.

Glossary Item Box

Send a datagram to the specified IPEndPoint asynchronously, specifying a buffer, offset, length and SocketFlags value.

Syntax

Visual Basic (Declaration)
<SecuritySafeCriticalAttribute()>
Public Sub SendAsync( _
   ByVal buffer() As Byte, _
   ByVal offset As Integer, _
   ByVal count As Integer, _
   ByVal socketFlags As SocketFlags, _
   ByVal destination As IPEndPoint, _
   ByVal callback As UdpAsyncCallback, _
   ByVal state As Object _
)
Visual Basic (Usage) Copy Code
Dim instance As UdpBase
Dim buffer() As Byte
Dim offset As Integer
Dim count As Integer
Dim socketFlags As SocketFlags
Dim destination As IPEndPoint
Dim callback As UdpAsyncCallback
Dim state As Object

instance.SendAsync(buffer, offset, count, socketFlags, destination, callback, state)
C#
[SecuritySafeCritical()]
public void SendAsync(
   byte[] buffer,
   int offset,
   int count,
   SocketFlags socketFlags,
   IPEndPoint destination,
   UdpAsyncCallback callback,
   object state
)
Managed Extensions for C++
[SecuritySafeCritical()]
public: void SendAsync(
   byte[]* buffer,
   int offset,
   int count,
   SocketFlags socketFlags,
   IPEndPoint* destination,
   UdpAsyncCallback* callback,
   Object* state
)
C++/CLI
[SecuritySafeCritical()]
public:
void SendAsync(
   array<byte>^ buffer,
   int offset,
   int count,
   SocketFlags socketFlags,
   IPEndPoint^ destination,
   UdpAsyncCallback^ callback,
   Object^ state
)

Parameters

buffer
A byte array containing the data to send.
offset
Starting offset within buffer for sending.
count
Number of bytes to send.
socketFlags
A bitwise combination of special use sending parameters.
destination
The System.Net.IPEndPoint representing the remote hosts's IP address and port.
callback
A UdpAsyncCallback delegate referencing the method to invoke on an IO completion thread when the operation completes.
state
Object to pass into the callback method when the operation completes; can be null.

Exceptions

Exception | Description
System.ArgumentNullException | buffer is null.
System.Net.Sockets.SocketException | The remote address is unknown, invalid, or unable to be resolved.
System.ArgumentOutOfRangeException | The remote port is out of the range of valid values. --or-- offset or count is less than 0.
System.ArgumentException | offset + count is greater than the length of buffer.

Remarks

Use the SendAsync method to sent a datagram created from the data contained in buffer to the specified hostNameOrAddress asynchronously.

A UDP datagram provides little functionality over an IP datagram, adding a port number field (allows demultiplexing on the receiving host) and a checksum field (provides basic error handling). Unlike TCP, UDP datagrams are sent as a unit. If SendAsync is called 3 times to send 3 datagrams to a host, the receiving host will have to call Receive 3 times. Also, the size of each datagram sent will equal the size of each datagram received by the receiving host. In addition, since UDP is a connectionless protocol, any datagrams sent to the host are not guaranteed to be delivered. Therefore, any required error checking (outside of UDP's checksum implementation) will have to be done by the application-layer protocol.

To send a broadcast datagram, use "255.255.255.255" as the remote address. To send a multicast datagram, use the multicast group address as the remote address after first joining a multicast group by using JoinMulitcastGroup.

See Also

Reference

UdpBase Class
UdpBase Members


UdpBase Class Properties

[image]
PowerTCP Sockets for .NET
UdpBase Class Properties
See Also Send comments on this topic
Dart.Sockets Namespace : UdpBase Class

Glossary Item Box

For a list of all members of this type, see UdpBase members.

Public Properties

 | Name | Description
Public Property | Container | (Inherited from System.ComponentModel.Component)
Public Property | Encoding | Character encoding used by the component. (Inherited from Dart.Sockets.ComponentBase)
Public Property | Site | (Inherited from System.ComponentModel.Component)
Public Property | Socket | Gets the socket used by the component for communications. (Inherited from Dart.Sockets.SocketBase)
Public Property | SocketOption | Gets the socket options for classes derived from UdpBase.
Public Property | SynchronizingObject | Gets or sets the object used to marshal data to the UI thread (for raising events). (Inherited from Dart.Sockets.ComponentBase)
Public Property | SyncRoot | Gets an object that is used to synchronize access to the upper layer protocol in use. (Inherited from Dart.Sockets.ComponentBase)
Public Property | Tag | Gets or sets an object that stores any user data. (Inherited from Dart.Sockets.ComponentBase)
Top

Protected Properties

 | Name | Description
Protected Property | CanRaiseEvents | (Inherited from System.ComponentModel.Component)
Protected Property | DesignMode | (Inherited from System.ComponentModel.Component)
Protected Property | Events | (Inherited from System.ComponentModel.Component)
Top

See Also

Reference

UdpBase Class
Dart.Sockets Namespace


SocketOption Property

[image]
PowerTCP Sockets for .NET
SocketOption Property
See Also Send comments on this topic
Dart.Sockets Namespace > UdpBase Class : SocketOption Property

Glossary Item Box

Gets the socket options for classes derived from UdpBase.

Syntax

Visual Basic (Declaration)
Public ReadOnly Property SocketOption As UdpSocketOption
Visual Basic (Usage) Copy Code
Dim instance As UdpBase
Dim value As UdpSocketOption

value = instance.SocketOption
C#
public UdpSocketOption SocketOption {get;}
Managed Extensions for C++
public: __property UdpSocketOption* get_SocketOption();
C++/CLI
public:
property UdpSocketOption^ SocketOption {
   UdpSocketOption^ get();
}

See Also

Reference

UdpBase Class
UdpBase Members


UdpSocketOption Class

[image]
PowerTCP Sockets for .NET
UdpSocketOption Class
Members See Also Send comments on this topic
Dart.Sockets Namespace : UdpSocketOption Class

Glossary Item Box

Contains socket options that may be set by UDP sockets.

Object Model

UdpSocketOption Class

Syntax

Visual Basic (Declaration)
Public Class UdpSocketOption
   Inherits SocketOption
Visual Basic (Usage) Copy Code
Dim instance As UdpSocketOption
C#
public class UdpSocketOption : SocketOption
Managed Extensions for C++
public __gc class UdpSocketOption : public SocketOption
C++/CLI
public ref class UdpSocketOption : public SocketOption

Inheritance Hierarchy

System.Object
Dart.Sockets.SocketOption
Dart.Sockets.UdpSocketOption

See Also

Reference

UdpSocketOption Members
Dart.Sockets Namespace


UdpSocketOption Class Members

[image]
PowerTCP Sockets for .NET
UdpSocketOption Class Members
See Also Properties Send comments on this topic
Dart.Sockets Namespace : UdpSocketOption Class

Glossary Item Box

The following tables list the members exposed by UdpSocketOption.

Public Properties

 | Name | Description
Public Property | AllowBroadcast | Gets or sets the ability to send broadcast messages on the socket.
Public Property | ExclusiveAddressUse | When set to true, forbids multiple socket bindings to the same address. Set this value to true to ensure you have exclusive use of the local endpoint. Socket.ExclusiveAddressUse is set to this value before Socket.Bind is used. (Inherited from Dart.Sockets.SocketOption)
Public Property | MulticastInterface | Gets or sets the host interface to use when sending multicast datagrams.
Public Property | MulticastTimeToLive | Gets or sets the IP multicast time-to-live used when datagrams are sent to multicast addresses.
Public Property | ReceiveBufferSize | Gets or sets a value that specifies the size of the system receive buffer. (Inherited from Dart.Sockets.SocketOption)
Public Property | ReceiveTimeout | Gets or sets a value that specifies the amount of time after which the underlying Socket.Receive call will time out. (Inherited from Dart.Sockets.SocketOption)
Public Property | ReuseAddress | When set to true, allows multiple socket bindings to the same address. Set this value to true to allow multiple sockets to bind to the same local address. (Inherited from Dart.Sockets.SocketOption)
Public Property | SendBufferSize | Gets or sets a value that specifies the size of the system send buffer. (Inherited from Dart.Sockets.SocketOption)
Public Property | SendTimeout | Gets or sets a value that specifies the amount of time after which the underlying Socket Send call will time out. (Inherited from Dart.Sockets.SocketOption)
Top

See Also

Reference

UdpSocketOption Class
Dart.Sockets Namespace


UdpSocketOption Class Properties

[image]
PowerTCP Sockets for .NET
UdpSocketOption Class Properties
See Also Send comments on this topic
Dart.Sockets Namespace : UdpSocketOption Class

Glossary Item Box

For a list of all members of this type, see UdpSocketOption members.

Public Properties

 | Name | Description
Public Property | AllowBroadcast | Gets or sets the ability to send broadcast messages on the socket.
Public Property | ExclusiveAddressUse | When set to true, forbids multiple socket bindings to the same address. Set this value to true to ensure you have exclusive use of the local endpoint. Socket.ExclusiveAddressUse is set to this value before Socket.Bind is used. (Inherited from Dart.Sockets.SocketOption)
Public Property | MulticastInterface | Gets or sets the host interface to use when sending multicast datagrams.
Public Property | MulticastTimeToLive | Gets or sets the IP multicast time-to-live used when datagrams are sent to multicast addresses.
Public Property | ReceiveBufferSize | Gets or sets a value that specifies the size of the system receive buffer. (Inherited from Dart.Sockets.SocketOption)
Public Property | ReceiveTimeout | Gets or sets a value that specifies the amount of time after which the underlying Socket.Receive call will time out. (Inherited from Dart.Sockets.SocketOption)
Public Property | ReuseAddress | When set to true, allows multiple socket bindings to the same address. Set this value to true to allow multiple sockets to bind to the same local address. (Inherited from Dart.Sockets.SocketOption)
Public Property | SendBufferSize | Gets or sets a value that specifies the size of the system send buffer. (Inherited from Dart.Sockets.SocketOption)
Public Property | SendTimeout | Gets or sets a value that specifies the amount of time after which the underlying Socket Send call will time out. (Inherited from Dart.Sockets.SocketOption)
Top

See Also

Reference

UdpSocketOption Class
Dart.Sockets Namespace


AllowBroadcast Property

[image]
PowerTCP Sockets for .NET
AllowBroadcast Property
See Also Send comments on this topic
Dart.Sockets Namespace > UdpSocketOption Class : AllowBroadcast Property

Glossary Item Box

Gets or sets the ability to send broadcast messages on the socket.

Syntax

Visual Basic (Declaration)
<DefaultValueAttribute()>
Public Property AllowBroadcast As Boolean
Visual Basic (Usage) Copy Code
Dim instance As UdpSocketOption
Dim value As Boolean

instance.AllowBroadcast = value

value = instance.AllowBroadcast
C#
[DefaultValue()]
public bool AllowBroadcast {get; set;}
Managed Extensions for C++
[DefaultValue()]
public: __property bool get_AllowBroadcast();
public: __property void set_AllowBroadcast(
   bool value
);
C++/CLI
[DefaultValue()]
public:
property bool AllowBroadcast {
   bool get();
   void set (    bool value);
}

Property Value

Defaults to true.

See Also

Reference

UdpSocketOption Class
UdpSocketOption Members


MulticastInterface Property

[image]
PowerTCP Sockets for .NET
MulticastInterface Property
See Also Send comments on this topic
Dart.Sockets Namespace > UdpSocketOption Class : MulticastInterface Property

Glossary Item Box

Gets or sets the host interface to use when sending multicast datagrams.

Syntax

Visual Basic (Declaration)
Public Property MulticastInterface As IPAddress
Visual Basic (Usage) Copy Code
Dim instance As UdpSocketOption
Dim value As IPAddress

instance.MulticastInterface = value

value = instance.MulticastInterface
C#
public IPAddress MulticastInterface {get; set;}
Managed Extensions for C++
public: __property IPAddress* get_MulticastInterface();
public: __property void set_MulticastInterface(
   IPAddress* value
);
C++/CLI
public:
property IPAddress^ MulticastInterface {
   IPAddress^ get();
   void set (    IPAddress^ value);
}

Property Value

The local IPEndPoint that the Udp object is using to send/receive multicasted datagrams.

Remarks

This property is useful if the host has multiple interfaces and you wish to explicitly set the interface to use when sending datagrams to multicast addresses.

See Also

Reference

UdpSocketOption Class
UdpSocketOption Members


MulticastTimeToLive Property

[image]
PowerTCP Sockets for .NET
MulticastTimeToLive Property
See Also Send comments on this topic
Dart.Sockets Namespace > UdpSocketOption Class : MulticastTimeToLive Property

Glossary Item Box

Gets or sets the IP multicast time-to-live used when datagrams are sent to multicast addresses.

Syntax

Visual Basic (Declaration)
<DefaultValueAttribute()>
Public Property MulticastTimeToLive As Integer
Visual Basic (Usage) Copy Code
Dim instance As UdpSocketOption
Dim value As Integer

instance.MulticastTimeToLive = value

value = instance.MulticastTimeToLive
C#
[DefaultValue()]
public int MulticastTimeToLive {get; set;}
Managed Extensions for C++
[DefaultValue()]
public: __property int get_MulticastTimeToLive();
public: __property void set_MulticastTimeToLive(
   int value
);
C++/CLI
[DefaultValue()]
public:
property int MulticastTimeToLive {
   int get();
   void set (    int value);
}

Property Value

An integer value representing the time-to-live value used when datagrams are sent to multicast addresses.

Remarks

The MulticastTimeToLive property specifies the number of routers (hops) that multicast datagrams are permitted to pass through before expiring on the network. For each router (hop), this property is decremented by 1. When this property reaches 0, each multicast datagram expires and is no longer forwarded through the network to other subnets.

See Also

Reference

UdpSocketOption Class
UdpSocketOption Members


UserStateEventArgs Class

[image]
PowerTCP Sockets for .NET
UserStateEventArgs Class
Members See Also Send comments on this topic
Dart.Sockets Namespace : UserStateEventArgs Class

Glossary Item Box

Provides data for ComponentBase.UserState. Base class for EventArgs that have Message and UserState properties.

Object Model

UserStateEventArgs Class

Syntax

Visual Basic (Declaration)
Public Class UserStateEventArgs
   Inherits System.EventArgs
Visual Basic (Usage) Copy Code
Dim instance As UserStateEventArgs
C#
public class UserStateEventArgs : System.EventArgs
Managed Extensions for C++
public __gc class UserStateEventArgs : public System.EventArgs
C++/CLI
public ref class UserStateEventArgs : public System.EventArgs

Inheritance Hierarchy

System.Object
System.EventArgs
Dart.Sockets.UserStateEventArgs
Dart.Sockets.DataEventArgs

See Also

Reference

UserStateEventArgs Members
Dart.Sockets Namespace


UserStateEventArgs Class Members

[image]
PowerTCP Sockets for .NET
UserStateEventArgs Class Members
See Also Properties Send comments on this topic
Dart.Sockets Namespace : UserStateEventArgs Class

Glossary Item Box

The following tables list the members exposed by UserStateEventArgs.

Public Properties

 | Name | Description
Public Property | Message | Returns the message argument provided by the Marshal method.
Public Property | UserState | Returns the user state argument provided by the Marshal method.
Top

See Also

Reference

UserStateEventArgs Class
Dart.Sockets Namespace


UserStateEventArgs Class Properties

[image]
PowerTCP Sockets for .NET
UserStateEventArgs Class Properties
See Also Send comments on this topic
Dart.Sockets Namespace : UserStateEventArgs Class

Glossary Item Box

For a list of all members of this type, see UserStateEventArgs members.

Public Properties

 | Name | Description
Public Property | Message | Returns the message argument provided by the Marshal method.
Public Property | UserState | Returns the user state argument provided by the Marshal method.
Top

See Also

Reference

UserStateEventArgs Class
Dart.Sockets Namespace


Message Property

[image]
PowerTCP Sockets for .NET
Message Property
See Also Send comments on this topic
Dart.Sockets Namespace > UserStateEventArgs Class : Message Property

Glossary Item Box

Returns the message argument provided by the Marshal method.

Syntax

Visual Basic (Declaration)
Public ReadOnly Property Message As String
Visual Basic (Usage) Copy Code
Dim instance As UserStateEventArgs
Dim value As String

value = instance.Message
C#
public string Message {get;}
Managed Extensions for C++
public: __property string* get_Message();
C++/CLI
public:
property String^ Message {
   String^ get();
}

See Also

Reference

UserStateEventArgs Class
UserStateEventArgs Members


UserState Property

[image]
PowerTCP Sockets for .NET
UserState Property
See Also Send comments on this topic
Dart.Sockets Namespace > UserStateEventArgs Class : UserState Property

Glossary Item Box

Returns the user state argument provided by the Marshal method.

Syntax

Visual Basic (Declaration)
Public ReadOnly Property UserState As Object
Visual Basic (Usage) Copy Code
Dim instance As UserStateEventArgs
Dim value As Object

value = instance.UserState
C#
public object UserState {get;}
Managed Extensions for C++
public: __property Object* get_UserState();
C++/CLI
public:
property Object^ UserState {
   Object^ get();
}

See Also

Reference

UserStateEventArgs Class
UserStateEventArgs Members


ConnectionState Enumeration

[image]
PowerTCP Sockets for .NET
ConnectionState Enumeration
See Also Send comments on this topic
Dart.Sockets Namespace : ConnectionState Enumeration

Glossary Item Box

Enumerates the possible values of the connection state.

Syntax

Visual Basic (Declaration)
Public Enum ConnectionState
   Inherits System.Enum
Visual Basic (Usage) Copy Code
Dim instance As ConnectionState
C#
public enum ConnectionState : System.Enum
Managed Extensions for C++
__value public enum ConnectionState : public System.Enum
C++/CLI
public enum class ConnectionState : public System.Enum

Members

Member | Description
Closed | The connection is closed.
Connected | The TCP connection is established but not secure.
ConnectedAndSecure | The connection is connected and secure.

Inheritance Hierarchy

System.Object
System.ValueType
System.Enum
Dart.Sockets.ConnectionState

See Also

Reference

Dart.Sockets Namespace


DataDirection Enumeration

[image]
PowerTCP Sockets for .NET
DataDirection Enumeration
See Also Send comments on this topic
Dart.Sockets Namespace : DataDirection Enumeration

Glossary Item Box

Enumerates the direction of data flow.

Syntax

Visual Basic (Declaration)
Public Enum DataDirection
   Inherits System.Enum
Visual Basic (Usage) Copy Code
Dim instance As DataDirection
C#
public enum DataDirection : System.Enum
Managed Extensions for C++
__value public enum DataDirection : public System.Enum
C++/CLI
public enum class DataDirection : public System.Enum

Members

Member | Description
In | Data was received (using the Read method).
Out | Data was sent (using the Write method).

Inheritance Hierarchy

System.Object
System.ValueType
System.Enum
Dart.Sockets.DataDirection

See Also

Reference

Dart.Sockets Namespace


Ping.Status Enumeration

[image]
PowerTCP Sockets for .NET
Ping.Status Enumeration
See Also Send comments on this topic
Dart.Sockets Namespace : Ping.Status Enumeration

Glossary Item Box

Enumerates the status of the ICMP echo request.

Syntax

Visual Basic (Declaration)
Public Enum Ping.Status
   Inherits System.Enum
Visual Basic (Usage) Copy Code
Dim instance As Ping.Status
C#
public enum Ping.Status : System.Enum
Managed Extensions for C++
__value public enum Ping.Status : public System.Enum
C++/CLI
public enum class Ping.Status : public System.Enum

Members

Member | Description
BadDestination | A bad destination.
BadIpOption | A bad IP option was specified.
BadRequest | Bad request.
BadRoute | Bad route.
BufferTooSmall | Reply buffer was too small.
GeneralFailure | A general failure indicating a malformed ICMP packet.
HardwareError | A hardware error occurred.
HostUnreachable | Destination host was unreachable.
NetworkUnreachable | Destination netword was unreachable.
NoResources | Insufficient IP resources were available.
OptionTooBig | An IP option was too big.
PacketTooBig | The packet was too big.
ParameterProblem | A parameter problem.
PortUnreachable | Destination port was unreachable.
Prohibited | Communication with destination administratively prohibited.
ProtocolUnreachable | Destination protocol was unreachable.
RequestTimedOut | Request timed out.
SourceQuench | Datagrams are arriving too fast to be processed and datagrams may have been dropped.
Success | Request succeeded.
TtlExpiredReassembly | The time to live (ttl) expired during fragment reassembly.
TtlExpiredTransit | The time to live (ttl) expired in transit. Used for TraceRoute.

Inheritance Hierarchy

System.Object
System.ValueType
System.Enum
Dart.Sockets.Ping.Status

See Also

Reference

Dart.Sockets Namespace


Ping.Type Enumeration

[image]
PowerTCP Sockets for .NET
Ping.Type Enumeration
See Also Send comments on this topic
Dart.Sockets Namespace : Ping.Type Enumeration

Glossary Item Box

Controls the software technology used to create the Ping.

Syntax

Visual Basic (Declaration)
Public Enum Ping.Type
   Inherits System.Enum
Visual Basic (Usage) Copy Code
Dim instance As Ping.Type
C#
public enum Ping.Type : System.Enum
Managed Extensions for C++
__value public enum Ping.Type : public System.Enum
C++/CLI
public enum class Ping.Type : public System.Enum

Members

Member | Description
Raw | A raw socket will be created to send and receive the ping. Administrator privileges may be required. Supports broadcasting.
System | The system icmp.dll will be used to generate and receive the Ping.

Remarks

Ping broadcasting is only supported under Raw. When using System, only the first responding system is returned.

Inheritance Hierarchy

System.Object
System.ValueType
System.Enum
Dart.Sockets.Ping.Type

See Also

Reference

Dart.Sockets Namespace


ProxyType Enumeration

[image]
PowerTCP Sockets for .NET
ProxyType Enumeration
See Also Send comments on this topic
Dart.Sockets Namespace : ProxyType Enumeration

Glossary Item Box

Enumerates the provided proxy support that can be used.

Syntax

Visual Basic (Declaration)
Public Enum ProxyType
   Inherits System.Enum
Visual Basic (Usage) Copy Code
Dim instance As ProxyType
C#
public enum ProxyType : System.Enum
Managed Extensions for C++
__value public enum ProxyType : public System.Enum
C++/CLI
public enum class ProxyType : public System.Enum

Members

Member | Description
Http | An HTTP server proxy is to be used.
None | No server proxy is to be used.
Socks4 | A SOCKS4 server proxy is to be used.
Socks5 | A SOCKS5 server proxy is to be used.

Inheritance Hierarchy

System.Object
System.ValueType
System.Enum
Dart.Sockets.ProxyType

See Also

Reference

Dart.Sockets Namespace


ConnectThreadStart Delegate

[image]
PowerTCP Sockets for .NET
ConnectThreadStart Delegate
See Also Send comments on this topic
Dart.Sockets Namespace : ConnectThreadStart Delegate

tcp
The Tcp object used to manage the accepted connection.
state
Any additional information provided by the user.

Glossary Item Box

Represents the method that will execute on a worker thread after each TCP connection is accepted.

Syntax

Visual Basic (Declaration)
Public Delegate Sub ConnectThreadStart( _
   ByVal tcp As Tcp, _
   ByVal state As Object _
)
Visual Basic (Usage) Copy Code
Dim instance As New ConnectThreadStart(AddressOf HandlerMethod)
C#
public delegate void ConnectThreadStart(
   Tcp tcp,
   object state
)
Managed Extensions for C++
public: __gc __delegate void ConnectThreadStart(
   Tcp* tcp,
   Object* state
)
C++/CLI
public delegate void ConnectThreadStart(
   Tcp^ tcp,
   Object^ state
)

Parameters

tcp
The Tcp object used to manage the accepted connection.
state
Any additional information provided by the user.

See Also

Reference

ConnectThreadStart Members
Dart.Sockets Namespace


DnsThreadStart Delegate

[image]
PowerTCP Sockets for .NET
DnsThreadStart Delegate
See Also Send comments on this topic
Dart.Sockets Namespace : DnsThreadStart Delegate

slave
The DnsSlave object that is independent of all other worker threads.
state
Any additional information provided by the user.

Glossary Item Box

Represents the method that will execute on a worker thread when Start is used.

Syntax

Visual Basic (Declaration)
Public Delegate Sub DnsThreadStart( _
   ByVal slave As DnsSlave, _
   ByVal state As Object _
)
Visual Basic (Usage) Copy Code
Dim instance As New DnsThreadStart(AddressOf HandlerMethod)
C#
public delegate void DnsThreadStart(
   DnsSlave slave,
   object state
)
Managed Extensions for C++
public: __gc __delegate void DnsThreadStart(
   DnsSlave* slave,
   Object* state
)
C++/CLI
public delegate void DnsThreadStart(
   DnsSlave^ slave,
   Object^ state
)

Parameters

slave
The DnsSlave object that is independent of all other worker threads.
state
Any additional information provided by the user.

See Also

Reference

DnsThreadStart Members
Dart.Sockets Namespace


PingThreadStart Delegate

[image]
PowerTCP Sockets for .NET
PingThreadStart Delegate
See Also Send comments on this topic
Dart.Sockets Namespace : PingThreadStart Delegate

slave
The PingSlave object that is independent of all other worker threads.
state
Any additional information provided by the user.

Glossary Item Box

Represents the method that will execute on a worker thread when Start is used.

Syntax

Visual Basic (Declaration)
Public Delegate Sub PingThreadStart( _
   ByVal slave As PingSlave, _
   ByVal state As Object _
)
Visual Basic (Usage) Copy Code
Dim instance As New PingThreadStart(AddressOf HandlerMethod)
C#
public delegate void PingThreadStart(
   PingSlave slave,
   object state
)
Managed Extensions for C++
public: __gc __delegate void PingThreadStart(
   PingSlave* slave,
   Object* state
)
C++/CLI
public delegate void PingThreadStart(
   PingSlave^ slave,
   Object^ state
)

Parameters

slave
The PingSlave object that is independent of all other worker threads.
state
Any additional information provided by the user.

See Also

Reference

PingThreadStart Members
Dart.Sockets Namespace


TcpAsyncCallback Delegate

[image]
PowerTCP Sockets for .NET
TcpAsyncCallback Delegate
See Also Send comments on this topic
Dart.Sockets Namespace : TcpAsyncCallback Delegate

tcp
The TcpBase object that initiated the asynchronous operation.
data
The Data object containing received/sent data. Null for connect operations or if the socket is closed.
exception
Populated if the operation threw an exception, otherwise null.
state
State object passed into the asynchronous call.

Glossary Item Box

References the method to invoke on an IO completion thread when the corresponding asynchronous operation completes.

Syntax

Visual Basic (Declaration)
Public Delegate Sub TcpAsyncCallback( _
   ByVal tcp As TcpBase, _
   ByVal data As Data, _
   ByVal exception As Exception, _
   ByVal state As Object _
)
Visual Basic (Usage) Copy Code
Dim instance As New TcpAsyncCallback(AddressOf HandlerMethod)
C#
public delegate void TcpAsyncCallback(
   TcpBase tcp,
   Data data,
   Exception exception,
   object state
)
Managed Extensions for C++
public: __gc __delegate void TcpAsyncCallback(
   TcpBase* tcp,
   Data* data,
   Exception* exception,
   Object* state
)
C++/CLI
public delegate void TcpAsyncCallback(
   TcpBase^ tcp,
   Data^ data,
   Exception^ exception,
   Object^ state
)

Parameters

tcp
The TcpBase object that initiated the asynchronous operation.
data
The Data object containing received/sent data. Null for connect operations or if the socket is closed.
exception
Populated if the operation threw an exception, otherwise null.
state
State object passed into the asynchronous call.

See Also

Reference

TcpAsyncCallback Members
Dart.Sockets Namespace


UdpAsyncCallback Delegate

[image]
PowerTCP Sockets for .NET
UdpAsyncCallback Delegate
See Also Send comments on this topic
Dart.Sockets Namespace : UdpAsyncCallback Delegate

udp
The UdpBase object that initiated the asynchronous operation.
datagram
The Datagram object containing received/sent data. Null if the socket is closed.
exception
Populated if the operation threw an exception, otherwise null.
state
State object passed into the asynchronous call.

Glossary Item Box

References the method to invoke on an IO completion thread when the corresponding asynchronous operation completes.

Syntax

Visual Basic (Declaration)
Public Delegate Sub UdpAsyncCallback( _
   ByVal udp As UdpBase, _
   ByVal datagram As Datagram, _
   ByVal exception As Exception, _
   ByVal state As Object _
)
Visual Basic (Usage) Copy Code
Dim instance As New UdpAsyncCallback(AddressOf HandlerMethod)
C#
public delegate void UdpAsyncCallback(
   UdpBase udp,
   Datagram datagram,
   Exception exception,
   object state
)
Managed Extensions for C++
public: __gc __delegate void UdpAsyncCallback(
   UdpBase* udp,
   Datagram* datagram,
   Exception* exception,
   Object* state
)
C++/CLI
public delegate void UdpAsyncCallback(
   UdpBase^ udp,
   Datagram^ datagram,
   Exception^ exception,
   Object^ state
)

Parameters

udp
The UdpBase object that initiated the asynchronous operation.
datagram
The Datagram object containing received/sent data. Null if the socket is closed.
exception
Populated if the operation threw an exception, otherwise null.
state
State object passed into the asynchronous call.

See Also

Reference

UdpAsyncCallback Members
Dart.Sockets Namespace


Dart.Sockets Namespace (Dart.Sockets.45)

Dart.Sockets Namespace (Dart.Sockets.45)
See Also Inheritance Hierarchy Send comments on this topic

Glossary Item Box

Classes

 | Class | Description
Class | ClientSecurity | Holds the configuration used to establish an SSL client session.
Class | ComponentBase | Base class for PowerTCP Components.
Class | ConnectionsChangedEventArgs | Provides data for the ConnectionsChanged event.
Class | DartLicenseException | The base class for all Dart component license exceptions.
Class | Data | Encapsulates data read or written.
Class | DataEventArgs | Provides data for reporting events.
Class | DataException | Thrown when the expected data could not be read.
Class | Datagram | Encapsulates a datagram read into a buffer.
Class | Dns | Supplements System.Net.Dns with the ability to retrieve MX records for any email address or mail server. Supports socket binding to a specified local IPEndPoint.
Class | DnsSlave | Used to perform DNS resolutions.
Class | Echo | Encapsulates an echo response from a server.
Class | EchoEventArgs | Provides data for the Echo event.
Class | ErrorEventArgs | Provides data for the Error event.
Class | IPEndPoint | Allows user to specify a range of IPEndPoints for local binding. Also resolves hostnames and saves them for future use.
Class | MxHostEntry | Provides the HostName and Preference provided by an MX record lookup.
Class | Ping | Provides classes and methods for Pinging (sending ICMP Echo requests).
Class | PingSlave | Used on each worker thread to provide a series of ICMP Echo (Ping) requests.
Class | ProtocolException | Thrown when an upper-layer protocol like FTP, SMTP or POP3 receives a negative response from the server.
Class | Proxy | Describes the server proxy, if any, to connect to.
Class | PtyBase | This class provides support for interactive on-line terminal access using controls derived from TextBoxBase.
Class | Security | Holds the configuration used to establish an SSL session.
Class | Segment | Used to describe a byte[] segment that holds data.
Class | Server | The Server component provides a framework for building non-secure and secure server applications.
Class | ServerSecurity | Holds the configuration used to establish an SSL server session.
Class | Session | Holds the configuration common to UDP and TCP.
Class | SocketBase | Base class for PowerTCP Components.
Class | SocketOption | Contains socket options that may be set by TCP and UDP sockets. These options are automatically applied to the connection used.
Class | Tcp | The Tcp component simplifies the use of secure Tcp communications within any .NET application.
Class | TcpBase | Base class for components utilizing protocols built upon the TCP protocol.
Class | TcpSession | Holds the configuration used by TCP.
Class | TcpSocketOption | Contains socket options that may be set by TCP sockets.
Class | Udp | The Udp component provides comprehensive User Datagram Protocol support.
Class | UdpBase | Base class for upper-layer protocols based on UDP.
Class | UdpSocketOption | Contains socket options that may be set by UDP sockets.
Class | UserStateEventArgs | Provides data for UserState. Base class for EventArgs that have Message and UserState properties.

Delegates

 | Delegate | Description
Delegate | ConnectThreadStart | Represents the method that will execute on a worker thread after each TCP connection is accepted.
Delegate | DnsThreadStart | Represents the method that will execute on a worker thread when Start is used.
Delegate | PingThreadStart | Represents the method that will execute on a worker thread when Start is used.
Delegate | TcpAsyncCallback | References the method to invoke on an IO completion thread when the corresponding asynchronous operation completes.
Delegate | UdpAsyncCallback | References the method to invoke on an IO completion thread when the corresponding asynchronous operation completes.

Enumerations

 | Enumeration | Description
Enumeration | ConnectionState | Enumerates the possible values of the connection state.
Enumeration | DataDirection | Enumerates the direction of data flow.
Enumeration | Ping.Status | Enumerates the status of the ICMP echo request.
Enumeration | Ping.Type | Controls the software technology used to create the Ping.
Enumeration | ProxyType | Enumerates the provided proxy support that can be used.

See Also

Reference

Dart.Sockets.45 Assembly


PtyBase Class Members

[image]
PowerTCP Sockets for .NET
PtyBase Class Members
See Also Properties Methods Events Send comments on this topic
Dart.Sockets Namespace : PtyBase Class

Glossary Item Box

The following tables list the members exposed by PtyBase.

Public Properties

 | Name | Description
Public Property | CloseTime | Returns the DateTime the connection was closed. (Inherited from Dart.Sockets.TcpBase)
Public Property | ConnectTime | Returns the DateTime the connection was established. (Inherited from Dart.Sockets.TcpBase)
Public Property | Container | (Inherited from System.ComponentModel.Component)
Public Property | CRLF | Set to true if the Pty property is used and a CR should be converted to a CRLF for sending.
Public Property | Encoding | Character encoding used by the component. (Inherited from Dart.Sockets.ComponentBase)
Public Property | LocalEcho | Set to true if the Pty property is used and keystrokes should be displayed in the textbox.
Public Property | NetworkStream | Returns the NetworkStream object created when Connect() is called. (Inherited from Dart.Sockets.TcpBase)
Public Property | Pty | Gets or sets a display control to use for automatic pseudo terminal support.
Public Property | RemoteEndPoint | Gets the remote address and port of the connection. (Inherited from Dart.Sockets.TcpBase)
Public Property | Site | (Inherited from System.ComponentModel.Component)
Public Property | Socket | Gets the socket used by the component for communications. (Inherited from Dart.Sockets.SocketBase)
Public Property | SocketOption | Gets and sets the socket options for classes derived from TcpBase. (Inherited from Dart.Sockets.TcpBase)
Public Property | SslStream | Returns the SslStream object created when AuthenticateAsClient or AuthenticateAsServer are called. (Inherited from Dart.Sockets.TcpBase)
Public Property | State | Gets the status of the connection as of the last socket operation. (Inherited from Dart.Sockets.TcpBase)
Public Property | SynchronizingObject | Gets or sets the object used to marshal data to the UI thread (for raising events). (Inherited from Dart.Sockets.ComponentBase)
Public Property | SyncRoot | Gets an object that is used to synchronize access to the upper layer protocol in use. (Inherited from Dart.Sockets.ComponentBase)
Public Property | Tag | Gets or sets an object that stores any user data. (Inherited from Dart.Sockets.ComponentBase)
Top

Protected Properties

 | Name | Description
Protected Property | CanRaiseEvents | (Inherited from System.ComponentModel.Component)
Protected Property | DesignMode | (Inherited from System.ComponentModel.Component)
Protected Property | Events | (Inherited from System.ComponentModel.Component)
Top

Public Methods

 | Name | Description
Public Method | Abort | Performs a hard close of the connection. (Inherited from Dart.Sockets.TcpBase)
Public Method | AuthenticateAsClient | Overloaded. Authenticates the server when establishing a secure connection. (Inherited from Dart.Sockets.TcpBase)
Public Method | AuthenticateAsClientTaskAsync | Overloaded. Authenticates the server when establishing a secure connection. (Inherited from Dart.Sockets.TcpBase)
Public Method | AuthenticateAsServer | Authenticates a client when establishing a secure connection. (Inherited from Dart.Sockets.TcpBase)
Public Method | AuthenticateAsServerTaskAsync | Authenticates a client when establishing a secure connection. (Inherited from Dart.Sockets.TcpBase)
Public Method | Close | Gracefully closes the connection. (Inherited from Dart.Sockets.TcpBase)
Public Method | Connect | Connect to a server using the configuration specified by session. (Inherited from Dart.Sockets.TcpBase)
Public Method | ConnectAsync | Connect to a server using the configuration specified by session. (Inherited from Dart.Sockets.TcpBase)
Public Method | ConnectTaskAsync | Connect to a server using the configuration specified by session. (Inherited from Dart.Sockets.TcpBase)
Public Method | CreateObjRef | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from System.MarshalByRefObject)
Public Method | Deserialize | Deserialize a previously serialized object. (Inherited from Dart.Sockets.ComponentBase)
Public Method | Dispose | Overloaded. Disposes of TcpBase and its associated resources. (Inherited from Dart.Sockets.TcpBase)
Public Method | GetLifetimeService | Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | GetStream | Provides access to the underlying Stream. (Inherited from Dart.Sockets.TcpBase)
Public Method | InitializeLifetimeService | Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | Marshal | Overloaded. Marshals data to the UI thread. (Inherited from Dart.Sockets.TcpBase)
Public Method | Read | Overloaded. Receives data from the remote host. (Inherited from Dart.Sockets.TcpBase)
Public Method | ReadAsync | Start an asynchronous read on the socket. (Inherited from Dart.Sockets.TcpBase)
Public Method | ReadTaskAsync | Start an awaitable asynchronous read on the socket. (Inherited from Dart.Sockets.TcpBase)
Public Method | ReadToCount | Read until count bytes are read, an exception is thrown, or the connection is closed. (Inherited from Dart.Sockets.TcpBase)
Public Method | ReadToDelimiter | Overloaded. Read until the delimiter is found, an exception is thrown, or the connection is closed. (Inherited from Dart.Sockets.TcpBase)
Public Method | ReadToEnd | Read until the connection is closed or an exception is thrown. (Inherited from Dart.Sockets.TcpBase)
Public Method | Serialize | Serialize an object to the provided destination stream. (Inherited from Dart.Sockets.ComponentBase)
Public Method | ShutdownSsl | Signals the remote host to shutdown the SSL connection. (Inherited from Dart.Sockets.TcpBase)
Public Method | ToString | (Inherited from System.ComponentModel.Component)
Public Method | Write | Overloaded. Sends data to the remote host. (Inherited from Dart.Sockets.TcpBase)
Public Method | WriteAsync | Start an asynchronous write on the socket. (Inherited from Dart.Sockets.TcpBase)
Public Method | WriteTaskAsync | Start an awaitable asynchronous write on the socket. (Inherited from Dart.Sockets.TcpBase)
Top

Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from System.ComponentModel.Component)
Protected Method | GetService | (Inherited from System.ComponentModel.Component)
Protected Method | MemberwiseClone | Overloaded. Creates a shallow copy of the current System.MarshalByRefObject object. (Inherited from System.MarshalByRefObject)
Protected Method | OnData | Raises the Data event. (Inherited from Dart.Sockets.TcpBase)
Protected Method | OnError | Raises the Error event. (Inherited from Dart.Sockets.ComponentBase)
Protected Method | OnLog | Raises the Log event. (Inherited from Dart.Sockets.TcpBase)
Protected Method | OnStateChanged | Raises the StateChanged event. (Inherited from Dart.Sockets.TcpBase)
Protected Method | OnUserState | Raises the UserState event. (Inherited from Dart.Sockets.ComponentBase)
Top

Public Events

 | Name | Description
Public Event | Data | Raised when Marshal(Data,String,Object) is used. (Inherited from Dart.Sockets.TcpBase)
Public Event | Disposed | (Inherited from System.ComponentModel.Component)
Public Event | Error | Raised when Marshal(Exception) is used or an unhandled Exception is thrown in a worker thread created using Start. (Inherited from Dart.Sockets.ComponentBase)
Public Event | Log | Raised when data is read or written. (Inherited from Dart.Sockets.TcpBase)
Public Event | StateChanged | Raised when the value of the State property changes. (Inherited from Dart.Sockets.TcpBase)
Public Event | UserState | Raised when Marshal(String,Object) is used. (Inherited from Dart.Sockets.ComponentBase)
Top

See Also

Reference

PtyBase Class
Dart.Sockets Namespace


Tcp Class Members

[image]
PowerTCP Sockets for .NET
Tcp Class Members
See Also Properties Methods Events Send comments on this topic
Dart.Sockets Namespace : Tcp Class

Glossary Item Box

The following tables list the members exposed by Tcp.

Public Constructors

 | Name | Description
Public Constructor | Tcp Constructor | Overloaded.
Top

Public Properties

 | Name | Description
Public Property | CloseTime | Returns the DateTime the connection was closed. (Inherited from Dart.Sockets.TcpBase)
Public Property | ConnectTime | Returns the DateTime the connection was established. (Inherited from Dart.Sockets.TcpBase)
Public Property | Container | (Inherited from System.ComponentModel.Component)
Public Property | CRLF | Set to true if the Pty property is used and a CR should be converted to a CRLF for sending. (Inherited from Dart.Sockets.PtyBase)
Public Property | Encoding | Character encoding used by the component. (Inherited from Dart.Sockets.ComponentBase)
Public Property | LocalEcho | Set to true if the Pty property is used and keystrokes should be displayed in the textbox. (Inherited from Dart.Sockets.PtyBase)
Public Property | NetworkStream | Returns the NetworkStream object created when Connect() is called. (Inherited from Dart.Sockets.TcpBase)
Public Property | Pty | Gets or sets a display control to use for automatic pseudo terminal support. (Inherited from Dart.Sockets.PtyBase)
Public Property | RemoteEndPoint | Gets the remote address and port of the connection. (Inherited from Dart.Sockets.TcpBase)
Public Property | Site | (Inherited from System.ComponentModel.Component)
Public Property | Socket | Gets the socket used by the component for communications. (Inherited from Dart.Sockets.SocketBase)
Public Property | SocketOption | Gets and sets the socket options for classes derived from TcpBase. (Inherited from Dart.Sockets.TcpBase)
Public Property | SslStream | Returns the SslStream object created when AuthenticateAsClient or AuthenticateAsServer are called. (Inherited from Dart.Sockets.TcpBase)
Public Property | State | Gets the status of the connection as of the last socket operation. (Inherited from Dart.Sockets.TcpBase)
Public Property | SynchronizingObject | Gets or sets the object used to marshal data to the UI thread (for raising events). (Inherited from Dart.Sockets.ComponentBase)
Public Property | SyncRoot | Gets an object that is used to synchronize access to the upper layer protocol in use. (Inherited from Dart.Sockets.ComponentBase)
Public Property | Tag | Gets or sets an object that stores any user data. (Inherited from Dart.Sockets.ComponentBase)
Top

Protected Properties

 | Name | Description
Protected Property | CanRaiseEvents | (Inherited from System.ComponentModel.Component)
Protected Property | DesignMode | (Inherited from System.ComponentModel.Component)
Protected Property | Events | (Inherited from System.ComponentModel.Component)
Top

Public Methods

 | Name | Description
Public Method | Abort | Performs a hard close of the connection. (Inherited from Dart.Sockets.TcpBase)
Public Method | AuthenticateAsClient | Overloaded. Authenticates the server when establishing a secure connection. (Inherited from Dart.Sockets.TcpBase)
Public Method | AuthenticateAsClientTaskAsync | Overloaded. Authenticates the server when establishing a secure connection. (Inherited from Dart.Sockets.TcpBase)
Public Method | AuthenticateAsServer | Authenticates a client when establishing a secure connection. (Inherited from Dart.Sockets.TcpBase)
Public Method | AuthenticateAsServerTaskAsync | Authenticates a client when establishing a secure connection. (Inherited from Dart.Sockets.TcpBase)
Public Method | Close | Gracefully closes the connection. (Inherited from Dart.Sockets.TcpBase)
Public Method | Connect | Connect to a server using the configuration specified by session. (Inherited from Dart.Sockets.TcpBase)
Public Method | ConnectAsync | Connect to a server using the configuration specified by session. (Inherited from Dart.Sockets.TcpBase)
Public Method | ConnectTaskAsync | Connect to a server using the configuration specified by session. (Inherited from Dart.Sockets.TcpBase)
Public Method | CreateObjRef | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from System.MarshalByRefObject)
Public Method | Deserialize | Deserialize a previously serialized object. (Inherited from Dart.Sockets.ComponentBase)
Public Method | Dispose | Overloaded. Disposes of TcpBase and its associated resources. (Inherited from Dart.Sockets.TcpBase)
Public Method | GetLifetimeService | Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | GetStream | Provides access to the underlying Stream. (Inherited from Dart.Sockets.TcpBase)
Public Method | InitializeLifetimeService | Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | Marshal | Overloaded. Marshals data to the UI thread. (Inherited from Dart.Sockets.TcpBase)
Public Method | Read | Overloaded. Receives data from the remote host. (Inherited from Dart.Sockets.TcpBase)
Public Method | ReadAsync | Start an asynchronous read on the socket. (Inherited from Dart.Sockets.TcpBase)
Public Method | ReadTaskAsync | Start an awaitable asynchronous read on the socket. (Inherited from Dart.Sockets.TcpBase)
Public Method | ReadToCount | Read until count bytes are read, an exception is thrown, or the connection is closed. (Inherited from Dart.Sockets.TcpBase)
Public Method | ReadToDelimiter | Overloaded. Read until the delimiter is found, an exception is thrown, or the connection is closed. (Inherited from Dart.Sockets.TcpBase)
Public Method | ReadToEnd | Read until the connection is closed or an exception is thrown. (Inherited from Dart.Sockets.TcpBase)
Public Method | Serialize | Serialize an object to the provided destination stream. (Inherited from Dart.Sockets.ComponentBase)
Public Method | ShutdownSsl | Signals the remote host to shutdown the SSL connection. (Inherited from Dart.Sockets.TcpBase)
Public Method | ToString | (Inherited from System.ComponentModel.Component)
Public Method | Write | Overloaded. Sends data to the remote host. (Inherited from Dart.Sockets.TcpBase)
Public Method | WriteAsync | Start an asynchronous write on the socket. (Inherited from Dart.Sockets.TcpBase)
Public Method | WriteTaskAsync | Start an awaitable asynchronous write on the socket. (Inherited from Dart.Sockets.TcpBase)
Top

Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from System.ComponentModel.Component)
Protected Method | GetService | (Inherited from System.ComponentModel.Component)
Protected Method | MemberwiseClone | Overloaded. Creates a shallow copy of the current System.MarshalByRefObject object. (Inherited from System.MarshalByRefObject)
Protected Method | OnData | Raises the Data event. (Inherited from Dart.Sockets.TcpBase)
Protected Method | OnError | Raises the Error event. (Inherited from Dart.Sockets.ComponentBase)
Protected Method | OnLog | Raises the Log event. (Inherited from Dart.Sockets.TcpBase)
Protected Method | OnStateChanged | Raises the StateChanged event. (Inherited from Dart.Sockets.TcpBase)
Protected Method | OnUserState | Raises the UserState event. (Inherited from Dart.Sockets.ComponentBase)
Top

Public Events

 | Name | Description
Public Event | Data | Raised when Marshal(Data,String,Object) is used. (Inherited from Dart.Sockets.TcpBase)
Public Event | Disposed | (Inherited from System.ComponentModel.Component)
Public Event | Error | Raised when Marshal(Exception) is used or an unhandled Exception is thrown in a worker thread created using Start. (Inherited from Dart.Sockets.ComponentBase)
Public Event | Log | Raised when data is read or written. (Inherited from Dart.Sockets.TcpBase)
Public Event | StateChanged | Raised when the value of the State property changes. (Inherited from Dart.Sockets.TcpBase)
Public Event | UserState | Raised when Marshal(String,Object) is used. (Inherited from Dart.Sockets.ComponentBase)
Top

See Also

Reference

Tcp Class
Dart.Sockets Namespace


TcpBase Class Members

[image]
PowerTCP Sockets for .NET
TcpBase Class Members
See Also Properties Methods Events Send comments on this topic
Dart.Sockets Namespace : TcpBase Class

Glossary Item Box

The following tables list the members exposed by TcpBase.

Public Properties

 | Name | Description
Public Property | CloseTime | Returns the DateTime the connection was closed.
Public Property | ConnectTime | Returns the DateTime the connection was established.
Public Property | Container | (Inherited from System.ComponentModel.Component)
Public Property | Encoding | Character encoding used by the component. (Inherited from Dart.Sockets.ComponentBase)
Public Property | NetworkStream | Returns the NetworkStream object created when Connect() is called.
Public Property | RemoteEndPoint | Gets the remote address and port of the connection.
Public Property | Site | (Inherited from System.ComponentModel.Component)
Public Property | Socket | Gets the socket used by the component for communications. (Inherited from Dart.Sockets.SocketBase)
Public Property | SocketOption | Gets and sets the socket options for classes derived from TcpBase.
Public Property | SslStream | Returns the SslStream object created when AuthenticateAsClient or AuthenticateAsServer are called.
Public Property | State | Gets the status of the connection as of the last socket operation.
Public Property | SynchronizingObject | Gets or sets the object used to marshal data to the UI thread (for raising events). (Inherited from Dart.Sockets.ComponentBase)
Public Property | SyncRoot | Gets an object that is used to synchronize access to the upper layer protocol in use. (Inherited from Dart.Sockets.ComponentBase)
Public Property | Tag | Gets or sets an object that stores any user data. (Inherited from Dart.Sockets.ComponentBase)
Top

Protected Properties

 | Name | Description
Protected Property | CanRaiseEvents | (Inherited from System.ComponentModel.Component)
Protected Property | DesignMode | (Inherited from System.ComponentModel.Component)
Protected Property | Events | (Inherited from System.ComponentModel.Component)
Top

Public Methods

 | Name | Description
Public Method | Abort | Performs a hard close of the connection.
Public Method | AuthenticateAsClient | Overloaded. Authenticates the server when establishing a secure connection.
Public Method | AuthenticateAsClientTaskAsync | Overloaded. Authenticates the server when establishing a secure connection.
Public Method | AuthenticateAsServer | Authenticates a client when establishing a secure connection.
Public Method | AuthenticateAsServerTaskAsync | Authenticates a client when establishing a secure connection.
Public Method | Close | Gracefully closes the connection.
Public Method | Connect | Connect to a server using the configuration specified by session.
Public Method | ConnectAsync | Connect to a server using the configuration specified by session.
Public Method | ConnectTaskAsync | Connect to a server using the configuration specified by session.
Public Method | CreateObjRef | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from System.MarshalByRefObject)
Public Method | Deserialize | Deserialize a previously serialized object. (Inherited from Dart.Sockets.ComponentBase)
Public Method | Dispose | Overloaded. Overridden. Disposes of TcpBase and its associated resources.
Public Method | GetLifetimeService | Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | GetStream | Provides access to the underlying Stream.
Public Method | InitializeLifetimeService | Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | Marshal | Overloaded. Marshals data to the UI thread.
Public Method | Read | Overloaded. Receives data from the remote host.
Public Method | ReadAsync | Start an asynchronous read on the socket.
Public Method | ReadTaskAsync | Start an awaitable asynchronous read on the socket.
Public Method | ReadToCount | Read until count bytes are read, an exception is thrown, or the connection is closed.
Public Method | ReadToDelimiter | Overloaded. Read until the delimiter is found, an exception is thrown, or the connection is closed.
Public Method | ReadToEnd | Read until the connection is closed or an exception is thrown.
Public Method | Serialize | Serialize an object to the provided destination stream. (Inherited from Dart.Sockets.ComponentBase)
Public Method | ShutdownSsl | Signals the remote host to shutdown the SSL connection.
Public Method | ToString | (Inherited from System.ComponentModel.Component)
Public Method | Write | Overloaded. Sends data to the remote host.
Public Method | WriteAsync | Start an asynchronous write on the socket.
Public Method | WriteTaskAsync | Start an awaitable asynchronous write on the socket.
Top

Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from System.ComponentModel.Component)
Protected Method | GetService | (Inherited from System.ComponentModel.Component)
Protected Method | MemberwiseClone | Overloaded. Creates a shallow copy of the current System.MarshalByRefObject object. (Inherited from System.MarshalByRefObject)
Protected Method | OnData | Raises the Data event.
Protected Method | OnError | Raises the Error event. (Inherited from Dart.Sockets.ComponentBase)
Protected Method | OnLog | Raises the Log event.
Protected Method | OnStateChanged | Raises the StateChanged event.
Protected Method | OnUserState | Raises the UserState event. (Inherited from Dart.Sockets.ComponentBase)
Top

Public Events

 | Name | Description
Public Event | Data | Raised when Marshal(Data,String,Object) is used.
Public Event | Disposed | (Inherited from System.ComponentModel.Component)
Public Event | Error | Raised when Marshal(Exception) is used or an unhandled Exception is thrown in a worker thread created using Start. (Inherited from Dart.Sockets.ComponentBase)
Public Event | Log | Raised when data is read or written.
Public Event | StateChanged | Raised when the value of the State property changes.
Public Event | UserState | Raised when Marshal(String,Object) is used. (Inherited from Dart.Sockets.ComponentBase)
Top

See Also

Reference

TcpBase Class
Dart.Sockets Namespace


TcpBase Class Methods

[image]
PowerTCP Sockets for .NET
TcpBase Class Methods
See Also Send comments on this topic
Dart.Sockets Namespace : TcpBase Class

Glossary Item Box

For a list of all members of this type, see TcpBase members.

Public Methods

 | Name | Description
Public Method | Abort | Performs a hard close of the connection.
Public Method | AuthenticateAsClient | Overloaded. Authenticates the server when establishing a secure connection.
Public Method | AuthenticateAsClientTaskAsync | Overloaded. Authenticates the server when establishing a secure connection.
Public Method | AuthenticateAsServer | Authenticates a client when establishing a secure connection.
Public Method | AuthenticateAsServerTaskAsync | Authenticates a client when establishing a secure connection.
Public Method | Close | Gracefully closes the connection.
Public Method | Connect | Connect to a server using the configuration specified by session.
Public Method | ConnectAsync | Connect to a server using the configuration specified by session.
Public Method | ConnectTaskAsync | Connect to a server using the configuration specified by session.
Public Method | CreateObjRef | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from System.MarshalByRefObject)
Public Method | Deserialize | Deserialize a previously serialized object. (Inherited from Dart.Sockets.ComponentBase)
Public Method | Dispose | Overloaded. Overridden. Disposes of TcpBase and its associated resources.
Public Method | GetLifetimeService | Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | GetStream | Provides access to the underlying Stream.
Public Method | InitializeLifetimeService | Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | Marshal | Overloaded. Marshals data to the UI thread.
Public Method | Read | Overloaded. Receives data from the remote host.
Public Method | ReadAsync | Start an asynchronous read on the socket.
Public Method | ReadTaskAsync | Start an awaitable asynchronous read on the socket.
Public Method | ReadToCount | Read until count bytes are read, an exception is thrown, or the connection is closed.
Public Method | ReadToDelimiter | Overloaded. Read until the delimiter is found, an exception is thrown, or the connection is closed.
Public Method | ReadToEnd | Read until the connection is closed or an exception is thrown.
Public Method | Serialize | Serialize an object to the provided destination stream. (Inherited from Dart.Sockets.ComponentBase)
Public Method | ShutdownSsl | Signals the remote host to shutdown the SSL connection.
Public Method | ToString | (Inherited from System.ComponentModel.Component)
Public Method | Write | Overloaded. Sends data to the remote host.
Public Method | WriteAsync | Start an asynchronous write on the socket.
Public Method | WriteTaskAsync | Start an awaitable asynchronous write on the socket.
Top

Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from System.ComponentModel.Component)
Protected Method | GetService | (Inherited from System.ComponentModel.Component)
Protected Method | MemberwiseClone | Overloaded. Creates a shallow copy of the current System.MarshalByRefObject object. (Inherited from System.MarshalByRefObject)
Protected Method | OnData | Raises the Data event.
Protected Method | OnError | Raises the Error event. (Inherited from Dart.Sockets.ComponentBase)
Protected Method | OnLog | Raises the Log event.
Protected Method | OnStateChanged | Raises the StateChanged event.
Protected Method | OnUserState | Raises the UserState event. (Inherited from Dart.Sockets.ComponentBase)
Top

See Also

Reference

TcpBase Class
Dart.Sockets Namespace


AuthenticateAsClientTaskAsync Method

[image]
PowerTCP Sockets for .NET
AuthenticateAsClientTaskAsync Method
See Also Send comments on this topic
Dart.Sockets Namespace > TcpBase Class : AuthenticateAsClientTaskAsync Method

Glossary Item Box

Authenticates the server when establishing a secure connection.

Overload List

Overload | Description
AuthenticateAsClientTaskAsync(ClientSecurity) | Authenticates the server when establishing a secure connection.
AuthenticateAsClientTaskAsync(TcpSession) | Authenticates the server when establishing a secure connection.

See Also

Reference

TcpBase Class
TcpBase Members


AuthenticateAsClientTaskAsync(ClientSecurity) Method

[image]
PowerTCP Sockets for .NET
AuthenticateAsClientTaskAsync(ClientSecurity) Method
See Also Send comments on this topic
Dart.Sockets Namespace > TcpBase Class > AuthenticateAsClientTaskAsync Method : AuthenticateAsClientTaskAsync(ClientSecurity) Method

security
Security parameters used during authentication.

Glossary Item Box

Authenticates the server when establishing a secure connection.

Syntax

Visual Basic (Declaration)
<SecuritySafeCriticalAttribute()>
<ObsoleteAttribute("Use AuthenticateAsClientTaskAsync(TcpSession) instead.")>
Public Overloads Function AuthenticateAsClientTaskAsync( _
   ByVal security As ClientSecurity _
) As Task
Visual Basic (Usage) Copy Code
Dim instance As TcpBase
Dim security As ClientSecurity
Dim value As Task

value = instance.AuthenticateAsClientTaskAsync(security)
C#
[SecuritySafeCritical()]
[Obsolete("Use AuthenticateAsClientTaskAsync(TcpSession) instead.")]
public Task AuthenticateAsClientTaskAsync(
   ClientSecurity security
)
Managed Extensions for C++
[SecuritySafeCritical()]
[Obsolete("Use AuthenticateAsClientTaskAsync(TcpSession) instead.")]
public: Task* AuthenticateAsClientTaskAsync(
   ClientSecurity* security
)
C++/CLI
[SecuritySafeCritical()]
[Obsolete("Use AuthenticateAsClientTaskAsync(TcpSession) instead.")]
public:
Task^ AuthenticateAsClientTaskAsync(
   ClientSecurity^ security
)

Parameters

security
Security parameters used during authentication.

Return Value

An awaitable task that represents the authentication operation.

Remarks

The security.TargetHost should match the server certificate name. If authentication fails, an AuthenticationException will occur.

To accept or reject a certificate "on-the-fly" implement a ClientSecurity.ValidationCallback function.

To select a client certificate "on-the-fly" implement a ClientSecurity.SelectionCallback function.

See Also

Reference

TcpBase Class
TcpBase Members
Overload List


AuthenticateAsClientTaskAsync(TcpSession) Method

[image]
PowerTCP Sockets for .NET
AuthenticateAsClientTaskAsync(TcpSession) Method
See Also Example Send comments on this topic
Dart.Sockets Namespace > TcpBase Class > AuthenticateAsClientTaskAsync Method : AuthenticateAsClientTaskAsync(TcpSession) Method

session
Session parameters used during authentication.

Glossary Item Box

Authenticates the server when establishing a secure connection.

Syntax

Visual Basic (Declaration)
<SecuritySafeCriticalAttribute()>
Public Overloads Function AuthenticateAsClientTaskAsync( _
   ByVal session As TcpSession _
) As Task
Visual Basic (Usage) Copy Code
Dim instance As TcpBase
Dim session As TcpSession
Dim value As Task

value = instance.AuthenticateAsClientTaskAsync(session)
C#
[SecuritySafeCritical()]
public Task AuthenticateAsClientTaskAsync(
   TcpSession session
)
Managed Extensions for C++
[SecuritySafeCritical()]
public: Task* AuthenticateAsClientTaskAsync(
   TcpSession* session
)
C++/CLI
[SecuritySafeCritical()]
public:
Task^ AuthenticateAsClientTaskAsync(
   TcpSession^ session
)

Parameters

session
Session parameters used during authentication.

Remarks

Uses Session.RemoteEndPoint, TcpSession.Proxy and TcpSession.Security to specify Security.ValidationCallback, SelectionCallback, ClientSecurity.TargetHost, Certificates, Security.Protocols, and Security.CheckCertificateRevocation.

If session.Security.TargetHost is not specifed, then session.RemoteEndPoint.HostNameOrAddress will be used instead. session.Security.TargetHost should match the server certificate name. If authentication fails, an AuthenticationException will occur.

To accept or reject a certificate "on-the-fly" implement a TcpSession.Security.ValidationCallback function.

To select a client certificate "on-the-fly" implement a TcpSession.Security.SelectionCallback function.

Example

This example demonstrates the AuthenticateAsClient call, the callback that prompts for a local certificate, and the callback that executes when a certificate is received.
C# Copy Code
using System.Net.Security;
using System.Security.Authentication;
using System.Security.Cryptography.X509Certificates;

/// <summary>
/// Establishes SSL with the provided Tcp object. Typically called immediately after connecting to the server (implicit)
/// or after a command such as STARTTLS is sent to the server (explicit).
/// </summary>
/// <param name="myComponent">Object to establish SSL with</param>
/// <param name="session">The TcpSession object used for connecting to the server</param>
/// <param name="serverHostName">The name of the server</param>
/// <param name="protocols">Protocols the client will accept</param>
/// <param name="checkRevocation">Check certificate revocation list during authentication</param>
private void authenticateTcp(Tcp myComponent, TcpSession session, string serverHostName, SslProtocols protocols, bool checkRevocation)
{
    //Specify configuration and certificate callback function, and authenticate server
    //Specifying TargetHost is only necessary if TcpSession.RemoteEndPoint.HostNameOrAddress doesn't match the server's certificate
    session.Security.TargetHost = serverHostName;
    session.Security.Protocols = protocols;
    session.Security.CheckCertificateRevocation = checkRevocation;
    session.Security.ValidationCallback = certificateReceived;
    session.Security.SelectionCallback = selectLocalCertificate;
    myComponent.AuthenticateAsClient(session);
}

/// <summary>
/// Prompts the user to select a certificate for SSL authentication.
/// </summary>
/// <remarks>
/// This snippet assumes the presence of the Dart Test Certificate in the user's 'My' certificate store.
/// The Dart Test Certificate may be installed from the component's Start Menu program group.
/// For a UI-based certificate selection, please see the CertificateListForm included with our
/// WinForms samples.
/// </remarks>
/// <param name="targetHost">The host server specified by the client.</param>
/// <param name="localCertificates">A reference to ClientSecurity.Certificates</param>
/// <param name="remoteCertificate">The certificate used to authenticate the remote party.</param>
/// <param name="acceptableIssuers">A String array of certificate issuers acceptable to the remote party.</param>
/// <returns>An X509Certificate to use for establishing the SSL connection.</returns>
private X509Certificate selectLocalCertificate(Object sender, string targetHost,
    X509CertificateCollection localCertificates, X509Certificate remoteCertificate, string[] acceptableIssuers)
{
    //Try to find the Dart Test Certificate
    X509Store certificateStore = new X509Store(StoreName.My);
    certificateStore.Open(OpenFlags.ReadOnly);
    foreach (X509Certificate2 cert in certificateStore.Certificates)
        if (cert.GetNameInfo(X509NameType.SimpleName, true) == "DartdomCA")
        {
            certificateStore.Close();
            return cert;
        }
    //Certificate not found, return null
    return null;
}

/// <summary>
/// Presents the server's certificate for validation.
/// </summary>
/// <param name="certificate">The certificate presented by the server</param>
/// <param name="chain">The chain of certificate authorities associated with the remote certificate</param>
/// <param name="sslPolicyErrors">One or more errors associated with the server's certificate</param>
/// <returns>A Boolean value that specifies whether the presented certificate is accepted for authentication</returns>
private bool certificateReceived(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
{
    //Accept certificate if it passed standard validation.
    if (sslPolicyErrors == SslPolicyErrors.None)
        return true;

    string msg = "The server could not be validated for the following reason(s):";

    if ((sslPolicyErrors & SslPolicyErrors.RemoteCertificateNotAvailable) == SslPolicyErrors.RemoteCertificateNotAvailable)
        msg += Environment.NewLine + "    -The server did not present a certificate.";
    else
    {
        if ((sslPolicyErrors & SslPolicyErrors.RemoteCertificateNameMismatch) == SslPolicyErrors.RemoteCertificateNameMismatch)
            msg += Environment.NewLine + "    -Certificate name mismatch.";
        if ((sslPolicyErrors & SslPolicyErrors.RemoteCertificateChainErrors) == SslPolicyErrors.RemoteCertificateChainErrors)
        {
            msg += Environment.NewLine + "    -Certificate chain errors:" + Environment.NewLine;

            foreach (X509ChainStatus item in chain.ChainStatus)
                msg += "    --" + item.StatusInformation;
        }
    }

    //Prompt to override security check
    msg += Environment.NewLine + "Override security check?";
    if (MessageBox.Show(msg, "Security Alert: Server could not be validated", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes)
        return true;
    else
        return false;
}
Visual Basic Copy Code
Imports System.Net.Security
Imports System.Security.Authentication
Imports System.Security.Cryptography.X509Certificates

''' <summary>
''' Establishes SSL with the provided Tcp object. Typically called immediately after connecting to the server (implicit)
''' or after a command such as STARTTLS is sent to the server (explicit).
''' </summary>
''' <param name="myComponent">Object to establish SSL with</param>
''' <param name="session">The TcpSession object used for connecting to the server</param>
''' <param name="serverHostName">The name of the server</param>
''' <param name="protocols">Protocols the client will accept</param>
''' <param name="checkRevocation">Check certificate revocation list during authentication</param>
Private Sub authenticateTcp(ByVal myComponent As Tcp, ByVal session As TcpSession, ByVal serverHostName As String, ByVal protocols As SslProtocols, ByVal checkRevocation As Boolean)
    'Specify configuration and certificate callback function, and authenticate server
    'Specifying TargetHost is only necessary if TcpSession.RemoteEndPoint.HostNameOrAddress doesn't match the server's certificate
    session.Security.TargetHost = serverHostName
    session.Security.Protocols = protocols
    session.Security.CheckCertificateRevocation = checkRevocation
    session.Security.ValidationCallback = AddressOf certificateReceived
    session.Security.SelectionCallback = AddressOf selectLocalCertificate
    myComponent.AuthenticateAsClient(session)
End Sub

''' <summary>
''' Prompts the user to select a certificate for SSL authentication.
''' </summary>
''' <remarks>
''' This snippet assumes the presence of the Dart Test Certificate in the user's 'My' certificate store.
''' The Dart Test Certificate may be installed from the component's Start Menu program group.
''' For a UI-based certificate selection, please see the CertificateListForm included with our
''' WinForms samples.
''' </remarks>
''' <param name="targetHost">The host server specified by the client.</param>
''' <param name="localCertificates">A reference to ClientSecurity.Certificates</param>
''' <param name="remoteCertificate">The certificate used to authenticate the remote party.</param>
''' <param name="acceptableIssuers">A String array of certificate issuers acceptable to the remote party.</param>
''' <returns>An X509Certificate to use for establishing the SSL connection.</returns>
Private Function selectLocalCertificate(ByVal sender As Object, ByVal targetHost As String, ByVal localCertificates As X509CertificateCollection, ByVal remoteCertificate As X509Certificate, ByVal acceptableIssuers() As String) As X509Certificate
    'Try to find the Dart Test Certificate
    Dim certificateStore As New X509Store(StoreName.My)
    certificateStore.Open(OpenFlags.ReadOnly)
    For Each cert As X509Certificate2 In certificateStore.Certificates
        If cert.GetNameInfo(X509NameType.SimpleName, True) = "DartdomCA" Then
            certificateStore.Close()
            Return cert
        End If
    Next cert
    'Certificate not found, return null
    Return Nothing
End Function

''' <summary>
''' Presents the server's certificate for validation.
''' </summary>
''' <param name="certificate">The certificate presented by the server</param>
''' <param name="chain">The chain of certificate authorities associated with the remote certificate</param>
''' <param name="sslPolicyErrors">One or more errors associated with the server's certificate</param>
''' <returns>A Boolean value that specifies whether the presented certificate is accepted for authentication</returns>
Private Function certificateReceived(ByVal sender As Object, ByVal certificate As X509Certificate, ByVal chain As X509Chain, ByVal sslPolicyErrors As SslPolicyErrors) As Boolean
    'Accept certificate if it passed standard validation.
    If sslPolicyErrors = System.Net.Security.SslPolicyErrors.None Then
        Return True
    End If

    Dim msg As String = "The server could not be validated for the following reason(s):"

    If (sslPolicyErrors And System.Net.Security.SslPolicyErrors.RemoteCertificateNotAvailable) = System.Net.Security.SslPolicyErrors.RemoteCertificateNotAvailable Then
        msg &= Environment.NewLine & "    -The server did not present a certificate."
    Else
        If (sslPolicyErrors And System.Net.Security.SslPolicyErrors.RemoteCertificateNameMismatch) = System.Net.Security.SslPolicyErrors.RemoteCertificateNameMismatch Then
            msg &= Environment.NewLine & "    -Certificate name mismatch."
        End If
        If (sslPolicyErrors And System.Net.Security.SslPolicyErrors.RemoteCertificateChainErrors) = System.Net.Security.SslPolicyErrors.RemoteCertificateChainErrors Then
            msg &= Environment.NewLine & "    -Certificate chain errors:" & Environment.NewLine

            For Each item As X509ChainStatus In chain.ChainStatus
                msg &= "    --" & item.StatusInformation
            Next item
        End If
    End If

    'Prompt to override security check
    msg &= Environment.NewLine & "Override security check?"
    If MessageBox.Show(msg, "Security Alert: Server could not be validated", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) = System.Windows.Forms.DialogResult.Yes Then
        Return True
    Else
        Return False
    End If
End Function

See Also

Reference

TcpBase Class
TcpBase Members
Overload List


AuthenticateAsServerTaskAsync Method

[image]
PowerTCP Sockets for .NET
AuthenticateAsServerTaskAsync Method
See Also Send comments on this topic
Dart.Sockets Namespace > TcpBase Class : AuthenticateAsServerTaskAsync Method

security
Security parameters used during authentication.

Glossary Item Box

Authenticates a client when establishing a secure connection.

Syntax

Visual Basic (Declaration)
<SecuritySafeCriticalAttribute()>
Public Function AuthenticateAsServerTaskAsync( _
   ByVal security As ServerSecurity _
) As Task
Visual Basic (Usage) Copy Code
Dim instance As TcpBase
Dim security As ServerSecurity
Dim value As Task

value = instance.AuthenticateAsServerTaskAsync(security)
C#
[SecuritySafeCritical()]
public Task AuthenticateAsServerTaskAsync(
   ServerSecurity security
)
Managed Extensions for C++
[SecuritySafeCritical()]
public: Task* AuthenticateAsServerTaskAsync(
   ServerSecurity* security
)
C++/CLI
[SecuritySafeCritical()]
public:
Task^ AuthenticateAsServerTaskAsync(
   ServerSecurity^ security
)

Parameters

security
Security parameters used during authentication.

Return Value

An awaitable task that represents the authentication operation.

Remarks

To accept or reject a certificate "on-the-fly" implement a Security.ValidationCallback function.

See Also

Reference

TcpBase Class
TcpBase Members


ConnectTaskAsync Method

[image]
PowerTCP Sockets for .NET
ConnectTaskAsync Method
See Also Send comments on this topic
Dart.Sockets Namespace > TcpBase Class : ConnectTaskAsync Method

session
Used to specify the local and remote endpoints, and proxy configuration.

Glossary Item Box

Connect to a server using the configuration specified by session.

Syntax

Visual Basic (Declaration)
Public Function ConnectTaskAsync( _
   ByVal session As TcpSession _
) As Task
Visual Basic (Usage) Copy Code
Dim instance As TcpBase
Dim session As TcpSession
Dim value As Task

value = instance.ConnectTaskAsync(session)
C#
public Task ConnectTaskAsync(
   TcpSession session
)
Managed Extensions for C++
public: Task* ConnectTaskAsync(
   TcpSession* session
)
C++/CLI
public:
Task^ ConnectTaskAsync(
   TcpSession^ session
)

Parameters

session
Used to specify the local and remote endpoints, and proxy configuration.

Return Value

An awaitable task that represents the connect operation.

See Also

Reference

TcpBase Class
TcpBase Members


ReadTaskAsync Method

[image]
PowerTCP Sockets for .NET
ReadTaskAsync Method
See Also Send comments on this topic
Dart.Sockets Namespace > TcpBase Class : ReadTaskAsync Method

buffer
The byte array used to store the received data.
offset
The position in the buffer to store the data.
count
The maximum number of bytes to receive.

Glossary Item Box

Start an awaitable asynchronous read on the socket.

Syntax

Visual Basic (Declaration)
Public Function ReadTaskAsync( _
   ByVal buffer() As Byte, _
   ByVal offset As Integer, _
   ByVal count As Integer _
) As Task(Of Data)
Visual Basic (Usage) Copy Code
Dim instance As TcpBase
Dim buffer() As Byte
Dim offset As Integer
Dim count As Integer
Dim value As Task(Of Data)

value = instance.ReadTaskAsync(buffer, offset, count)
C#
public Task<Data> ReadTaskAsync(
   byte[] buffer,
   int offset,
   int count
)
Managed Extensions for C++
public: Task<Data*>* ReadTaskAsync(
   byte[]* buffer,
   int offset,
   int count
)
C++/CLI
public:
Task<Data^>^ ReadTaskAsync(
   array<byte>^ buffer,
   int offset,
   int count
)

Parameters

buffer
The byte array used to store the received data.
offset
The position in the buffer to store the data.
count
The maximum number of bytes to receive.

Return Value

A task that represents the asynchronous read operation. The value of the TResult parameter contains the Data object encapsulating the received data (null if the socket is closed).

Remarks

ReadTaskAsync encapsulates TcpBase.ReadAsync and its callback into an easy-to-use awaitable method, leveraging the benefits of IO completion ports without the complexity of callbacks.

See Also

Reference

TcpBase Class
TcpBase Members


WriteTaskAsync Method

[image]
PowerTCP Sockets for .NET
WriteTaskAsync Method
See Also Send comments on this topic
Dart.Sockets Namespace > TcpBase Class : WriteTaskAsync Method

buffer
Byte array of data to send.
offset
The position in the data buffer at which to begin sending data.
count
The number of bytes to send.

Glossary Item Box

Start an awaitable asynchronous write on the socket.

Syntax

Visual Basic (Declaration)
Public Function WriteTaskAsync( _
   ByVal buffer() As Byte, _
   ByVal offset As Integer, _
   ByVal count As Integer _
) As Task(Of Data)
Visual Basic (Usage) Copy Code
Dim instance As TcpBase
Dim buffer() As Byte
Dim offset As Integer
Dim count As Integer
Dim value As Task(Of Data)

value = instance.WriteTaskAsync(buffer, offset, count)
C#
public Task<Data> WriteTaskAsync(
   byte[] buffer,
   int offset,
   int count
)
Managed Extensions for C++
public: Task<Data*>* WriteTaskAsync(
   byte[]* buffer,
   int offset,
   int count
)
C++/CLI
public:
Task<Data^>^ WriteTaskAsync(
   array<byte>^ buffer,
   int offset,
   int count
)

Parameters

buffer
Byte array of data to send.
offset
The position in the data buffer at which to begin sending data.
count
The number of bytes to send.

Return Value

A task that represents the asynchronous read operation. The value of the TResult parameter contains the Data object encapsulating the written data (null if the socket is closed).

Remarks

WriteTaskAsync encapsulates TcpBase.WriteAsync and its callback into an easy-to-use awaitable method, leveraging the benefits of IO completion ports without the complexity of callbacks.

See Also

Reference

TcpBase Class
TcpBase Members


Udp Class Members

[image]
PowerTCP Sockets for .NET
Udp Class Members
See Also Properties Methods Events Send comments on this topic
Dart.Sockets Namespace : Udp Class

Glossary Item Box

The following tables list the members exposed by Udp.

Public Constructors

 | Name | Description
Public Constructor | Udp Constructor | Overloaded.
Top

Public Properties

 | Name | Description
Public Property | Container | (Inherited from System.ComponentModel.Component)
Public Property | Encoding | Character encoding used by the component. (Inherited from Dart.Sockets.ComponentBase)
Public Property | Site | (Inherited from System.ComponentModel.Component)
Public Property | Socket | Gets the socket used by the component for communications. (Inherited from Dart.Sockets.SocketBase)
Public Property | SocketOption | Gets the socket options for classes derived from UdpBase. (Inherited from Dart.Sockets.UdpBase)
Public Property | SynchronizingObject | Gets or sets the object used to marshal data to the UI thread (for raising events). (Inherited from Dart.Sockets.ComponentBase)
Public Property | SyncRoot | Gets an object that is used to synchronize access to the upper layer protocol in use. (Inherited from Dart.Sockets.ComponentBase)
Public Property | Tag | Gets or sets an object that stores any user data. (Inherited from Dart.Sockets.ComponentBase)
Top

Protected Properties

 | Name | Description
Protected Property | CanRaiseEvents | (Inherited from System.ComponentModel.Component)
Protected Property | DesignMode | (Inherited from System.ComponentModel.Component)
Protected Property | Events | (Inherited from System.ComponentModel.Component)
Top

Public Methods

 | Name | Description
Public Method | Close | Close the socket and release all resources. (Inherited from Dart.Sockets.UdpBase)
Public Method | CreateObjRef | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from System.MarshalByRefObject)
Public Method | Deserialize | Deserialize a previously serialized object. (Inherited from Dart.Sockets.ComponentBase)
Public Method | Dispose | Overloaded. Overridden. Releases all resources associated with the object.
Public Method | GetLifetimeService | Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | InitializeLifetimeService | Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | JoinMulticastGroup | Join the specified multicast group for receiving datagrams. (Inherited from Dart.Sockets.UdpBase)
Public Method | LeaveMulticastGroup | Leave the specified multicast group for receiving datagrams. (Inherited from Dart.Sockets.UdpBase)
Public Method | Marshal | Overloaded. Marshals a string and/or object to the UI thread and raises the UserState event. (Inherited from Dart.Sockets.ComponentBase)
Public Method | Open | Overloaded. Opens a socket on all IPv4 network interfaces and the specified port. (Inherited from Dart.Sockets.UdpBase)
Public Method | Receive | Overloaded. Receive a datagram. (Inherited from Dart.Sockets.UdpBase)
Public Method | ReceiveAsync | Receive a datagram asynchronously. (Inherited from Dart.Sockets.UdpBase)
Public Method | ReceiveTaskAsync | Receive a datagram. (Inherited from Dart.Sockets.UdpBase)
Public Method | Send | Overloaded. Send a datagram to the specified remote address and port. (Inherited from Dart.Sockets.UdpBase)
Public Method | SendAsync | Send a datagram to the specified IPEndPoint asynchronously, specifying a buffer, offset, length and SocketFlags value. (Inherited from Dart.Sockets.UdpBase)
Public Method | SendTaskAsync | Send a datagram to the specified IPEndPoint, specifying a buffer, offset, length and SocketFlags value. (Inherited from Dart.Sockets.UdpBase)
Public Method | Serialize | Serialize an object to the provided destination stream. (Inherited from Dart.Sockets.ComponentBase)
Public Method | ToString | (Inherited from System.ComponentModel.Component)
Top

Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from System.ComponentModel.Component)
Protected Method | GetService | (Inherited from System.ComponentModel.Component)
Protected Method | MemberwiseClone | Overloaded. Creates a shallow copy of the current System.MarshalByRefObject object. (Inherited from System.MarshalByRefObject)
Protected Method | OnError | Raises the Error event. (Inherited from Dart.Sockets.ComponentBase)
Protected Method | OnUserState | Raises the UserState event. (Inherited from Dart.Sockets.ComponentBase)
Top

Public Events

 | Name | Description
Public Event | Disposed | (Inherited from System.ComponentModel.Component)
Public Event | Error | Raised when Marshal(Exception) is used or an unhandled Exception is thrown in a worker thread created using Start. (Inherited from Dart.Sockets.ComponentBase)
Public Event | UserState | Raised when Marshal(String,Object) is used. (Inherited from Dart.Sockets.ComponentBase)
Top

See Also

Reference

Udp Class
Dart.Sockets Namespace


Udp Class Methods

[image]
PowerTCP Sockets for .NET
Udp Class Methods
See Also Send comments on this topic
Dart.Sockets Namespace : Udp Class

Glossary Item Box

For a list of all members of this type, see Udp members.

Public Methods

 | Name | Description
Public Method | Close | Close the socket and release all resources. (Inherited from Dart.Sockets.UdpBase)
Public Method | CreateObjRef | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from System.MarshalByRefObject)
Public Method | Deserialize | Deserialize a previously serialized object. (Inherited from Dart.Sockets.ComponentBase)
Public Method | Dispose | Overloaded. Overridden. Releases all resources associated with the object.
Public Method | GetLifetimeService | Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | InitializeLifetimeService | Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | JoinMulticastGroup | Join the specified multicast group for receiving datagrams. (Inherited from Dart.Sockets.UdpBase)
Public Method | LeaveMulticastGroup | Leave the specified multicast group for receiving datagrams. (Inherited from Dart.Sockets.UdpBase)
Public Method | Marshal | Overloaded. Marshals a string and/or object to the UI thread and raises the UserState event. (Inherited from Dart.Sockets.ComponentBase)
Public Method | Open | Overloaded. Opens a socket on all IPv4 network interfaces and the specified port. (Inherited from Dart.Sockets.UdpBase)
Public Method | Receive | Overloaded. Receive a datagram. (Inherited from Dart.Sockets.UdpBase)
Public Method | ReceiveAsync | Receive a datagram asynchronously. (Inherited from Dart.Sockets.UdpBase)
Public Method | ReceiveTaskAsync | Receive a datagram. (Inherited from Dart.Sockets.UdpBase)
Public Method | Send | Overloaded. Send a datagram to the specified remote address and port. (Inherited from Dart.Sockets.UdpBase)
Public Method | SendAsync | Send a datagram to the specified IPEndPoint asynchronously, specifying a buffer, offset, length and SocketFlags value. (Inherited from Dart.Sockets.UdpBase)
Public Method | SendTaskAsync | Send a datagram to the specified IPEndPoint, specifying a buffer, offset, length and SocketFlags value. (Inherited from Dart.Sockets.UdpBase)
Public Method | Serialize | Serialize an object to the provided destination stream. (Inherited from Dart.Sockets.ComponentBase)
Public Method | ToString | (Inherited from System.ComponentModel.Component)
Top

Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from System.ComponentModel.Component)
Protected Method | GetService | (Inherited from System.ComponentModel.Component)
Protected Method | MemberwiseClone | Overloaded. Creates a shallow copy of the current System.MarshalByRefObject object. (Inherited from System.MarshalByRefObject)
Protected Method | OnError | Raises the Error event. (Inherited from Dart.Sockets.ComponentBase)
Protected Method | OnUserState | Raises the UserState event. (Inherited from Dart.Sockets.ComponentBase)
Top

See Also

Reference

Udp Class
Dart.Sockets Namespace


UdpBase Class Members

[image]
PowerTCP Sockets for .NET
UdpBase Class Members
See Also Properties Methods Events Send comments on this topic
Dart.Sockets Namespace : UdpBase Class

Glossary Item Box

The following tables list the members exposed by UdpBase.

Public Constructors

 | Name | Description
Public Constructor | UdpBase Constructor | Default constructor for UdpBase
Top

Public Properties

 | Name | Description
Public Property | Container | (Inherited from System.ComponentModel.Component)
Public Property | Encoding | Character encoding used by the component. (Inherited from Dart.Sockets.ComponentBase)
Public Property | Site | (Inherited from System.ComponentModel.Component)
Public Property | Socket | Gets the socket used by the component for communications. (Inherited from Dart.Sockets.SocketBase)
Public Property | SocketOption | Gets the socket options for classes derived from UdpBase.
Public Property | SynchronizingObject | Gets or sets the object used to marshal data to the UI thread (for raising events). (Inherited from Dart.Sockets.ComponentBase)
Public Property | SyncRoot | Gets an object that is used to synchronize access to the upper layer protocol in use. (Inherited from Dart.Sockets.ComponentBase)
Public Property | Tag | Gets or sets an object that stores any user data. (Inherited from Dart.Sockets.ComponentBase)
Top

Protected Properties

 | Name | Description
Protected Property | CanRaiseEvents | (Inherited from System.ComponentModel.Component)
Protected Property | DesignMode | (Inherited from System.ComponentModel.Component)
Protected Property | Events | (Inherited from System.ComponentModel.Component)
Top

Public Methods

 | Name | Description
Public Method | Close | Close the socket and release all resources.
Public Method | CreateObjRef | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from System.MarshalByRefObject)
Public Method | Deserialize | Deserialize a previously serialized object. (Inherited from Dart.Sockets.ComponentBase)
Public Method | Dispose | Overloaded. Disposes of SocketBase and its associated resources. (Inherited from Dart.Sockets.SocketBase)
Public Method | GetLifetimeService | Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | InitializeLifetimeService | Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | JoinMulticastGroup | Join the specified multicast group for receiving datagrams.
Public Method | LeaveMulticastGroup | Leave the specified multicast group for receiving datagrams.
Public Method | Marshal | Overloaded. Marshals a string and/or object to the UI thread and raises the UserState event. (Inherited from Dart.Sockets.ComponentBase)
Public Method | Open | Overloaded. Opens a socket on all IPv4 network interfaces and the specified port.
Public Method | Receive | Overloaded. Receive a datagram.
Public Method | ReceiveAsync | Receive a datagram asynchronously.
Public Method | ReceiveTaskAsync | Receive a datagram.
Public Method | Send | Overloaded. Send a datagram to the specified remote address and port.
Public Method | SendAsync | Send a datagram to the specified IPEndPoint asynchronously, specifying a buffer, offset, length and SocketFlags value.
Public Method | SendTaskAsync | Send a datagram to the specified IPEndPoint, specifying a buffer, offset, length and SocketFlags value.
Public Method | Serialize | Serialize an object to the provided destination stream. (Inherited from Dart.Sockets.ComponentBase)
Public Method | ToString | (Inherited from System.ComponentModel.Component)
Top

Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from System.ComponentModel.Component)
Protected Method | GetService | (Inherited from System.ComponentModel.Component)
Protected Method | MemberwiseClone | Overloaded. Creates a shallow copy of the current System.MarshalByRefObject object. (Inherited from System.MarshalByRefObject)
Protected Method | OnError | Raises the Error event. (Inherited from Dart.Sockets.ComponentBase)
Protected Method | OnUserState | Raises the UserState event. (Inherited from Dart.Sockets.ComponentBase)
Top

Public Events

 | Name | Description
Public Event | Disposed | (Inherited from System.ComponentModel.Component)
Public Event | Error | Raised when Marshal(Exception) is used or an unhandled Exception is thrown in a worker thread created using Start. (Inherited from Dart.Sockets.ComponentBase)
Public Event | UserState | Raised when Marshal(String,Object) is used. (Inherited from Dart.Sockets.ComponentBase)
Top

See Also

Reference

UdpBase Class
Dart.Sockets Namespace


UdpBase Class Methods

[image]
PowerTCP Sockets for .NET
UdpBase Class Methods
See Also Send comments on this topic
Dart.Sockets Namespace : UdpBase Class

Glossary Item Box

For a list of all members of this type, see UdpBase members.

Public Methods

 | Name | Description
Public Method | Close | Close the socket and release all resources.
Public Method | CreateObjRef | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from System.MarshalByRefObject)
Public Method | Deserialize | Deserialize a previously serialized object. (Inherited from Dart.Sockets.ComponentBase)
Public Method | Dispose | Overloaded. Disposes of SocketBase and its associated resources. (Inherited from Dart.Sockets.SocketBase)
Public Method | GetLifetimeService | Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | InitializeLifetimeService | Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | JoinMulticastGroup | Join the specified multicast group for receiving datagrams.
Public Method | LeaveMulticastGroup | Leave the specified multicast group for receiving datagrams.
Public Method | Marshal | Overloaded. Marshals a string and/or object to the UI thread and raises the UserState event. (Inherited from Dart.Sockets.ComponentBase)
Public Method | Open | Overloaded. Opens a socket on all IPv4 network interfaces and the specified port.
Public Method | Receive | Overloaded. Receive a datagram.
Public Method | ReceiveAsync | Receive a datagram asynchronously.
Public Method | ReceiveTaskAsync | Receive a datagram.
Public Method | Send | Overloaded. Send a datagram to the specified remote address and port.
Public Method | SendAsync | Send a datagram to the specified IPEndPoint asynchronously, specifying a buffer, offset, length and SocketFlags value.
Public Method | SendTaskAsync | Send a datagram to the specified IPEndPoint, specifying a buffer, offset, length and SocketFlags value.
Public Method | Serialize | Serialize an object to the provided destination stream. (Inherited from Dart.Sockets.ComponentBase)
Public Method | ToString | (Inherited from System.ComponentModel.Component)
Top

Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from System.ComponentModel.Component)
Protected Method | GetService | (Inherited from System.ComponentModel.Component)
Protected Method | MemberwiseClone | Overloaded. Creates a shallow copy of the current System.MarshalByRefObject object. (Inherited from System.MarshalByRefObject)
Protected Method | OnError | Raises the Error event. (Inherited from Dart.Sockets.ComponentBase)
Protected Method | OnUserState | Raises the UserState event. (Inherited from Dart.Sockets.ComponentBase)
Top

See Also

Reference

UdpBase Class
Dart.Sockets Namespace


ReceiveTaskAsync Method

[image]
PowerTCP Sockets for .NET
ReceiveTaskAsync Method
See Also Send comments on this topic
Dart.Sockets Namespace > UdpBase Class : ReceiveTaskAsync Method

buffer
A byte array to be filled with the data received.
offset
Location where received bytes are to placed.
size
The number of bytes to receive.
socketFlags
User specified SocketFlags.

Glossary Item Box

Receive a datagram.

Syntax

Visual Basic (Declaration)
Public Function ReceiveTaskAsync( _
   ByVal buffer() As Byte, _
   ByVal offset As Integer, _
   ByVal size As Integer, _
   ByVal socketFlags As SocketFlags _
) As Task(Of Datagram)
Visual Basic (Usage) Copy Code
Dim instance As UdpBase
Dim buffer() As Byte
Dim offset As Integer
Dim size As Integer
Dim socketFlags As SocketFlags
Dim value As Task(Of Datagram)

value = instance.ReceiveTaskAsync(buffer, offset, size, socketFlags)
C#
public Task<Datagram> ReceiveTaskAsync(
   byte[] buffer,
   int offset,
   int size,
   SocketFlags socketFlags
)
Managed Extensions for C++
public: Task<Datagram*>* ReceiveTaskAsync(
   byte[]* buffer,
   int offset,
   int size,
   SocketFlags socketFlags
)
C++/CLI
public:
Task<Datagram^>^ ReceiveTaskAsync(
   array<byte>^ buffer,
   int offset,
   int size,
   SocketFlags socketFlags
)

Parameters

buffer
A byte array to be filled with the data received.
offset
Location where received bytes are to placed.
size
The number of bytes to receive.
socketFlags
User specified SocketFlags.

Return Value

An awaitable task that represents the asynchronous receive operation. The value of the TResult parameter contains the Datagram object encapsulating the received data (null if the socket is closed).

Exceptions

Exception | Description
System.ArgumentNullException | buffer is null.

Remarks

Use the Receive method to receive a datagram into buffer. This method also returns a Datagram object encapsulating the datagram received. Segment.Buffer contains the actual datagram data (equivalent to buffer). Datagram.Origin contains the endpoint of the remote host from which the datagram was sent.

A UDP datagram provides little functionality over an IP datagram, adding a port number field (allows demultiplexing on the receiving host) and a checksum field (provides basic error handling). Unlike TCP, UDP datagrams are sent as a unit. If Send is called 3 times to send 3 datagrams to a host, the receiving host will have to call Receive 3 times. Also, the size of each datagram sent will equal the size of each datagram received by the receiving host. In addition, since UDP is a connectionless protocol, datagrams sent to the host are not guaranteed to be delivered. Therefore, any required error checking (outside of UDP's checksum implementation) will have to be done by the application-layer protocol.

See Also

Reference

UdpBase Class
UdpBase Members


SendTaskAsync Method

[image]
PowerTCP Sockets for .NET
SendTaskAsync Method
See Also Send comments on this topic
Dart.Sockets Namespace > UdpBase Class : SendTaskAsync Method

buffer
A byte array containing the data to send.
offset
Starting offset within buffer for sending.
count
Number of bytes to send.
socketFlags
A bitwise combination of special use sending parameters.
destination
The System.Net.IPEndPoint representing the remote hosts's IP address and port.

Glossary Item Box

Send a datagram to the specified IPEndPoint, specifying a buffer, offset, length and SocketFlags value.

Syntax

Visual Basic (Declaration)
Public Function SendTaskAsync( _
   ByVal buffer() As Byte, _
   ByVal offset As Integer, _
   ByVal count As Integer, _
   ByVal socketFlags As SocketFlags, _
   ByVal destination As IPEndPoint _
) As Task(Of Datagram)
Visual Basic (Usage) Copy Code
Dim instance As UdpBase
Dim buffer() As Byte
Dim offset As Integer
Dim count As Integer
Dim socketFlags As SocketFlags
Dim destination As IPEndPoint
Dim value As Task(Of Datagram)

value = instance.SendTaskAsync(buffer, offset, count, socketFlags, destination)
C#
public Task<Datagram> SendTaskAsync(
   byte[] buffer,
   int offset,
   int count,
   SocketFlags socketFlags,
   IPEndPoint destination
)
Managed Extensions for C++
public: Task<Datagram*>* SendTaskAsync(
   byte[]* buffer,
   int offset,
   int count,
   SocketFlags socketFlags,
   IPEndPoint* destination
)
C++/CLI
public:
Task<Datagram^>^ SendTaskAsync(
   array<byte>^ buffer,
   int offset,
   int count,
   SocketFlags socketFlags,
   IPEndPoint^ destination
)

Parameters

buffer
A byte array containing the data to send.
offset
Starting offset within buffer for sending.
count
Number of bytes to send.
socketFlags
A bitwise combination of special use sending parameters.
destination
The System.Net.IPEndPoint representing the remote hosts's IP address and port.

Return Value

An awaitable task that represents the asynchronous send operation. The value of the TResult parameter contains the Datagram object encapsulating the sent data.

Exceptions

Exception | Description
System.ArgumentNullException | buffer is null.
System.Net.Sockets.SocketException | The remote address is unknown, invalid, or unable to be resolved.
System.ArgumentOutOfRangeException | The remote port is out of the range of valid values. --or-- offset or count is less than 0.
System.ArgumentException | offset + count is greater than the length of buffer.

Remarks

Use the SendTaskAsync method to send a datagram created from the data contained in buffer to the specified hostNameOrAddress.

A UDP datagram provides little functionality over an IP datagram, adding a port number field (allows demultiplexing on the receiving host) and a checksum field (provides basic error handling). Unlike TCP, UDP datagrams are sent as a unit. If Send is called 3 times to send 3 datagrams to a host, the receiving host will have to call Receive 3 times. Also, the size of each datagram sent will equal the size of each datagram received by the receiving host. In addition, since UDP is a connectionless protocol, any datagrams sent to the host are not guaranteed to be delivered. Therefore, any required error checking (outside of UDP's checksum implementation) will have to be done by the application-layer protocol.

To send a broadcast datagram, use "255.255.255.255" as the remote address. To send a multicast datagram, use the multicast group address as the remote address after first joining a multicast group by using JoinMulitcastGroup.

See Also

Reference

UdpBase Class
UdpBase Members


UserStateEventArgs Class

[image]
PowerTCP Sockets for .NET
UserStateEventArgs Class
Members See Also Send comments on this topic
Dart.Sockets Namespace : UserStateEventArgs Class

Glossary Item Box

Provides data for UserState. Base class for EventArgs that have Message and UserState properties.

Object Model

UserStateEventArgs Class

Syntax

Visual Basic (Declaration)
Public Class UserStateEventArgs
   Inherits System.EventArgs
Visual Basic (Usage) Copy Code
Dim instance As UserStateEventArgs
C#
public class UserStateEventArgs : System.EventArgs
Managed Extensions for C++
public __gc class UserStateEventArgs : public System.EventArgs
C++/CLI
public ref class UserStateEventArgs : public System.EventArgs

Inheritance Hierarchy

System.Object
System.EventArgs
Dart.Sockets.UserStateEventArgs
Dart.Sockets.DataEventArgs

See Also

Reference

UserStateEventArgs Members
Dart.Sockets Namespace


Assembly Overview

Dart.Sockets Assembly
See Also Send comments on this topic

Glossary Item Box

Namespaces

Namespace | Description
Dart.Sockets |


Assembly Overview

Dart.Sockets.45 Assembly
See Also Send comments on this topic

Glossary Item Box

Namespaces

Namespace | Description
Dart.Sockets |


Getting Started - PowerTCP Sockets for .NET

Getting Started
Send comments on this topic

Glossary Item Box


Introduction - PowerTCP Sockets for .NET

Introduction
Send comments on this topic

Glossary Item Box


DartLicenseException Class Events

[image]
PowerTCP Sockets for .NET
DartLicenseException Class Events
See Also Send comments on this topic
Dart.Sockets Namespace : DartLicenseException Class

Glossary Item Box

For a list of all members of this type, see DartLicenseException members.

Protected Events

 | Name | Description
Protected Event | SerializeObjectState | Occurs when an exception is serialized to create an exception state object that contains serialized data about the exception. (Inherited from System.Exception)
Top

See Also

Reference

DartLicenseException Class
Dart.Sockets Namespace


DartLicenseException Class Methods

[image]
PowerTCP Sockets for .NET
DartLicenseException Class Methods
See Also Send comments on this topic
Dart.Sockets Namespace : DartLicenseException Class

Glossary Item Box

For a list of all members of this type, see DartLicenseException members.

Public Methods

 | Name | Description
Public Method | GetBaseException | When overridden in a derived class, returns the System.Exception that is the root cause of one or more subsequent exceptions. (Inherited from System.Exception)
Public Method | GetObjectData | When overridden in a derived class, sets the System.Runtime.Serialization.SerializationInfo with information about the exception. (Inherited from System.Exception)
Public Method | GetType | Gets the runtime type of the current instance. (Inherited from System.Exception)
Public Method | ToString | Creates and returns a string representation of the current exception. (Inherited from System.Exception)
Top

See Also

Reference

DartLicenseException Class
Dart.Sockets Namespace


DartLicenseException Class Properties

[image]
PowerTCP Sockets for .NET
DartLicenseException Class Properties
See Also Send comments on this topic
Dart.Sockets Namespace : DartLicenseException Class

Glossary Item Box

For a list of all members of this type, see DartLicenseException members.

Public Properties

 | Name | Description
Public Property | Data | Gets a collection of key/value pairs that provide additional user-defined information about the exception. (Inherited from System.Exception)
Public Property | HelpLink | Gets or sets a link to the help file associated with this exception. (Inherited from System.Exception)
Public Property | HResult | Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception. (Inherited from System.Exception)
Public Property | InnerException | Gets the System.Exception instance that caused the current exception. (Inherited from System.Exception)
Public Property | Message | Gets a message that describes the current exception. (Inherited from System.Exception)
Public Property | Source | Gets or sets the name of the application or the object that causes the error. (Inherited from System.Exception)
Public Property | StackTrace | Gets a string representation of the immediate frames on the call stack. (Inherited from System.Exception)
Public Property | TargetSite | Gets the method that throws the current exception. (Inherited from System.Exception)
Top

See Also

Reference

DartLicenseException Class
Dart.Sockets Namespace


DataException Class Events

[image]
PowerTCP Sockets for .NET
DataException Class Events
See Also Send comments on this topic
Dart.Sockets Namespace : DataException Class

Glossary Item Box

For a list of all members of this type, see DataException members.

Protected Events

 | Name | Description
Protected Event | SerializeObjectState | Occurs when an exception is serialized to create an exception state object that contains serialized data about the exception. (Inherited from System.Exception)
Top

See Also

Reference

DataException Class
Dart.Sockets Namespace


DataException Class Methods

[image]
PowerTCP Sockets for .NET
DataException Class Methods
See Also Send comments on this topic
Dart.Sockets Namespace : DataException Class

Glossary Item Box

For a list of all members of this type, see DataException members.

Public Methods

 | Name | Description
Public Method | GetBaseException | When overridden in a derived class, returns the System.Exception that is the root cause of one or more subsequent exceptions. (Inherited from System.Exception)
Public Method | GetObjectData | When overridden in a derived class, sets the System.Runtime.Serialization.SerializationInfo with information about the exception. (Inherited from System.Exception)
Public Method | GetType | Gets the runtime type of the current instance. (Inherited from System.Exception)
Public Method | ToString | Creates and returns a string representation of the current exception. (Inherited from System.Exception)
Top

See Also

Reference

DataException Class
Dart.Sockets Namespace


DataException Class Properties

[image]
PowerTCP Sockets for .NET
DataException Class Properties
See Also Send comments on this topic
Dart.Sockets Namespace : DataException Class

Glossary Item Box

For a list of all members of this type, see DataException members.

Public Properties

 | Name | Description
Public Property | Data | Gets a collection of key/value pairs that provide additional user-defined information about the exception. (Inherited from System.Exception)
Public Property | HelpLink | Gets or sets a link to the help file associated with this exception. (Inherited from System.Exception)
Public Property | HResult | Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception. (Inherited from System.Exception)
Public Property | InnerException | Gets the System.Exception instance that caused the current exception. (Inherited from System.Exception)
Public Property | Message | Gets a message that describes the current exception. (Inherited from System.Exception)
Public Property | Source | Gets or sets the name of the application or the object that causes the error. (Inherited from System.Exception)
Public Property | StackTrace | Gets a string representation of the immediate frames on the call stack. (Inherited from System.Exception)
Public Property | TargetSite | Gets the method that throws the current exception. (Inherited from System.Exception)
Top

See Also

Reference

DataException Class
Dart.Sockets Namespace


Datagram Class Methods

[image]
PowerTCP Sockets for .NET
Datagram Class Methods
See Also Send comments on this topic
Dart.Sockets Namespace : Datagram Class

Glossary Item Box

For a list of all members of this type, see Datagram members.

Public Methods

 | Name | Description
Public Method | ToString | Gets the data as a decoded string. (Inherited from Dart.Sockets.Data)
Top

See Also

Reference

Datagram Class
Dart.Sockets Namespace


Datagram Class Properties

[image]
PowerTCP Sockets for .NET
Datagram Class Properties
See Also Send comments on this topic
Dart.Sockets Namespace : Datagram Class

Glossary Item Box

For a list of all members of this type, see Datagram members.

Public Properties

 | Name | Description
Public Property | Buffer | Gets the buffer that holds data. (Inherited from Dart.Sockets.Segment)
Public Property | Count | Byte count of data. (Inherited from Dart.Sockets.Segment)
Public Property | Delimiter | Gets the delimiter byte array used by TcpBase.ReadToDelimiter. (Inherited from Dart.Sockets.Data)
Public Property | Direction | Indicates whether data is inbound or outbound. (Inherited from Dart.Sockets.Data)
Public Property | Encoding | Gets the character encoding used by the object. (Inherited from Dart.Sockets.Data)
Public Property | Offset | The offset into the buffer where the data starts. (Inherited from Dart.Sockets.Segment)
Top

See Also

Reference

Datagram Class
Dart.Sockets Namespace


Dns Class Events

[image]
PowerTCP Sockets for .NET
Dns Class Events
See Also Send comments on this topic
Dart.Sockets Namespace : Dns Class

Glossary Item Box

For a list of all members of this type, see Dns members.

Public Events

 | Name | Description
Public Event | Disposed | (Inherited from System.ComponentModel.Component)
Public Event | Error | Raised when Marshal(Exception) is used or an unhandled Exception is thrown in a worker thread created using Start. (Inherited from Dart.Sockets.ComponentBase)
Public Event | UserState | Raised when Marshal(String,Object) is used. (Inherited from Dart.Sockets.ComponentBase)
Top

See Also

Reference

Dns Class
Dart.Sockets Namespace


IPEndPoint Class Methods

[image]
PowerTCP Sockets for .NET
IPEndPoint Class Methods
See Also Send comments on this topic
Dart.Sockets Namespace : IPEndPoint Class

Glossary Item Box

For a list of all members of this type, see IPEndPoint members.

Public Methods

 | Name | Description
Public Method | Create | (Inherited from System.Net.IPEndPoint)
Public Method | Equals | (Inherited from System.Net.IPEndPoint)
Public Method | GetHashCode | (Inherited from System.Net.IPEndPoint)
Public Method | Serialize | (Inherited from System.Net.IPEndPoint)
Public Method | ToString | (Inherited from System.Net.IPEndPoint)
Top

See Also

Reference

IPEndPoint Class
Dart.Sockets Namespace


Ping Class Properties

[image]
PowerTCP Sockets for .NET
Ping Class Properties
See Also Send comments on this topic
Dart.Sockets Namespace : Ping Class

Glossary Item Box

For a list of all members of this type, see Ping members.

Public Properties

 | Name | Description
Public Property | Container | (Inherited from System.ComponentModel.Component)
Public Property | Encoding | Character encoding used by the component. (Inherited from Dart.Sockets.ComponentBase)
Public Property | Site | (Inherited from System.ComponentModel.Component)
Public Property | SynchronizingObject | Gets or sets the object used to marshal data to the UI thread (for raising events). (Inherited from Dart.Sockets.ComponentBase)
Public Property | SyncRoot | Gets an object that is used to synchronize access to the upper layer protocol in use. (Inherited from Dart.Sockets.ComponentBase)
Public Property | Tag | Gets or sets an object that stores any user data. (Inherited from Dart.Sockets.ComponentBase)
Top

Protected Properties

 | Name | Description
Protected Property | CanRaiseEvents | (Inherited from System.ComponentModel.Component)
Protected Property | DesignMode | (Inherited from System.ComponentModel.Component)
Protected Property | Events | (Inherited from System.ComponentModel.Component)
Top

See Also

Reference

Ping Class
Dart.Sockets Namespace


ProtocolException Class Events

[image]
PowerTCP Sockets for .NET
ProtocolException Class Events
See Also Send comments on this topic
Dart.Sockets Namespace : ProtocolException Class

Glossary Item Box

For a list of all members of this type, see ProtocolException members.

Protected Events

 | Name | Description
Protected Event | SerializeObjectState | Occurs when an exception is serialized to create an exception state object that contains serialized data about the exception. (Inherited from System.Exception)
Top

See Also

Reference

ProtocolException Class
Dart.Sockets Namespace


ProtocolException Class Methods

[image]
PowerTCP Sockets for .NET
ProtocolException Class Methods
See Also Send comments on this topic
Dart.Sockets Namespace : ProtocolException Class

Glossary Item Box

For a list of all members of this type, see ProtocolException members.

Public Methods

 | Name | Description
Public Method | GetBaseException | When overridden in a derived class, returns the System.Exception that is the root cause of one or more subsequent exceptions. (Inherited from System.Exception)
Public Method | GetObjectData | When overridden in a derived class, sets the System.Runtime.Serialization.SerializationInfo with information about the exception. (Inherited from System.Exception)
Public Method | GetType | Gets the runtime type of the current instance. (Inherited from System.Exception)
Public Method | ToString | Creates and returns a string representation of the current exception. (Inherited from System.Exception)
Top

See Also

Reference

ProtocolException Class
Dart.Sockets Namespace


ProtocolException Class Properties

[image]
PowerTCP Sockets for .NET
ProtocolException Class Properties
See Also Send comments on this topic
Dart.Sockets Namespace : ProtocolException Class

Glossary Item Box

For a list of all members of this type, see ProtocolException members.

Public Properties

 | Name | Description
Public Property | Data | Gets a collection of key/value pairs that provide additional user-defined information about the exception. (Inherited from System.Exception)
Public Property | HelpLink | Gets or sets a link to the help file associated with this exception. (Inherited from System.Exception)
Public Property | HResult | Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception. (Inherited from System.Exception)
Public Property | InnerException | Gets the System.Exception instance that caused the current exception. (Inherited from System.Exception)
Public Property | Message | Gets a message that describes the current exception. (Inherited from System.Exception)
Public Property | Source | Gets or sets the name of the application or the object that causes the error. (Inherited from System.Exception)
Public Property | StackTrace | Gets a string representation of the immediate frames on the call stack. (Inherited from System.Exception)
Public Property | TargetSite | Gets the method that throws the current exception. (Inherited from System.Exception)
Top

See Also

Reference

ProtocolException Class
Dart.Sockets Namespace


ProtocolException Constructor

[image]
PowerTCP Sockets for .NET
ProtocolException Constructor
See Also Send comments on this topic
Dart.Sockets Namespace > ProtocolException Class : ProtocolException Constructor

Glossary Item Box

Overload List

Overload | Description
ProtocolException Constructor | Initializes a new ProtocolException.

See Also

Reference

ProtocolException Class
ProtocolException Members


PtyBase Class Events

[image]
PowerTCP Sockets for .NET
PtyBase Class Events
See Also Send comments on this topic
Dart.Sockets Namespace : PtyBase Class

Glossary Item Box

For a list of all members of this type, see PtyBase members.

Public Events

 | Name | Description
Public Event | Data | Raised when Marshal(Data,String,Object) is used. (Inherited from Dart.Sockets.TcpBase)
Public Event | Disposed | (Inherited from System.ComponentModel.Component)
Public Event | Error | Raised when Marshal(Exception) is used or an unhandled Exception is thrown in a worker thread created using Start. (Inherited from Dart.Sockets.ComponentBase)
Public Event | Log | Raised when data is read or written. (Inherited from Dart.Sockets.TcpBase)
Public Event | StateChanged | Raised when the value of the State property changes. (Inherited from Dart.Sockets.TcpBase)
Public Event | UserState | Raised when Marshal(String,Object) is used. (Inherited from Dart.Sockets.ComponentBase)
Top

See Also

Reference

PtyBase Class
Dart.Sockets Namespace


PtyBase Class Methods

[image]
PowerTCP Sockets for .NET
PtyBase Class Methods
See Also Send comments on this topic
Dart.Sockets Namespace : PtyBase Class

Glossary Item Box

For a list of all members of this type, see PtyBase members.

Public Methods

 | Name | Description
Public Method | Abort | Performs a hard close of the connection. (Inherited from Dart.Sockets.TcpBase)
Public Method | AuthenticateAsClient | Overloaded. Authenticates the server when establishing a secure connection. (Inherited from Dart.Sockets.TcpBase)
Public Method | AuthenticateAsClientTaskAsync | Overloaded. Authenticates the server when establishing a secure connection. (Inherited from Dart.Sockets.TcpBase)
Public Method | AuthenticateAsServer | Authenticates a client when establishing a secure connection. (Inherited from Dart.Sockets.TcpBase)
Public Method | AuthenticateAsServerTaskAsync | Authenticates a client when establishing a secure connection. (Inherited from Dart.Sockets.TcpBase)
Public Method | Close | Gracefully closes the connection. (Inherited from Dart.Sockets.TcpBase)
Public Method | Connect | Connect to a server using the configuration specified by session. (Inherited from Dart.Sockets.TcpBase)
Public Method | ConnectAsync | Connect to a server using the configuration specified by session. (Inherited from Dart.Sockets.TcpBase)
Public Method | ConnectTaskAsync | Connect to a server using the configuration specified by session. (Inherited from Dart.Sockets.TcpBase)
Public Method | CreateObjRef | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from System.MarshalByRefObject)
Public Method | Deserialize | Deserialize a previously serialized object. (Inherited from Dart.Sockets.ComponentBase)
Public Method | Dispose | Overloaded. Disposes of TcpBase and its associated resources. (Inherited from Dart.Sockets.TcpBase)
Public Method | GetLifetimeService | Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | GetStream | Provides access to the underlying Stream. (Inherited from Dart.Sockets.TcpBase)
Public Method | InitializeLifetimeService | Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | Marshal | Overloaded. Marshals data to the UI thread. (Inherited from Dart.Sockets.TcpBase)
Public Method | Read | Overloaded. Receives data from the remote host. (Inherited from Dart.Sockets.TcpBase)
Public Method | ReadAsync | Start an asynchronous read on the socket. (Inherited from Dart.Sockets.TcpBase)
Public Method | ReadTaskAsync | Start an awaitable asynchronous read on the socket. (Inherited from Dart.Sockets.TcpBase)
Public Method | ReadToCount | Read until count bytes are read, an exception is thrown, or the connection is closed. (Inherited from Dart.Sockets.TcpBase)
Public Method | ReadToDelimiter | Overloaded. Read until the delimiter is found, an exception is thrown, or the connection is closed. (Inherited from Dart.Sockets.TcpBase)
Public Method | ReadToEnd | Read until the connection is closed or an exception is thrown. (Inherited from Dart.Sockets.TcpBase)
Public Method | Serialize | Serialize an object to the provided destination stream. (Inherited from Dart.Sockets.ComponentBase)
Public Method | ShutdownSsl | Signals the remote host to shutdown the SSL connection. (Inherited from Dart.Sockets.TcpBase)
Public Method | ToString | (Inherited from System.ComponentModel.Component)
Public Method | Write | Overloaded. Sends data to the remote host. (Inherited from Dart.Sockets.TcpBase)
Public Method | WriteAsync | Start an asynchronous write on the socket. (Inherited from Dart.Sockets.TcpBase)
Public Method | WriteTaskAsync | Start an awaitable asynchronous write on the socket. (Inherited from Dart.Sockets.TcpBase)
Top

Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from System.ComponentModel.Component)
Protected Method | GetService | (Inherited from System.ComponentModel.Component)
Protected Method | MemberwiseClone | Overloaded. Creates a shallow copy of the current System.MarshalByRefObject object. (Inherited from System.MarshalByRefObject)
Protected Method | OnData | Raises the Data event. (Inherited from Dart.Sockets.TcpBase)
Protected Method | OnError | Raises the Error event. (Inherited from Dart.Sockets.ComponentBase)
Protected Method | OnLog | Raises the Log event. (Inherited from Dart.Sockets.TcpBase)
Protected Method | OnStateChanged | Raises the StateChanged event. (Inherited from Dart.Sockets.TcpBase)
Protected Method | OnUserState | Raises the UserState event. (Inherited from Dart.Sockets.ComponentBase)
Top

See Also

Reference

PtyBase Class
Dart.Sockets Namespace


ServerSecurity Class Fields

[image]
PowerTCP Sockets for .NET
ServerSecurity Class Fields
See Also Send comments on this topic
Dart.Sockets Namespace : ServerSecurity Class

Glossary Item Box

For a list of all members of this type, see ServerSecurity members.

Public Fields

 | Name | Description
Public Field | ValidationCallback | The delegate that executes after the server provides its certificate to the client. (Inherited from Dart.Sockets.Security)
Top

See Also

Reference

ServerSecurity Class
Dart.Sockets Namespace


SocketBase Class Events

[image]
PowerTCP Sockets for .NET
SocketBase Class Events
See Also Send comments on this topic
Dart.Sockets Namespace : SocketBase Class

Glossary Item Box

For a list of all members of this type, see SocketBase members.

Public Events

 | Name | Description
Public Event | Disposed | (Inherited from System.ComponentModel.Component)
Public Event | Error | Raised when Marshal(Exception) is used or an unhandled Exception is thrown in a worker thread created using Start. (Inherited from Dart.Sockets.ComponentBase)
Public Event | UserState | Raised when Marshal(String,Object) is used. (Inherited from Dart.Sockets.ComponentBase)
Top

See Also

Reference

SocketBase Class
Dart.Sockets Namespace


Tcp Class Events

[image]
PowerTCP Sockets for .NET
Tcp Class Events
See Also Send comments on this topic
Dart.Sockets Namespace : Tcp Class

Glossary Item Box

For a list of all members of this type, see Tcp members.

Public Events

 | Name | Description
Public Event | Data | Raised when Marshal(Data,String,Object) is used. (Inherited from Dart.Sockets.TcpBase)
Public Event | Disposed | (Inherited from System.ComponentModel.Component)
Public Event | Error | Raised when Marshal(Exception) is used or an unhandled Exception is thrown in a worker thread created using Start. (Inherited from Dart.Sockets.ComponentBase)
Public Event | Log | Raised when data is read or written. (Inherited from Dart.Sockets.TcpBase)
Public Event | StateChanged | Raised when the value of the State property changes. (Inherited from Dart.Sockets.TcpBase)
Public Event | UserState | Raised when Marshal(String,Object) is used. (Inherited from Dart.Sockets.ComponentBase)
Top

See Also

Reference

Tcp Class
Dart.Sockets Namespace


Tcp Class Methods

[image]
PowerTCP Sockets for .NET
Tcp Class Methods
See Also Send comments on this topic
Dart.Sockets Namespace : Tcp Class

Glossary Item Box

For a list of all members of this type, see Tcp members.

Public Methods

 | Name | Description
Public Method | Abort | Performs a hard close of the connection. (Inherited from Dart.Sockets.TcpBase)
Public Method | AuthenticateAsClient | Overloaded. Authenticates the server when establishing a secure connection. (Inherited from Dart.Sockets.TcpBase)
Public Method | AuthenticateAsClientTaskAsync | Overloaded. Authenticates the server when establishing a secure connection. (Inherited from Dart.Sockets.TcpBase)
Public Method | AuthenticateAsServer | Authenticates a client when establishing a secure connection. (Inherited from Dart.Sockets.TcpBase)
Public Method | AuthenticateAsServerTaskAsync | Authenticates a client when establishing a secure connection. (Inherited from Dart.Sockets.TcpBase)
Public Method | Close | Gracefully closes the connection. (Inherited from Dart.Sockets.TcpBase)
Public Method | Connect | Connect to a server using the configuration specified by session. (Inherited from Dart.Sockets.TcpBase)
Public Method | ConnectAsync | Connect to a server using the configuration specified by session. (Inherited from Dart.Sockets.TcpBase)
Public Method | ConnectTaskAsync | Connect to a server using the configuration specified by session. (Inherited from Dart.Sockets.TcpBase)
Public Method | CreateObjRef | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from System.MarshalByRefObject)
Public Method | Deserialize | Deserialize a previously serialized object. (Inherited from Dart.Sockets.ComponentBase)
Public Method | Dispose | Overloaded. Disposes of TcpBase and its associated resources. (Inherited from Dart.Sockets.TcpBase)
Public Method | GetLifetimeService | Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | GetStream | Provides access to the underlying Stream. (Inherited from Dart.Sockets.TcpBase)
Public Method | InitializeLifetimeService | Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | Marshal | Overloaded. Marshals data to the UI thread. (Inherited from Dart.Sockets.TcpBase)
Public Method | Read | Overloaded. Receives data from the remote host. (Inherited from Dart.Sockets.TcpBase)
Public Method | ReadAsync | Start an asynchronous read on the socket. (Inherited from Dart.Sockets.TcpBase)
Public Method | ReadTaskAsync | Start an awaitable asynchronous read on the socket. (Inherited from Dart.Sockets.TcpBase)
Public Method | ReadToCount | Read until count bytes are read, an exception is thrown, or the connection is closed. (Inherited from Dart.Sockets.TcpBase)
Public Method | ReadToDelimiter | Overloaded. Read until the delimiter is found, an exception is thrown, or the connection is closed. (Inherited from Dart.Sockets.TcpBase)
Public Method | ReadToEnd | Read until the connection is closed or an exception is thrown. (Inherited from Dart.Sockets.TcpBase)
Public Method | Serialize | Serialize an object to the provided destination stream. (Inherited from Dart.Sockets.ComponentBase)
Public Method | ShutdownSsl | Signals the remote host to shutdown the SSL connection. (Inherited from Dart.Sockets.TcpBase)
Public Method | ToString | (Inherited from System.ComponentModel.Component)
Public Method | Write | Overloaded. Sends data to the remote host. (Inherited from Dart.Sockets.TcpBase)
Public Method | WriteAsync | Start an asynchronous write on the socket. (Inherited from Dart.Sockets.TcpBase)
Public Method | WriteTaskAsync | Start an awaitable asynchronous write on the socket. (Inherited from Dart.Sockets.TcpBase)
Top

Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from System.ComponentModel.Component)
Protected Method | GetService | (Inherited from System.ComponentModel.Component)
Protected Method | MemberwiseClone | Overloaded. Creates a shallow copy of the current System.MarshalByRefObject object. (Inherited from System.MarshalByRefObject)
Protected Method | OnData | Raises the Data event. (Inherited from Dart.Sockets.TcpBase)
Protected Method | OnError | Raises the Error event. (Inherited from Dart.Sockets.ComponentBase)
Protected Method | OnLog | Raises the Log event. (Inherited from Dart.Sockets.TcpBase)
Protected Method | OnStateChanged | Raises the StateChanged event. (Inherited from Dart.Sockets.TcpBase)
Protected Method | OnUserState | Raises the UserState event. (Inherited from Dart.Sockets.ComponentBase)
Top

See Also

Reference

Tcp Class
Dart.Sockets Namespace


Tcp Class Properties

[image]
PowerTCP Sockets for .NET
Tcp Class Properties
See Also Send comments on this topic
Dart.Sockets Namespace : Tcp Class

Glossary Item Box

For a list of all members of this type, see Tcp members.

Public Properties

 | Name | Description
Public Property | CloseTime | Returns the DateTime the connection was closed. (Inherited from Dart.Sockets.TcpBase)
Public Property | ConnectTime | Returns the DateTime the connection was established. (Inherited from Dart.Sockets.TcpBase)
Public Property | Container | (Inherited from System.ComponentModel.Component)
Public Property | CRLF | Set to true if the Pty property is used and a CR should be converted to a CRLF for sending. (Inherited from Dart.Sockets.PtyBase)
Public Property | Encoding | Character encoding used by the component. (Inherited from Dart.Sockets.ComponentBase)
Public Property | LocalEcho | Set to true if the Pty property is used and keystrokes should be displayed in the textbox. (Inherited from Dart.Sockets.PtyBase)
Public Property | NetworkStream | Returns the NetworkStream object created when Connect() is called. (Inherited from Dart.Sockets.TcpBase)
Public Property | Pty | Gets or sets a display control to use for automatic pseudo terminal support. (Inherited from Dart.Sockets.PtyBase)
Public Property | RemoteEndPoint | Gets the remote address and port of the connection. (Inherited from Dart.Sockets.TcpBase)
Public Property | Site | (Inherited from System.ComponentModel.Component)
Public Property | Socket | Gets the socket used by the component for communications. (Inherited from Dart.Sockets.SocketBase)
Public Property | SocketOption | Gets and sets the socket options for classes derived from TcpBase. (Inherited from Dart.Sockets.TcpBase)
Public Property | SslStream | Returns the SslStream object created when AuthenticateAsClient or AuthenticateAsServer are called. (Inherited from Dart.Sockets.TcpBase)
Public Property | State | Gets the status of the connection as of the last socket operation. (Inherited from Dart.Sockets.TcpBase)
Public Property | SynchronizingObject | Gets or sets the object used to marshal data to the UI thread (for raising events). (Inherited from Dart.Sockets.ComponentBase)
Public Property | SyncRoot | Gets an object that is used to synchronize access to the upper layer protocol in use. (Inherited from Dart.Sockets.ComponentBase)
Public Property | Tag | Gets or sets an object that stores any user data. (Inherited from Dart.Sockets.ComponentBase)
Top

Protected Properties

 | Name | Description
Protected Property | CanRaiseEvents | (Inherited from System.ComponentModel.Component)
Protected Property | DesignMode | (Inherited from System.ComponentModel.Component)
Protected Property | Events | (Inherited from System.ComponentModel.Component)
Top

See Also

Reference

Tcp Class
Dart.Sockets Namespace


Close Method

[image]
PowerTCP Sockets for .NET
Close Method
See Also Send comments on this topic
Dart.Sockets Namespace > TcpBase Class : Close Method

Glossary Item Box

Gracefully closes the connection.

Overload List

Overload | Description
Close | Gracefully closes the connection.

See Also

Reference

TcpBase Class
TcpBase Members


Udp Class Events

[image]
PowerTCP Sockets for .NET
Udp Class Events
See Also Send comments on this topic
Dart.Sockets Namespace : Udp Class

Glossary Item Box

For a list of all members of this type, see Udp members.

Public Events

 | Name | Description
Public Event | Disposed | (Inherited from System.ComponentModel.Component)
Public Event | Error | Raised when Marshal(Exception) is used or an unhandled Exception is thrown in a worker thread created using Start. (Inherited from Dart.Sockets.ComponentBase)
Public Event | UserState | Raised when Marshal(String,Object) is used. (Inherited from Dart.Sockets.ComponentBase)
Top

See Also

Reference

Udp Class
Dart.Sockets Namespace


Udp Class Properties

[image]
PowerTCP Sockets for .NET
Udp Class Properties
See Also Send comments on this topic
Dart.Sockets Namespace : Udp Class

Glossary Item Box

For a list of all members of this type, see Udp members.

Public Properties

 | Name | Description
Public Property | Container | (Inherited from System.ComponentModel.Component)
Public Property | Encoding | Character encoding used by the component. (Inherited from Dart.Sockets.ComponentBase)
Public Property | Site | (Inherited from System.ComponentModel.Component)
Public Property | Socket | Gets the socket used by the component for communications. (Inherited from Dart.Sockets.SocketBase)
Public Property | SocketOption | Gets the socket options for classes derived from UdpBase. (Inherited from Dart.Sockets.UdpBase)
Public Property | SynchronizingObject | Gets or sets the object used to marshal data to the UI thread (for raising events). (Inherited from Dart.Sockets.ComponentBase)
Public Property | SyncRoot | Gets an object that is used to synchronize access to the upper layer protocol in use. (Inherited from Dart.Sockets.ComponentBase)
Public Property | Tag | Gets or sets an object that stores any user data. (Inherited from Dart.Sockets.ComponentBase)
Top

Protected Properties

 | Name | Description
Protected Property | CanRaiseEvents | (Inherited from System.ComponentModel.Component)
Protected Property | DesignMode | (Inherited from System.ComponentModel.Component)
Protected Property | Events | (Inherited from System.ComponentModel.Component)
Top

See Also

Reference

Udp Class
Dart.Sockets Namespace


UdpBase Class Events

[image]
PowerTCP Sockets for .NET
UdpBase Class Events
See Also Send comments on this topic
Dart.Sockets Namespace : UdpBase Class

Glossary Item Box

For a list of all members of this type, see UdpBase members.

Public Events

 | Name | Description
Public Event | Disposed | (Inherited from System.ComponentModel.Component)
Public Event | Error | Raised when Marshal(Exception) is used or an unhandled Exception is thrown in a worker thread created using Start. (Inherited from Dart.Sockets.ComponentBase)
Public Event | UserState | Raised when Marshal(String,Object) is used. (Inherited from Dart.Sockets.ComponentBase)
Top

See Also

Reference

UdpBase Class
Dart.Sockets Namespace


Dart.Sockets Namespace (Dart.Sockets.45) Inheritance Hierarchy

Dart.Sockets Namespace (Dart.Sockets.45) Inheritance Hierarchy
See Also Send comments on this topic

Glossary Item Box

Inheritance Hierarchy

System.Object
Dart.Sockets.DnsSlave
Dart.Sockets.Echo
Dart.Sockets.MxHostEntry
Dart.Sockets.PingSlave
Dart.Sockets.Proxy
Dart.Sockets.Security
Dart.Sockets.ClientSecurity
Dart.Sockets.ServerSecurity
Dart.Sockets.Segment
Dart.Sockets.Data
Dart.Sockets.Datagram
Dart.Sockets.Session
Dart.Sockets.TcpSession
Dart.Sockets.SocketOption
Dart.Sockets.TcpSocketOption
Dart.Sockets.UdpSocketOption
System.EventArgs
Dart.Sockets.ConnectionsChangedEventArgs
Dart.Sockets.EchoEventArgs
Dart.Sockets.ErrorEventArgs
Dart.Sockets.UserStateEventArgs
Dart.Sockets.DataEventArgs
System.Exception
Dart.Sockets.DartLicenseException
System.ApplicationException
Dart.Sockets.DataException
Dart.Sockets.ProtocolException
System.MarshalByRefObject
System.ComponentModel.Component
Dart.Sockets.ComponentBase
Dart.Sockets.Dns
Dart.Sockets.Ping
Dart.Sockets.SocketBase
Dart.Sockets.Server
Dart.Sockets.TcpBase
Dart.Sockets.PtyBase
Dart.Sockets.Tcp
Dart.Sockets.UdpBase
Dart.Sockets.Udp
System.Net.EndPoint
System.Net.IPEndPoint
Dart.Sockets.IPEndPoint

See Also

Reference

Dart.Sockets.45 Assembly


PtyBase Class Events

[image]
PowerTCP Sockets for .NET
PtyBase Class Events
See Also Send comments on this topic
Dart.Sockets Namespace : PtyBase Class

Glossary Item Box

For a list of all members of this type, see PtyBase members.

Public Events

 | Name | Description
Public Event | Data | Raised when TcpBase.Marshal is used. (Inherited from Dart.Sockets.TcpBase)
Public Event | Disposed | (Inherited from System.ComponentModel.Component)
Public Event | Error | Raised when Marshal(Exception) is used or an unhandled Exception is thrown in a worker thread created using Start. (Inherited from Dart.Sockets.ComponentBase)
Public Event | Log | Raised when data is read or written. (Inherited from Dart.Sockets.TcpBase)
Public Event | StateChanged | Raised when the value of the State property changes. (Inherited from Dart.Sockets.TcpBase)
Public Event | UserState | Raised when Marshal(String,Object) is used. (Inherited from Dart.Sockets.ComponentBase)
Top

See Also

Reference

PtyBase Class
Dart.Sockets Namespace


PtyBase Class Methods

[image]
PowerTCP Sockets for .NET
PtyBase Class Methods
See Also Send comments on this topic
Dart.Sockets Namespace : PtyBase Class

Glossary Item Box

For a list of all members of this type, see PtyBase members.

Public Methods

 | Name | Description
Public Method | Abort | Performs a hard close of the connection. (Inherited from Dart.Sockets.TcpBase)
Public Method | AuthenticateAsClient | Overloaded. Authenticates the server when establishing a secure connection. (Inherited from Dart.Sockets.TcpBase)
Public Method | AuthenticateAsServer | Authenticates a client when establishing a secure connection. (Inherited from Dart.Sockets.TcpBase)
Public Method | Close | Gracefully closes the connection. (Inherited from Dart.Sockets.TcpBase)
Public Method | Connect | Connect to a server using the configuration specified by session. (Inherited from Dart.Sockets.TcpBase)
Public Method | ConnectAsync | Connect to a server using the configuration specified by session. (Inherited from Dart.Sockets.TcpBase)
Public Method | CreateObjRef | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from System.MarshalByRefObject)
Public Method | Deserialize | Deserialize a previously serialized object. (Inherited from Dart.Sockets.ComponentBase)
Public Method | Dispose | Overloaded. Disposes of TcpBase and its associated resources. (Inherited from Dart.Sockets.TcpBase)
Public Method | GetLifetimeService | Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | GetStream | Provides access to the underlying Stream. (Inherited from Dart.Sockets.TcpBase)
Public Method | InitializeLifetimeService | Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public Method | Marshal | Overloaded. Marshals data to the UI thread. (Inherited from Dart.Sockets.TcpBase)
Public Method | Read | Overloaded. Receives data from the remote host. (Inherited from Dart.Sockets.TcpBase)
Public Method | ReadAsync | Start an asynchronous read on the socket. (Inherited from Dart.Sockets.TcpBase)
Public Method | ReadToCount | Read until count bytes are read, an exception is thrown, or the connection is closed. (Inherited from Dart.Sockets.TcpBase)
Public Method | ReadToDelimiter | Overloaded. Read until the delimiter is found, an exception is thrown, or the connection is closed. (Inherited from Dart.Sockets.TcpBase)
Public Method | ReadToEnd | Read until the connection is closed or an exception is thrown. (Inherited from Dart.Sockets.TcpBase)
Public Method | Serialize | Serialize an object to the provided destination stream. (Inherited from Dart.Sockets.ComponentBase)
Public Method | ShutdownSsl | Signals the remote host to shutdown the SSL connection. (Inherited from Dart.Sockets.TcpBase)
Public Method | ToString | (Inherited from System.ComponentModel.Component)
Public Method | Write | Overloaded. Sends data to the remote host. (Inherited from Dart.Sockets.TcpBase)
Public Method | WriteAsync | Start an asynchronous write on the socket. (Inherited from Dart.Sockets.TcpBase)
Top

Protected Methods

 | Name | Description
Protected Method | Finalize | (Inherited from System.ComponentModel.Component)
Protected Method | GetService | (Inherited from System.ComponentModel.Component)
Protected Method | MemberwiseClone | Overloaded. Creates a shallow copy of the current System.MarshalByRefObject object. (Inherited from System.MarshalByRefObject)
Protected Method | OnData | Raises the TcpBase.Data event. (Inherited from Dart.Sockets.TcpBase)
Protected Method | OnError | Raises the Error event. (Inherited from Dart.Sockets.ComponentBase)
Protected Method | OnLog | Raises the TcpBase.Log event. (Inherited from Dart.Sockets.TcpBase)
Protected Method | OnStateChanged | Raises the TcpBase.StateChanged event. (Inherited from Dart.Sockets.TcpBase)
Protected Method | OnUserState | Raises the UserState event. (Inherited from Dart.Sockets.ComponentBase)
Top

See Also

Reference

PtyBase Class
Dart.Sockets Namespace


Tcp Class Events

[image]
PowerTCP Sockets for .NET
Tcp Class Events
See Also Send comments on this topic
Dart.Sockets Namespace : Tcp Class

Glossary Item Box

For a list of all members of this type, see Tcp members.

Public Events

 | Name | Description
Public Event | Data | Raised when TcpBase.Marshal is used. (Inherited from Dart.Sockets.TcpBase)
Public Event | Disposed | (Inherited from System.ComponentModel.Component)
Public Event | Error | Raised when Marshal(Exception) is used or an unhandled Exception is thrown in a worker thread created using Start. (Inherited from Dart.Sockets.ComponentBase)
Public Event | Log | Raised when data is read or written. (Inherited from Dart.Sockets.TcpBase)
Public Event | StateChanged | Raised when the value of the State property changes. (Inherited from Dart.Sockets.TcpBase)
Public Event | UserState | Raised when Marshal(String,Object) is used. (Inherited from Dart.Sockets.ComponentBase)
Top

See Also

Reference

Tcp Class
Dart.Sockets Namespace


Dart.Sockets Namespace (Dart.Sockets) Inheritance Hierarchy

Dart.Sockets Namespace (Dart.Sockets) Inheritance Hierarchy
See Also Send comments on this topic

Glossary Item Box

Inheritance Hierarchy

System.Object
Dart.Sockets.DnsSlave
Dart.Sockets.Echo
Dart.Sockets.MxHostEntry
Dart.Sockets.PingSlave
Dart.Sockets.Proxy
Dart.Sockets.Security
Dart.Sockets.ClientSecurity
Dart.Sockets.ServerSecurity
Dart.Sockets.Segment
Dart.Sockets.Data
Dart.Sockets.Datagram
Dart.Sockets.Session
Dart.Sockets.TcpSession
Dart.Sockets.SocketOption
Dart.Sockets.TcpSocketOption
Dart.Sockets.UdpSocketOption
System.EventArgs
Dart.Sockets.ConnectionsChangedEventArgs
Dart.Sockets.EchoEventArgs
Dart.Sockets.ErrorEventArgs
Dart.Sockets.UserStateEventArgs
Dart.Sockets.DataEventArgs
System.Exception
Dart.Sockets.DartLicenseException
System.ApplicationException
Dart.Sockets.DataException
Dart.Sockets.ProtocolException
System.MarshalByRefObject
System.ComponentModel.Component
Dart.Sockets.ComponentBase
Dart.Sockets.Dns
Dart.Sockets.Ping
Dart.Sockets.SocketBase
Dart.Sockets.Server
Dart.Sockets.TcpBase
Dart.Sockets.PtyBase
Dart.Sockets.Tcp
Dart.Sockets.UdpBase
Dart.Sockets.Udp
System.Net.EndPoint
System.Net.IPEndPoint
Dart.Sockets.IPEndPoint

See Also

Reference

Dart.Sockets Assembly


Licensing and Trial Operation

Licensing and Trial Operation
See Also Send comments on this topic

Glossary Item Box

Show Overview

  • Product installation includes a trial development license, valid for 30 days after the installation date.
  • With a valid trial development license, a 7-day runtime license is embedded into the application at compile-time. Rebuild the project to reset the 7-day limit.
  • The presence of a valid licenses.licx file in the project triggers generating and embedding the runtime license.
  • Installing a purchased development license on the development machine supercedes the trial license, and subsequently compiled applications are not limited to 7 days.
  • There are no special considerations for deploying .NET applications.

Show Licensing the Product

The Developer License

A Developer License is required to create a licensed application. Developer Licenses are specific to the user's development machine, and to the version of the Dart assembly.

Obtaining a Developer License

Run the included license activation utility, accessible from the Activate PowerTCP Sockets for .NET 4.5 shortcut in the product's Start Menu program group, and follow the instructions within. The utility will open a web browser and navigate to the Dart Customer Center to log into an existing account or register a new account. Once logged in, follow the instructions, and a license file will be emailed to you with instructions on where to place it. If an Internet connection is not available on the development machine, the utility provides a URL for activating the license on a machine with Internet access.

Developer License Installation

The Developer License file should be copied to the following location:

Program Files \ Dart \ PowerTCP Sockets for .NET \ 4.5 \ bin

This location is also accessible from the 'Binaries Folder' shortcut in the product's Start Menu program group.

At compile-time, the component will search this location for the Developer License. If a valid license is found, no trial messages will be displayed.

The Developer License should never be deployed with an application.

Versioning

Developer Licenses are version-specific. Each minor version of the product (for example, 4.0 and 4.1) requires a separate Developer License. Build updates to the product (for example, 4.0.0 and 4.0.1) do not require a new Developer License. Version upgrades are available to developers with an active subscription.

Developer License Filename

The Developer License filename has the following format:

Dart.Sockets.developer.dartlic

Application Licensing

The .licenses Resource

An <appname>.licenses resource containing license information is embedded into the developed assembly during compilation. This resource is read at runtime to confirm that the topmost managed assembly is licensed. A LicenseException is thrown if no license is found. To license intermediary assemblies, see the "Extended and ISV Licensing" section below.

The licenses.licx File

When a licensed control or component is added to a project using the Visual Studio designer, a licenses.licx text file is created (if one does not already exist) and added to the project. A single-line entry is added to the file, which includes the licensed Class (for example, "Dart.Sockets.Tcp"), the Assembly name (for example, "Dart.Sockets"), and some optional information such as Version Number. This file can be found in the Solution Explorer.

The presence of this licx file triggers the Microsoft license compiler utility (lc.exe) to create the .licenses resource during compilation.

Manual Creation of the licenses.licx

If the licenses.licx file does not exist in the project, or was not automatically updated (such as when a licensed component is instantiated in code), the licenses.licx entry must be added manually. If the licenses.licx file is not present in the project, add a new text file named "licenses.licx" to the project (not the solution) from the Solution Explorer. Add a single line to the licenses.licx that includes the fully-specified class name and the assembly name, separated by a comma. For example:

Dart.Sockets.Tcp, Dart.Sockets

Web Site Projects

Web Site projects include an App_Licenses.dll that must be rebuilt when changes are made to the licenses.licx file, or when a new Developer License has been installed. This is rebuilt by right-clicking on the licenses.licx file in the Solution Explorer, and selecting the "Rebuild Runtime Licenses" option.

Compilation Environments That Do Not Support the licenses.licx File, Like MONO

For compilation environments that do not recognize the licenses.licx file, the <appname>.licenses resource may be generated with the .NET or MONO lc.exe utility on a licensed machine and added to the project as an embedded resource, or linked during compilation using the appropriate resource switch.

Scripting Environments

For limited deployment, install and activate the product on each deployment platform. For mass-deployment, create a licensed wrapper assembly. See the "Extended and ISV Licensing" section below for licensing options for wrapper assemblies.

Troubleshooting

LicenseExceptions thrown by the executing application should provide detailed information regarding the problem causing the exception.

In addition, the product utilizes the system's Application Event log, under the "Dart Components" source (or the ".NET Runtime" source, if the "Dart Components" log could not be created).

Important!!!

  • The license resource must be for the Entry (topmost managed) Assembly (exe or dll).
  • Cases in which the Entry Assembly is not the topmost executing application are considered "Plug-In" scenarios and require an Extended or ISV Distribution License (see below for more details).

Extended and ISV Licensing

Please contact Dart Sales for information on Extended and ISV licensing options.

Extended Distribution License

The Extended Distribution License is available for the development of software to be used by an executing assembly that does not contain or allow inspection of a Dart license resource. This is typically a dll that exposes a programming interface and can therefore be used as a development tool. This includes, but is not limited to, the following scenarios:

  • Creation of a dll that can be used by other software developers as a development tool
  • Creation of a plug-in dll that can be used by existing 3rd-party application(s)
  • Creation of a dll that provides a COM interface to a VB6 application or VBA
  • Creation of an exe that exposes a class that is used to access product functionality
  • Creation of a dll that can be used by a scripting application
  • Creation of an application utilizing the Dart assembly in a child Application Domain

ISV Distribution License

For Independent Software Developers (ISVs) or Enterprises who wish to bypass all licensing mechanisms, Dart offers the ISV Distribution License. The ISV license permits the tight integration of Dart source code directly into a library or application.

Show Trial Operation

At Runtime

Applications compiled with a trial development license will periodically show a trial message, and expire seven days after compilation.

7-Day Trial

An application compiled with a trial development license can be deployed to other platforms for testing, and will expire after 7 days.

  • No messages are shown during the first 4 days.
  • After 4 days, the user is informed of the number of days until the trial runtime license expires.
  • After 7 days, the user is informed that the trial runtime license has expired. The application will cease functioning and throw a License Exception when used.
  • The trial runtime license can be reset by recompiling the application.

Trial Messages

  • Trial messages and exceptions will always appear in the system's Application event log under the "Dart Components" source (or the ".NET Runtime" source, if the "Dart Components" log could not be created).
  • A trial message will also appear in a MessageBox, if the environment is capable of showing MessageBoxes.
  • Components used in ASP.NET applications will show trial messages or exceptions in client-side alert boxes when possible.

Important!!!

For environments without an active desktop (for example, under some Windows service and web application scenarios), examine the Application event log for trial messages and exceptions.

With the exception of the trial messages and trial runtime license expiration exceptions, runtime trial operation is the same as licensed operation. The same dll is used for both trial and licensed operation.

During Development

A trial message is always displayed when a 7-Day trial runtime license is created.

See Also

Dns Component
Ping Component
Server Component
Tcp Component
Udp Component