| Ver tema anterior :: Ver tema siguiente |
| Autor |
Mensaje |
lila Cdt

Registrado: 30 Nov 2003Mensajes: 8
|
Publicado: Jue 18 Dic, 2003 3:00 pm Asunto: Ayudita |
|
|
Estoy trabajando con cliente/servidor y necesito saber como puedo desconectar el servidor cuando esta en uso. Utilizo ServerSocket en el servidor
si alguien me puede ayudar se lo agradecere muchiiiiisimo
ahi les mando el codigo:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
ServerSocket1->Open();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ServerSocket1ClientConnect(TObject *Sender,
TCustomWinSocket *Socket)
{
ListBox1->Items->Add("Conexión:"+ Socket->RemoteAddress);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender)
{
ListBox1->Items->Add("Server:"+Edit1->Text);
for(int i=0;i<ServerSocket1->Socket->ActiveConnections;i++)
ServerSocket1->Socket->Connections[i]->SendText("Server:"+Edit1->Text);
Edit1->Clear();
Edit1->SetFocus();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ServerSocket1ClientRead(TObject *Sender,
TCustomWinSocket *Socket)
{
String MSG=Socket->ReceiveText();
ListBox1->Items->Add(MSG);
for(int i=0;i<ServerSocket1->Socket->ActiveConnections;i++)
ServerSocket1->Socket->Connections[i]->SendText(MSG);
}
gracias
Ultima edición por lila el Jue 18 Dic, 2003 9:09 pm, editado 2 veces |
|
| Volver arriba |
|
 |
Invitado
|
Publicado: Jue 18 Dic, 2003 5:31 pm Asunto: Re: Ayudita |
|
|
| lila escribió: | Estoy trabajando con un servidor y necesito saber como puedo desconectarlo. Utilizo ServerSocket en el servidor
gracias |  |
|
| Volver arriba |
|
 |
ikis Master


Registrado: 28 Dic 2002Mensajes: 703Ubicación: Madrid, España
|
Publicado: Vie 19 Dic, 2003 3:08 pm Asunto: |
|
|
| ServerSocket->Close() ?? |
|
| Volver arriba |
|
 |
|