Readme 213-323-03 September 2007 Eiconcard X.25 Winsock Service Provider Introduction ====================================================================== This Readme contains information relevant to the use of this product along with the install and uninstall procedures for the Eiconcard X.25 Winsock Service Provider. Installing ====================================================================== The Eiconcard X.25 Winsock Service Provider is now part of the Eiconcard Connections For Windows software package and is automatically installed. A separate installation is no longer required. In order to compile the sample provided, the entire Winsock\Win32 folder on the Eiconcard Development Suite CD can be copied to a folder of your choice on the target system. In order to ensure that the sample compiles without changes, the relative directory relationship must be maintained. Using the Eiconcard X.25 Winsock Service Provider Sample Application (WS2X25A.EXE) ====================================================================== The usage of this sample conforms to the Microsoft Winsock 2 API set. Refer to the Windows Winsock 2 API definitions for further details on these functions. Menu item descriptions ---------------------- This section describes each of the supported Winsock APIs presented on the Eiconcard X.25 Winsock Service Provider Sample Application's (WS2X25A.EXE) menu bar Winsock Startup -Initiates the use of the ECWS2X25.DLL per process Cleanup - Terminates the use of the ECWS2X25.DLL per process Socket Create - Creates a Windows Socket using Socket WSASocket - Creates a Windows Socket using WSASocket Bind - Associates a local address with a socket Close - Closes a existing socket Socket Name - Retrieves the local name for a socket Peer Name - Retrieves the peer name to which a socket is connected Connection Connect - Establishes a connection to a specified socket WSAConnect - Establishes a connection to a specified socket Listen - Places a socket in a state of listening for a connection Accept - Permits an incoming connection attempt on a socket WSAAccept - Permits an incoming connection attempt on a socket Shutdown - Disables sends or receives on a socket Data Send - Sends data on a connected socket WSASend - Sends data on a connected socket Send Disconnect - Initiates termination of the connection for the socket Receive - Receives data on a connected socket WSARecv - Receives data on a connected socket Receive Disconnect - Terminates reception on a socket Select WSAAsyncSelect - Requests notification of network events on a socket Select - Determines the status of one or more sockets Events WSAACreateEvent - Creates a new event object WSAEventSelect - Specifies an object to be associated with network events WSAEnumNetworkEvents - Discovers occurrences of network events for a socket WSAResetEvent - Resets the state of the specified event object WSASetEvent - Sets the state of the specified event object WSAWaitforMultipleEvents - Returns when one or more of the event objects are signaled WSACloseEvent - Closes an open event object handle Name WSAAddresstoString - Converts all components of SOCKADDR to a readable string WSAStringtoAddress - Converts a numeric string to a SOCKADDR struct Tools Get Option - Retrieves a socket option Set Option - Sets a socket option Ioctl - Controls the I/O mode of a socket WSAIoctl - Controls the mode of a socket Memory Fault - Crashes the application Test This command allows you to run some simple Asynchronous, Events, Overlapped I/O or Blocking tests. You can make use of the preconfigured test scenarios, for different completion modes, to establish client/server X.25 connections using the Eiconcard X.25 Winsock Service Provider to transfer a configured amount of packets. To run any of these tests, you first need to have an Eiconcard installed and configured in your system, such that the HDLC link level is established. You can run these tests in a back-to-back configuration on 1 or 2 systems, or over an X.25 Network where both sides are using the Eiconcard X.25 Winsock Service Provider Sample Application (WS2X25A.EXE). Refer to your Eiconcard Connections Software documentation for instructions on how to install and configure your Eiconcard. You can verify that the HDLC link level is established on your Eiconcard by running "ecmodule status hdlc /p portnumber" from a command prompt and checking that the protocol and link states are both "opened". Once the HDLC level is established, follow these steps to run any tests. 1. Start 2 instances of WS2X25A.EXE. 2. Using the Test menu entries, start a server for the mode you want to test and specify the port on which to listen. 3. Start a corresponding client in the other window. - Specify the port on which to call - Specify the server side's DTE address for your remote address - Specify the number of packets to send in the Nb Packets field. This will send the amount of packets you set in the client dialog box. Running manual data transfers between Client/Server sessions ------------------------------------------------------------ To run manual data transfers using some of the APIs supported in the Eiconcard X.25 Winsock Service Provider Sample Application (WS2X25A.EXE), follow the steps for the SERVER and CLIENT sides below: NOTE: This example uses one, two-port Eiconcard (e.g., S94 8MB) in a back-to-back configuration. However, this same example can be implemented using two systems or with two single-port Eiconcards on the same system. The statements shown below may differ slightly if using two systems. The syntax "MenuName > MenuItem" is used in the steps that follow. 1. Start two instances of the Eiconcard X.25 Winsock Service Provider Sample Application (WS2X25A.EXE). For the purposes of this example, one application will be identified as SERVER and the other as CLIENT. It does not matter which application you choose for either role. 2. Execute the following on the SERVER: a) Winsock > Startup -Initiates the use of the ECWS2X25.DLL b) Socket > WSASocket -Creates a Windows Socket c) Socket > Bind d) Specify the port on which the SERVER will listen. e) Specify a Local DTE Address. f) Click OK. g) Connection > Listen -Places the socket in a state of listening NOTE: At this point, "ecmodule status" should show a LISTENING state connection on the specified port. 3. Execute the following on the CLIENT: a) Winsock > Startup -Initiates the use of the ECWS2X25.DLL b) Socket > WSASocket -Creates a Windows Socket c) Connection > WSAConnect d) Specify the port on which the CLIENT will call. e) Specify The DTE address you defined for the SERVER in as the Remote address. f) Click OK. 4. Execute the following on the SERVER: a) Connection > WSAAccept -Accepts the connection attempt b) Click Yes to accept the connection NOTE: The WS2X25A sample will create another socket on which to manage the connection and another listen will be submitted on the original socket. NOTE: At this point "ecmodule status" should show two CONNECTED state connections and one LISTENING state connection as a listen is resubmitted automatically. c) Data > WSARecv - Receives the data d) Do not change the default values. e) Click Receive 5. Execute the following on the CLIENT: a) Data > WSASend - Sends some data b) Enter some data in the first buffer c) Click Send. The CLIENT main window should show the number of bytes sent. 6. Execute the following on the SERVER: a) The SERVER main window should show the number of bytes received as well as the buffer contents. b) Data > WSARecv c) Click Receive -It is good programming practice to always be ready to receive any incoming data 7. Execute the following on the CLIENT: a) Click Close in the WSASend dialog box b) Socket > Close -Closes the socket c) Winsock > Cleanup -Terminates the use of the ECWS2X25.DLL 8. Execute the following on the SERVER: a) The SERVER main window should indicate that the connection has been reset by the CLIENT side (WSAECONNRESET). b) Click Close in the WSARecv dialog box c) Socket > Close -Closes the socket NOTE: At this point "ecmodule status" should not show any CONNECTED state connections and only one LISTENING state connection. d) Socket > Close -Closes the listening socket NOTE: At this point "ecmodule status" should no longer show any LISTENING state connections. e) Winsock > Cleanup -Terminates the use of the ECWS2X25.DLL ############################# 213-323-03 ############################# Copyright(c) 1999-2007 Dialogic Corporation