Page 1 of 1

AYUDA !!! EL SOCKET SERVIDOR PUEDE ENVIAR DATOS AL CLIENTE

Posted: Wed Oct 18, 2006 1:58 pm
by prm_pedro
HOLA BUENOS DIAS A TODOS, MI DUDA ES COMO LE HAGO PARA QUE EL SOCKET SERVIDOR LE ENVIE UNA RESPUESTA AL CLIENTE,ES DECIR CUANDO SE HAYA TERMINADO DE EJECUTAR ALGUN PROCESO, O COMO HACER QUE EL SERVIDOR LE ENVIE DATOS DE REGRESO AL CLIENTE

:lol: EL CODIGO DEL CLIENTE ES EL SIGUINETE

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

:lol: POR LA PARTE DEL SERVER

function Server()
oSocket = TSocket():New(2000)
oSocket:bAccept = { | oSocket | oClient := TSocket():Accept( oSocket:nSocket ),;
oClient:Cargo := ST_COMMAND,;
oClient:bRead := { | oSocket | OnRead( oSocket,"F:\LOC\POS\CAMBIO\BASE0001.DBF")},;
oClient:bClose := { | oSocket | OnClose( oSocket ) } }
oSocket:Listen()
return nil


:P ESPERO Y ME PUEDAN AYUDAR Y MUCHAS GRACIAS

Posted: Wed Oct 18, 2006 4:50 pm
by Antonio Linares
Pedro,

oClient:SendData( "...lo que sea..." )

si esto ya esta

Posted: Wed Oct 18, 2006 6:34 pm
by prm_pedro
OYE ANTONIO SI ESTO SI ES ASI, PERO LO QUE YO DECEO ES COMO EL SERVER TOME DATOS Y SE LOS ENVIE AL CLIENTE