Page 1 of 1

Running Socket program Down.!!!

Posted: Sun Nov 20, 2005 8:20 am
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
------------------------------------------------------------------------------

Re: Running Socket program Down.!!!

Posted: Tue Nov 22, 2005 3:41 pm
by yunbg1
Hi All
Help me please !!!

Posted: Tue Nov 22, 2005 6:36 pm
by Antonio Linares
We are going to check it as soon as possible. We have been busy cause 2.7 version launch.

Posted: Tue Nov 22, 2005 10:51 pm
by Jon Munro
Yunbg1,
You may use the function time() to give hh:mm:ss then calculate seconds.
hth

Posted: Fri Nov 25, 2005 1:47 am
by yunbg1
Hi Antonio.

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

Best Regards.