I wnat to send a message from one computer to another computer. My server and Client socket have a port number. My client socket has host number. My port number is 1111. Any help will be useful.


void __fastcall TForm1::ServerSocket1Accept(TObject *Sender,
TCustomWinSocket *Socket)
{
ServerSocket1->Socket->Accept(0);
}
//---------------------------------------------------------------------------

void __fastcall TForm1::cmdSendClick(TObject *Sender)
{
ClientSocket1->Socket->Connect(0);
}
//---------------------------------------------------------------------------



void __fastcall TForm1::ServerSocket1Listen(TObject *Sender,
TCustomWinSocket *Socket)
{
AnsiString info;
info=ServerSocket1->Socket->ReceiveText();
txttext->Caption=info;
}
//---------------------------------------------------------------------------


void __fastcall TForm1::FormCreate(TObject *Sender)
{
ServerSocket1->OnListen;
}
//---------------------------------------------------------------------------

void __fastcall TForm1::ClientSocket1Connect(TObject *Sender,
TCustomWinSocket *Socket)
{
ClientSocket1->Socket->SendText (txtsend->Text);
}
//---------------------------------------------------------------------------