DEFINE CLASS form1 AS form Top = 0 Left = 0 Height = 99 Width = 573 DoCreate = .T. Caption = "Server" Name = "Form1" ADD OBJECT olecontrol1 AS olecontrol WITH ; Top = 12, ; Left = 12, ; Height = 100, ; Width = 100, ; Name = "Olecontrol1" ADD OBJECT label1 AS label WITH ; WordWrap = .T., ; Caption = "", ; Height = 36, ; Left = 156, ; Top = 12, ; Width = 384, ; Name = "Label1" ADD OBJECT olecontrol2 AS olecontrol WITH ; Top = 60, ; Left = 12, ; Height = 100, ; Width = 100, ; Name = "Olecontrol2" ADD OBJECT label2 AS label WITH ; Caption = "State:", ; Height = 24, ; Left = 48, ; Top = 12, ; Width = 60, ; Name = "Label2" ADD OBJECT label3 AS label WITH ; Caption = "Bytes Received:", ; Height = 17, ; Left = 48, ; Top = 72, ; Width = 180, ; Name = "Label3" PROCEDURE Init With THISFORM.Olecontrol1.Object .LocalPort = 1001 && or whatever port you want to listen to .Listen Endwith ENDPROC PROCEDURE olecontrol1.Error *** ActiveX Control Event *** LPARAMETERS number, description, scode, source, helpfile, helpcontext, canceldisplay wait window 'Server Error'+chr(13)+'Error: ' + transform(number)+chr(13)+'Description: ' + description ENDPROC PROCEDURE olecontrol1.ConnectionRequest *** ActiveX Control Event *** LPARAMETERS requestid With THISFORM .Olecontrol2.Accept(requestid) .Label2.Caption = 'State: ' + transform(.Olecontrol2.State) Endwith ENDPROC PROCEDURE olecontrol2.Error *** ActiveX Control Event *** LPARAMETERS number, description, scode, source, helpfile, helpcontext, canceldisplay wait window 'Server Error'+chr(13)+'Error: ' + transform(number)+; chr(13)+'Description: ' + description ENDPROC PROCEDURE olecontrol2.DataArrival *** ActiveX Control Event *** LPARAMETERS bytestotal local lcdata lcdata = "" THISFORM.Label3.Caption = 'Bytes received: '+transform(bytestotal) THIS.GetData(@lcdata) THISFORM.Label1.Caption = lcdata ENDPROC PROCEDURE olecontrol2.Close *** ActiveX Control Event *** THIS.Close ENDPROC PROCEDURE olecontrol2.Destroy THIS.Close ENDPROC ENDDEFINEThe code above was generated by the Class browser from a Listener form I created. The OleControls were MSWinsock controls dropped onto the form.