Hi,
I get a GPF when I try and do a:
oSocket = TSocket():New( 2000 )
I am working with the sockcli.prg program from the \FWPPC\Samples folder.
What can be causing this error?
#include "Fwce.ch"
STATIC oWnd, oSocket, cTitle:="Socket Test"
STATIC cSat, cHR, oTmr
Function Main()
LOCAL oBtn
DEFINE WINDOW oWnd TITLE cTitle
@ 1,1 BUTTON oBtn PROMPT "Connect" SIZE 75,25 ACTION Connect()
ACTIVATE WINDOW oWnd
Return Nil
Function Connect()
oSocket = TSocket():New( 2000 ) //Generates a GPF Here
oSocket:bRead = { | oSocket | oSocket:GetData }
oSocket:bConnect = { || oWnd:SetText( "Connected!" ) }
oSocket:bClose = { || MsgInfo( "Server has closed!" ) }
oSocket:Connect( "127.0.0.1" )
DEFINE TIMER oTmr INTERVAL 1000 of oWnd ACTION GetOxData()
ACTIVATE TIMER oTmr
return nil
Function GetOxData()
cSat := PADL( ALLTRIM(STR( ABS(HB_RandomInt( 85, 100 ) ) ) ),3," ")
cHR := PADL( ALLTRIM(STR( ABS(HB_RandomInt( 75, 150 ) ) ) ),3, " ")
SendOx( cSat, cHR )
Return Nil
Function SendOx(cSat, cHR )
oSocket:SendData( "MSG "+cSat+" "+cHR)
Return Nil
oSocket:bRead = { | oSocket | oSocket:GetData }
oSocket:bRead = { | oSocket | oSocket:GetData() }
oSocket:bRead = { | oSocket | oSocket:GetData() }
Function Connect()
oSocket = TSocket():New( 2000 ) //Generates a GPF Here
oSocket:bRead = { | oSocket | oSocket:GetData }
oSocket:bConnect = { || oWnd:SetText( "Connected!" ) }
oSocket:bClose = { || MsgInfo( "Server has closed!" ) }
oSocket:Connect( "127.0.0.1" )
DEFINE TIMER oTmr INTERVAL 1000 of oWnd ACTION GetOxData()
ACTIVATE TIMER oTmr
return nil
Function Connect()
memvar oSocket
oSocket = TSocket():New( 2000 )
oSocket:bRead = { | oSocket | OnRead( ) }
oSocket:bConnect = { | oSocket | OnConnect( ) }
oSocket:bClose = { | oSocket | OnClose( ) }
oSocket:Cargo := ST_COMMAND
oSocket:Connect( "192.168.1.2",2000 ) // server IP adres
Return nil
******************************
Function OnConnect( )
memvar lConnect,oWnd
lConnect := .T.
oWnd:SetText("Connect")
Return nil
**********************
function OnClose( )
memvar oSocket,lConnect
do case
case oSocket:Cargo == ST_SENDFILE
fclose( oSocket:hFile )
endcase
lConnect := .F.
oSocket:End()
return nil
Return to FiveWin for Pocket PC
Users browsing this forum: No registered users and 12 guests