Namespace: OpenEdge.Net.ServerConnection
Class
ClientSocket
Parent classes:
Inherits: Progress.Lang.Object
Implements: OpenEdge.Core.ServerConnection.IServerConnection, OpenEdge.Logging.ISupportLogging

Copyright (c) 2014-2017 by Progress Software Corporation. All rights reserved.
File:ClientSocket
Description:An implementation of a client socket
Author(s):pjudge
Created:Tue Nov 25 09:13:36 EST 2014




Method Summary
Options Name Purpose
Connect () /** Connect to the server specified, based on existing ConnectionParameters */
Connect (ClientSocketConnectionParameters) /** Connect to the server specified, based on passed-in Connection Parameters @param ClientSocketConnectionParameters Connection information for the connection. */
Connect (URI) /** Connect to the server specified, based on passed-in URI @param URI Connection information for the connection. */
CreateServer () /** Creates a server object (ie this-object:Server). This is separated from the Connect/Disconnect pair of methods so that one server can be connected and disconnected multiple time. */
DestroyServer () /** Destroys the server object (ie this-object:Server). This is separated from the Connect/Disconnect pair of methods so that one server can be connected and disconnected multiple time. */
Disconnect () /** Disconnect from the server, if connected */
LOGICAL IsConnected () /* Indicated whether we have a connection @return logical TRUE is the socket is connected; false otherwise */
OnDataReceived (SocketReadEventArgs) /** Publishes the DataReceived event. @param SocketReadEventArgs Arguments for this event */
OnReadTerminated (SocketReadEventArgs) /** Publishes the ReadTerminated event. @param EventArgs Arguments for this event */
OnReadTimeout (SocketReadEventArgs) /** Publishes the ReadTimeout event. @param EventArgs Arguments for this event */
ReadResponseHandler () /** Callback/event procedure fired on the READ-RESPONSE event of the socket. */
SetSocketOptions (handle) /* Sets the various socket options, per this object's properties. @param handle The socket on which to set these options */
WaitForResponse () /** Waits for a response from a write event on the socket with a no timeout. Uses the default timeout, which is none/zero */
WaitForResponse (decimal) /** Waits for a response from a write event on the socket. Polls (ie loops) for a response @param decimal A timeout value for read events in seconds. A zero value means no timeout. */
WaitForResponseAsync (decimal) /** Waits for a response from a write event on the socket. Uses a WAIT-FOR loop to emulate/provide async. @param decimal A timeout value for read events in seconds. A zero value means no timeout. */
WriteData (Memptr) /** Writes data to the connected server. @param Memptr The data to be written to the socket. */

Constructor Summary
Options Name Purpose
ClientSocket () /** Default constructor. Connection parameters can be specified via the Connnect() method. */
ClientSocket (ClientSocketConnectionParameters) /** Constructor. @param ClientSocketConnectionParameters A URI and other parameters that this socket will connect to. */

Event Summary
Options Name Purpose
DataReceived (ClientSocket, SocketReadEventArgs) /** Event fired when a chunk of data is received from the socket */
ReadTerminated (ClientSocket, SocketReadEventArgs) /** Fired when a read is terminated for an reason (socket disconnect, no data etc) */
ReadTimeout (ClientSocket, SocketReadEventArgs) /** Fired when a read times out (optional based on a timeout) */

Property Summary
Options Name Purpose
LOGICAL Connected /** Returns true if the server is valid and connected. False otherwise */
OpenEdge.Core.ServerConnection.IConnectionParameters ConnectionParameters
INTEGER DefaultReadTimeout /** The default timeout while waiting for the sockets to return reads. Defaults to 'never' (zero). */
LOGICAL KeepAlive /** Sets the TCP socket option SO_KEEPALIVE. Set arguments to TRUE to turn this option on or to FALSE to turn it off. */
INTEGER LingerTime /** Sets the TCP socket option SO-LINGER. Returns ? if the SO-LINGER option is not enabled, or if the socket is not yet created. Setting this property to ? disables the SO-LINGER option. */
OpenEdge.Logging.ILogWriter Logger
LOGICAL NoDelay /** Sets the TCP socket option TCP-NODELAY */
INTEGER ReadBufferSize /** The size of the data buffer read from the socket on notification, in bytes. The socket may have less than this amount available, and will only populate what it has. Defaults to 8k (per suggestions at http://stackoverflow.com/questions/2811006/what-is-a-good-buffer-size-for-socket-programming) */
INTEGER ReceiveBufferSize /** Sets the TCP socket option SO-RCVBUF. Set arguments to the desired size of the buffer */
INTEGER ReceiveTimeout /** Sets the TCP socket option SO-RCVTIMEO. Sets the timeout length—that is, the number of seconds the socket waits to receive data before timing out. */
LOGICAL ReuseAddress /** Sets the TCP socket option SO-REUSEADDR */
INTEGER SendBufferSize /** Sets the TCP socket option SO-SNDBUF. Set arguments to the desired size of the buffer */
Progress.Lang.Object Server


Method Detail
Top

Connect ()

Purpose: Connect to the server specified, based on existing ConnectionParameters
Top

Connect (ClientSocketConnectionParameters)

Purpose: Connect to the server specified, based on passed-in Connection Parameters
Parameters:
poParams OpenEdge.Net.ServerConnection.ClientSocketConnectionParameters
Top

Connect (URI)

Purpose: Connect to the server specified, based on passed-in URI
Parameters:
poURI OpenEdge.Net.URI
Top

CreateServer ()

Purpose: Creates a server object (ie this-object:Server). This is separated
from the Connect/Disconnect pair of methods so that one server can
be connected and disconnected multiple time.
Top

DestroyServer ()

Purpose: Destroys the server object (ie this-object:Server). This is separated
from the Connect/Disconnect pair of methods so that one server can
be connected and disconnected multiple time.
Top

Disconnect ()

Purpose: Disconnect from the server, if connected
Top

LOGICAL IsConnected ()

/* Indicated whether we have a connection
Returns LOGICAL
logical TRUE is the socket is connected; false otherwise
Top

OnDataReceived (SocketReadEventArgs)

Purpose: Publishes the DataReceived event.
Parameters:
poEventArgs OpenEdge.Net.ServerConnection.SocketReadEventArgs
Top

OnReadTerminated (SocketReadEventArgs)

Purpose: Publishes the ReadTerminated event.
Parameters:
poEventArgs OpenEdge.Net.ServerConnection.SocketReadEventArgs
Top

OnReadTimeout (SocketReadEventArgs)

Purpose: Publishes the ReadTimeout event.
Parameters:
poEventArgs OpenEdge.Net.ServerConnection.SocketReadEventArgs
Top

ReadResponseHandler ()

Purpose: Callback/event procedure fired on the READ-RESPONSE event of the
socket.
Top

SetSocketOptions (handle)

/* Sets the various socket options, per this object's properties.
Parameters:
phSocket HANDLE
Top

WaitForResponse ()

Purpose: Waits for a response from a write event on the socket with a
no timeout. Uses the default timeout, which is none/zero
Top

WaitForResponse (decimal)

Purpose: Waits for a response from a write event on the socket. Polls
(ie loops) for a response
value means no timeout.
Parameters:
pdTimeout DECIMAL
Top

WaitForResponseAsync (decimal)

Purpose: Waits for a response from a write event on the socket. Uses a WAIT-FOR loop
to emulate/provide async.
value means no timeout.
Parameters:
pdTimeout DECIMAL
Top

WriteData (Memptr)

Purpose: Writes data to the connected server.
Parameters:
poData OpenEdge.Core.Memptr


Constructor Detail
Top

ClientSocket ()

Purpose: Default constructor. Connection parameters can be specified via the
Connnect() method.
Top

ClientSocket (ClientSocketConnectionParameters)

Purpose: Constructor.
this socket will connect to.
Parameters:
poConnectionParameters OpenEdge.Net.ServerConnection.ClientSocketConnectionParameters


Event Detail
Top

DataReceived (ClientSocket, SocketReadEventArgs)

Purpose: Event fired when a chunk of data is received from the socket
Parameters:
poSender OpenEdge.Net.ServerConnection.ClientSocket
poEventArgs OpenEdge.Net.ServerConnection.SocketReadEventArgs
Top

ReadTerminated (ClientSocket, SocketReadEventArgs)

Purpose: Fired when a read is terminated for an reason (socket disconnect, no data etc)
Parameters:
poSender OpenEdge.Net.ServerConnection.ClientSocket
poEventArgs OpenEdge.Net.ServerConnection.SocketReadEventArgs
Top

ReadTimeout (ClientSocket, SocketReadEventArgs)

Purpose: Fired when a read times out (optional based on a timeout)
Parameters:
poSender OpenEdge.Net.ServerConnection.ClientSocket
poEventArgs OpenEdge.Net.ServerConnection.SocketReadEventArgs


Property Detail
Top

LOGICAL Connected

Purpose: Returns true if the server is valid and connected. False otherwise
Returns LOGICAL
Top

OpenEdge.Core.ServerConnection.IConnectionParameters ConnectionParameters

Returns OpenEdge.Core.ServerConnection.IConnectionParameters
Top

INTEGER DefaultReadTimeout

Purpose: The default timeout while waiting for the sockets to return reads.
Defaults to 'never' (zero).
Returns INTEGER
Top

LOGICAL KeepAlive

Purpose: Sets the TCP socket option SO_KEEPALIVE.
Set arguments to TRUE to turn this option on or to FALSE to turn it off.
Returns LOGICAL
Top

INTEGER LingerTime

Purpose: Sets the TCP socket option SO-LINGER.
Returns ? if the SO-LINGER option is not enabled, or if the socket is not
yet created.
Setting this property to ? disables the SO-LINGER option.
Returns INTEGER
Top

OpenEdge.Logging.ILogWriter Logger

Returns OpenEdge.Logging.ILogWriter
Top

LOGICAL NoDelay

Purpose: Sets the TCP socket option TCP-NODELAY
Returns LOGICAL
Top

INTEGER ReadBufferSize

Purpose: The size of the data buffer read from the socket on notification, in bytes.
The socket may have less than this amount available, and will only
populate what it has.
Defaults to 8k (per suggestions at
http://stackoverflow.com/questions/2811006/what-is-a-good-buffer-size-for-socket-programming)
Returns INTEGER
Top

INTEGER ReceiveBufferSize

Purpose: Sets the TCP socket option SO-RCVBUF.
Set arguments to the desired size of the buffer
Returns INTEGER
Top

INTEGER ReceiveTimeout

Purpose: Sets the TCP socket option SO-RCVTIMEO.
Sets the timeout length—that is, the number of seconds the socket waits
to receive data before timing out.
Returns INTEGER
Top

LOGICAL ReuseAddress

Purpose: Sets the TCP socket option SO-REUSEADDR
Returns LOGICAL
Top

INTEGER SendBufferSize

Purpose: Sets the TCP socket option SO-SNDBUF.
Set arguments to the desired size of the buffer
Returns INTEGER
Top

Progress.Lang.Object Server

Returns Progress.Lang.Object


Copyright © 2017 Progress Software Corporation. All rights Reserved.

Progress® OpenEdge® Release 11.7