Sockets
- Jeff Barnes
- Posts: 933
- Joined: Sun Oct 09, 2005 1:05 pm
- Location: Ontario, Canada
- Contact:
Sockets
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?
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?
Thanks,
Jeff Barnes
(FWH 16.11, xHarbour 1.2.3, Bcc730)
Jeff Barnes
(FWH 16.11, xHarbour 1.2.3, Bcc730)
- Antonio Linares
- Site Admin
- Posts: 42425
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 15 times
- Been thanked: 48 times
- Contact:
- Jeff Barnes
- Posts: 933
- Joined: Sun Oct 09, 2005 1:05 pm
- Location: Ontario, Canada
- Contact:
Re: Sockets
Hi Antonio,
Yes, I have a window. In the window I click a button to activate the connection.
Here is the test code:
Yes, I have a window. In the window I click a button to activate the connection.
Here is the test code:
Code: Select all | Expand
#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
Thanks,
Jeff Barnes
(FWH 16.11, xHarbour 1.2.3, Bcc730)
Jeff Barnes
(FWH 16.11, xHarbour 1.2.3, Bcc730)
- Antonio Linares
- Site Admin
- Posts: 42425
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 15 times
- Been thanked: 48 times
- Contact:
- Jeff Barnes
- Posts: 933
- Joined: Sun Oct 09, 2005 1:05 pm
- Location: Ontario, Canada
- Contact:
Re: Sockets
From the "About Screen" on my mobile device:
Windows Mobile 6.5 Professional
CE OS 5.2.23090 (Build 23090.5.3.0)
Windows Mobile 6.5 Professional
CE OS 5.2.23090 (Build 23090.5.3.0)
Thanks,
Jeff Barnes
(FWH 16.11, xHarbour 1.2.3, Bcc730)
Jeff Barnes
(FWH 16.11, xHarbour 1.2.3, Bcc730)
- Carles
- Posts: 1149
- Joined: Fri Feb 10, 2006 2:34 pm
- Location: Barcelona
- Been thanked: 6 times
- Contact:
Re: Sockets
Jeff,
No sera esta linea ?
Q te faltan los parentesis de funcion ?
No sera esta linea ?
oSocket:bRead = { | oSocket | oSocket:GetData }
Q te faltan los parentesis de funcion ?
Code: Select all | Expand
oSocket:bRead = { | oSocket | oSocket:GetData() }
Salutacions, saludos, regards
"...programar es fácil, hacer programas es difícil..."
UT Page -> https://carles9000.github.io/
Forum UT -> https://discord.gg/bq8a9yGMWh
Skype -> https://join.skype.com/cnzQg3Kr1dnk
"...programar es fácil, hacer programas es difícil..."
UT Page -> https://carles9000.github.io/
Forum UT -> https://discord.gg/bq8a9yGMWh
Skype -> https://join.skype.com/cnzQg3Kr1dnk
- Carles
- Posts: 1149
- Joined: Fri Feb 10, 2006 2:34 pm
- Location: Barcelona
- Been thanked: 6 times
- Contact:
Re: Sockets
Jeff
Sorry, i know... in english
Can u try ?
Sorry, i know... in english
Can u try ?
Code: Select all | Expand
oSocket:bRead = { | oSocket | oSocket:GetData() }
Salutacions, saludos, regards
"...programar es fácil, hacer programas es difícil..."
UT Page -> https://carles9000.github.io/
Forum UT -> https://discord.gg/bq8a9yGMWh
Skype -> https://join.skype.com/cnzQg3Kr1dnk
"...programar es fácil, hacer programas es difícil..."
UT Page -> https://carles9000.github.io/
Forum UT -> https://discord.gg/bq8a9yGMWh
Skype -> https://join.skype.com/cnzQg3Kr1dnk
- Jeff Barnes
- Posts: 933
- Joined: Sun Oct 09, 2005 1:05 pm
- Location: Ontario, Canada
- Contact:
Re: Sockets
Hi Carles,
I do have the line of code you mention but I get the GPF before I get that far.
This crashes the program: oSocket = TSocket():New( 2000 )
I do have the line of code you mention but I get the GPF before I get that far.
This crashes the program: oSocket = TSocket():New( 2000 )
Code: Select all | Expand
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
Thanks,
Jeff Barnes
(FWH 16.11, xHarbour 1.2.3, Bcc730)
Jeff Barnes
(FWH 16.11, xHarbour 1.2.3, Bcc730)
- Daniel Garcia-Gil
- Posts: 2365
- Joined: Wed Nov 02, 2005 11:46 pm
- Location: Isla de Margarita
- Contact:
Re: Sockets
Hello Jeff
try use a port number more big... ie. 5000
try use a port number more big... ie. 5000
our best documentation is the source code
Isla de Margarita Venezuela.
danielgarciagil@gmail.com
http://tdolphin.blogspot.com/
https://www.dropbox.com/referrals/NTI5N ... rc=global9
Isla de Margarita Venezuela.
danielgarciagil@gmail.com
http://tdolphin.blogspot.com/
https://www.dropbox.com/referrals/NTI5N ... rc=global9
- Eugeniusz Owsiak
- Posts: 60
- Joined: Fri Oct 07, 2005 5:38 am
- Location: Poland
Re: Sockets
Hi Jeff
This is a piece of my working program on WM 5.0 platform.
Eugeniusz
Code: Select all | Expand
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
This is a piece of my working program on WM 5.0 platform.
Eugeniusz
-
- Posts: 4
- Joined: Fri Oct 07, 2011 1:05 am
- Antonio Linares
- Site Admin
- Posts: 42425
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 15 times
- Been thanked: 48 times
- Contact:
Re: Sockets
Steve,
I guess this is the only way to go if we want to keep using Harbour on Windows Phone and Metro:
http://peterdn.com/post/To-make-a-Metro-Appx-Package-from-scratch-you-must-first-e280a6.aspx
But first of all we need a Harbour built for .NET, something that we could have building Harbour with MS C .NET
I guess this is the only way to go if we want to keep using Harbour on Windows Phone and Metro:
http://peterdn.com/post/To-make-a-Metro-Appx-Package-from-scratch-you-must-first-e280a6.aspx
But first of all we need a Harbour built for .NET, something that we could have building Harbour with MS C .NET