Running Socket program Down.!!!

Post Reply
yunbg1
Posts: 107
Joined: Sun Nov 13, 2005 12:40 am
Location: Winnipeg Canada

Running Socket program Down.!!!

Post by yunbg1 »

Hi Antonio !

May I ask you a question.
Sample program check over....

SERVER(PC) -> CLIENT(PPC) OK !
SERVER(PC) <- CLIENT(PPC) Not Receive !


Test 1############

/*----------------------------------------------------------------------*/
WSAStartup()
nSocket := Socket( AF_INET, SOCK_STREAM, IPPROTO_IP )
BindToPort( nSocket, 2550 )

WSAAsyncSelect( nSocket, oWnd:hWnd, 0, ;//WM_ASYNCSELECT,;
nOr( FD_ACCEPT, FD_OOB, FD_READ, FD_CLOSE, FD_CONNECT, FD_WRITE ) )
ConnectTo( nSocket, 2550, "192.168.10.102" )
RETU NIL

:D result -> SocKet Init OK ! & Receive / Send OK !


Test 2############

/*----------------------------------------------------------------------*/
oSocket = TSocket():New( 2000 )
oSocket:bRead = { | oSocket | MsgInfo( oSocket:GetData() ) }
// Never use a MsgInfo() here because it hangs Windows!!!
oSocket:bConnect = { || }
oSocket:bClose = { || MsgInfo( "Server has closed!" ) }
oSocket:Connect( "192.168.0.15" ) // use the server IP address here

/*----------------------------------------------------------------------*/
this Source program----> problem \source\tsocket.prg

::cIPAddr = GetHostByName( GetHostName() )

-------------Ploblem!!!!!!!!!!!!!!!!!!

:cry: result ->program close & down !!!

Test 3############

/*----------------------------------------------------------------------*/
WSAStartup()
nSocket := Socket( AF_INET, SOCK_STREAM, IPPROTO_IP )
BindToPort( nSocket, 2550 )

WSAAsyncSelect( nSocket, oWnd:hWnd, 0, ;//WM_ASYNCSELECT,;
nOr( FD_ACCEPT, FD_OOB, FD_READ, FD_CLOSE, FD_CONNECT, FD_WRITE ) )
ConnectTo( nSocket, 2550, "192.168.10.102" )

SocketSend( nSocket, "A")
cData := ''
su := seconds()
do while .t.
nRetCode := Recv(nSocket, @cData)
if nRetCode == -1
exit
endi
if seconds() - su > 4 //4 sec wait
exit
endi
endd
Msginfo(cData)

seconds() Function use....

:cry: result -> WindowCE Display Message Window :
TITLE : "not implemented yet" Message : _ftime()

:cry: result -> WindowCE Display Message Window :
TITLE : "not implemented yet" Message : localtime()



Test Model !!!
------------------------------------------------------------------------------
1. HP-RW6100 Mobile PDA
2. HHP Dolphin 9550 RF Scanner
------------------------------------------------------------------------------
Last edited by yunbg1 on Tue Nov 22, 2005 3:38 pm, edited 2 times in total.
FWH User
FWPPC User
FWLinux User
yunbg1
Posts: 107
Joined: Sun Nov 13, 2005 12:40 am
Location: Winnipeg Canada

Re: Running Socket program Down.!!!

Post by yunbg1 »

Hi All
Help me please !!!
FWH User
FWPPC User
FWLinux User
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

We are going to check it as soon as possible. We have been busy cause 2.7 version launch.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Jon Munro
Posts: 42
Joined: Sun Oct 09, 2005 11:47 am
Location: Brisbane Australia
Contact:

Post by Jon Munro »

Yunbg1,
You may use the function time() to give hh:mm:ss then calculate seconds.
hth
yunbg1
Posts: 107
Joined: Sun Nov 13, 2005 12:40 am
Location: Winnipeg Canada

Post by yunbg1 »

Hi Antonio.

When can i get the program which you are checking now.

Best Regards.
FWH User
FWPPC User
FWLinux User
Post Reply