Board index » delphi » it is a error?

It's a error?


2003-07-10 02:40:41 AM
delphi205
From Delphi 7, the TServerSocket component was eliminated? I found an error in the TServerSocket. It does not obtain to catch the entire name of a computer. For example: My hostname is SERVER NT the component one only obtains to return the SERVER, or either, it does not obtain to catch a hostname that has space. It would like to know on these doubts, and they forgive me for the English. Ok?
 
 

Re:It's a error?

Quote
>From Delphi 7, the TServerSocket component was eliminated?

No, of course not. TServerSocket is Borland's own native TCP socket class,
they wouldn't just abandon it, it has been around for years.
But their use has been deprecated in D7.
That's why they're not installed by default, but once you install them
manually, you can continue to use them.
D7 still included them.
Andy
 

Re:It's a error?

"Remy Lebeau \(TeamB\)" <XXXX@XXXXX.COM>writes:
Quote

"NetCrusher" <XXXX@XXXXX.COM>writes
news:3f0c61a9$XXXX@XXXXX.COM...

>From Delphi 7, the TServerSocket component was eliminated?

No, of course not. TServerSocket is Borland's own native TCP socket class,
they wouldn't just abandon it, it has been around for years.

>My hostname is SERVER NT the component one only obtains
>to return the SERVER

What does your actual code look like?


Gambit
the code that I am using to return me the hostname and the IPAdress is:
On client connect
ShowMessage(Socket.Connections[0].RemoteHost);
ShowMessage(Socket.Connections[0].RemoteAddress);
if my hostname will be SERVER-NT then the RemoteHost returns me SERVER-NT, now if my hostname will be SERVER NT, then the RemoteHost only returns me the SERVER. Understand my question Gambit?
Yours Truly, Netcrusher
 

Re:It's a error?

"NetCrusher" <XXXX@XXXXX.COM>writes
Quote
if my hostname will be SERVER-NT then the RemoteHost returns
me SERVER-NT, now if my hostname will be SERVER NT, then
the RemoteHost only returns me the SERVER.
There is nothing you can do about that. TServerSocket uses getpeername()
and gethostbyaddr() to retreive the remote hostname, but it does not parse
the value at all, it is returned as-is. If you are seeing the value being
truncated, then that is WinSock's doing itself, not the VCL's doing.
Gambit