Ver Mensaje Individual
  #7  
Antiguo 02-10-2015
Avatar de ecfisa
ecfisa ecfisa is offline
Moderador
 
Registrado: dic 2005
Ubicación: Tres Arroyos, Argentina
Posts: 10.508
Reputación: 36
ecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to behold
Hola c64.

No especificas que componente están usando y en el video no pude apreciar cual es. Pero, como para darte una idea, te pongo un ejemplo muy simple de como enviar y recibir unos datos con los componentes TClientSocket y TServerSocket. Básicamente no puede ser muy diferente a lo que tienen que hacer.

Receptor (server):
Código PHP:
struct {
  
int a;
  
int b;
  
int c;
data;

void __fastcall TForm1::FormCreate(TObject *Sender)
{
  
ServerSocket1->Port 23// Puerto
  
ServerSocket1->Open();
}

void __fastcall TForm1::ServerSocket1ClientRead(TObject *Sender,
  
TCustomWinSocket *Socket)
{
  
Socket->ReceiveBuf(&datasizeof(data));
  
ListBox1->Items->Add(data.a);
  
ListBox1->Items->Add(data.b);
  
ListBox1->Items->Add(data.c);
}

void __fastcall TForm1::FormClose(TObject *SenderTCloseAction &Action)
{
  
ServerSocket1->Close();

Emisor (cliente):
Código PHP:
struct {
  
int a;
  
int b;
  
int c;
data;

void __fastcall TForm1::FormCreate(TObject *Sender)
{
  
ClientSocket1->Port =  23;  // Puerto
  
ClientSocket1->Host =  "192.168.0.62"//IP server
  
ClientSocket1->Open();
}

void __fastcall TForm1::btnSendClick(TObject *Sender)
{
  
// valores a enviar
  
data.1111;
  
data.2222;
  
data.3333;

  if (
ClientSocket1->Active)
    
ClientSocket1->Socket->SendBuf(&datasizeof(data));
}

void __fastcall TForm1::FormClose(TObject *SenderTCloseAction &Action)
{
  
ClientSocket1->Close();

Saludos
__________________
Daniel Didriksen

Guía de estilo - Uso de las etiquetas - La otra guía de estilo ....

Última edición por ecfisa fecha: 02-10-2015 a las 22:34:31.
Responder Con Cita