beautypg.com

Solvline PB2xxxUG User Manual

Page 98

background image

Receive()------- Wait until the server requests a sendto.

3) Operation Environment

O/S : Windows 95/98/2000/XP
Tool : Microsoft Visual C++ 5.0 or higher

4)

Result (Active programming)

If the user enters the IP address of a specific Portbase and clicks “Connect”, the message “This is
LoopBack Data!” is transmitted at 3 second intervals and the received data will be displayed.

5) How to Run

Plug the loopback connector to the first serial port of Portbase. (The port is connected to the

socket 4001.)

Run the program and the following screen appears.

Enter the Portbase IP address you want to connect to and click “Connect”.
If the connection is successfully completed, the message “Connected “will be displayed.
“This is LoopBack Data!“ is repeatedly displayed at 3 sec. intervals on the edit box.

6) Source Code

Declare the client socket to be connected to the server and the variable to save the IP

address entered by the user in SockExamDlg.h as follows.

class CSockExamDlg : public CDialog

{

98