Thread View: borland.public.cppbuilder.internet.socket
3 messages
3 total messages
Started by //---- Kelsie Z. Marshall ----//
Fri, 29 Feb 2008 05:45
TCP/IP Server block the access from one IP
Author: //---- Kelsie Z. Marshall ----//
Date: Fri, 29 Feb 2008 05:45
Date: Fri, 29 Feb 2008 05:45
22 lines
1569 bytes
1569 bytes
I made a TCP/IP Server and i need to block the access from one IP
Who can i do that ?
int i, port;
AnsiString IP;
IdTCPServer1->Active = false;
IdTCPServer1->Bindings->Clear();
IdTCPServer1->Bindings->Add();
IdTCPServer1->Bindings->Items[0]->Port =
EditTCPIPServerClientPort->Text.ToInt();
IdTCPServer1->Bindings->Items[0]->IP = StaticTextMyIP->Caption;
IdTCPServer1->Active = true;
TRichEditLogTCPIPServer::Add("TCP/IP ACTIVE");
for(i=0; i < IdTCPServer1->Bindings->Count ; i++)
{
port = IdTCPServer1->Bindings->Items[i]->Port;
IP = IdTCPServer1->Bindings->Items[i]->IP;
}
Re: TCP/IP Server block the access from one IP
Author: Remy Lebeau (TeamB)
Date: Fri, 29 Feb 2008 18:17
Date: Fri, 29 Feb 2008 18:17
22 lines
1780 bytes
1780 bytes
"//---- Kelsie Z. Marshall ----//" <kelsie.z.marshall@gmail.com> wrote in
message news:47c79c6d@newsgroups.borland.com...
> I made a TCP/IP Server and i need to block the access from one IP
>
> Who can i do that ?
There is no way to block an IP from connecting to the server at all (unless
you are using an external firewall, that is). All you can do is disconnect
the client in the OnConnect event handler after it has been accepted by the
server, ie:
void __fastcall TForm1::IdTCPServer1Connect(TIdPeerThread *AThread)
{
AnsiString IP = AThread->Connection->Socket->Binding->PeerIP;
if( IP is not allowed )
AThread->Connection->Disconnect();
}
Gambit
Re: TCP/IP Server block the access from one IP
Author: //---- Kelsie Z. Marshall ----//
Date: Fri, 29 Feb 2008 18:33
Date: Fri, 29 Feb 2008 18:33
42 lines
2255 bytes
2255 bytes
Man this is a nightmare.
Imagine if i want to make a Server and on million clients trying to
connection on my server the true is SHUTDOW.
With ZoneAlarm i cant do that ? Block on IP
Witch firewall for windows xp i can use ?
Thanks
Kelsie
"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message
news:47c84c35$1@newsgroups.borland.com...
>
> "//---- Kelsie Z. Marshall ----//" <kelsie.z.marshall@gmail.com> wrote in
> message news:47c79c6d@newsgroups.borland.com...
>
>> I made a TCP/IP Server and i need to block the access from one IP
>>
>> Who can i do that ?
>
> There is no way to block an IP from connecting to the server at all
> (unless you are using an external firewall, that is). All you can do is
> disconnect the client in the OnConnect event handler after it has been
> accepted by the server, ie:
>
> void __fastcall TForm1::IdTCPServer1Connect(TIdPeerThread *AThread)
> {
> AnsiString IP = AThread->Connection->Socket->Binding->PeerIP;
> if( IP is not allowed )
> AThread->Connection->Disconnect();
> }
>
>
> Gambit
>
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads