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
------------------------------------------------------------------------------