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
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!!!!!!!!!!!!!!!!!!
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....
result -> WindowCE Display Message Window :
TITLE : "not implemented yet" Message : _ftime()
result -> WindowCE Display Message Window :
TITLE : "not implemented yet" Message : localtime()
Test Model !!!
------------------------------------------------------------------------------
1. HP-RW6100 Mobile PDA
2. HHP Dolphin 9550 RF Scanner
------------------------------------------------------------------------------
Running Socket program Down.!!!
Running Socket program Down.!!!
Last edited by yunbg1 on Tue Nov 22, 2005 3:38 pm, edited 2 times in total.
FWH User
FWPPC User
FWLinux User
FWPPC User
FWLinux User
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Yunbg1,
You may use the function time() to give hh:mm:ss then calculate seconds.
hth
You may use the function time() to give hh:mm:ss then calculate seconds.
hth
Jon Munro
www.bscan456.com
www.bscan456.com