Whenever using a TClientSocket and TClientDataSet (Socket Server)
at the same time
eg:
ClientSocket->Open();
.......
ClientDataSet->Open();
error must be occured
class EvariantInvalidArgError with message 'Invalid argument'
class ESocketConnectionError with message 'Error reading form socket'
if ClientSocket don't open, this is no error
How can I solve it???????
Help
Too bad
"Emmanuel" дÈëÏûÏ¢ÐÂÎÅ:474fd757@newsgroups.borland.com...
> you can make a simple program to test it, it must be error
>
> "Remy Lebeau (TeamB)" дÈëÏûÏ¢ÐÂÎÅ:474fadb6$1@newsgroups.borland.com...
>>
>> "Emmanuel" wrote in message
>> news:474f9ef5@newsgroups.borland.com...
>>
>>> after that update or Get data by TClientDataSet from/to
>>> machine A, Error is occured
>>
>> Again, there is no way to diagnose that with the limited information you
>> have provided so far.
>>
>>> I have also think may be the local port problem
>>
>> TClientDataSet uses a random local port, so there shouldn't be any
>> conflict
>> there.
>>
>>> how can I set the local port for TClientDataSet,and SocketConnection?
>>
>> You can't. They don't expose that functionality.
>>
>>
>> Gambit
>>
>>
>
>
you can make a simple program to test it, it must be error
"Remy Lebeau (TeamB)" дÈëÏûÏ¢ÐÂÎÅ:474fadb6$1@newsgroups.borland.com...
>
> "Emmanuel" wrote in message
> news:474f9ef5@newsgroups.borland.com...
>
>> after that update or Get data by TClientDataSet from/to
>> machine A, Error is occured
>
> Again, there is no way to diagnose that with the limited information you
> have provided so far.
>
>> I have also think may be the local port problem
>
> TClientDataSet uses a random local port, so there shouldn't be any
> conflict
> there.
>
>> how can I set the local port for TClientDataSet,and SocketConnection?
>
> You can't. They don't expose that functionality.
>
>
> Gambit
>
>
"Emmanuel" wrote in message
news:474f9ef5@newsgroups.borland.com...
> after that update or Get data by TClientDataSet from/to
> machine A, Error is occured
Again, there is no way to diagnose that with the limited information you
have provided so far.
> I have also think may be the local port problem
TClientDataSet uses a random local port, so there shouldn't be any conflict
there.
> how can I set the local port for TClientDataSet,and SocketConnection?
You can't. They don't expose that functionality.
Gambit
>
> Don't open them at the same time, obviously. Without knowing more about
> why
> the EVariantInvalidArgError is being raised, all I can guess is that both
> components are trying to use the same port at the same one, and one of
> them
> is going to fail as a result.
My Program is that
Firstly open the TClientDataSet by SocketServer(port 211) to machine A,
there is no problem
Secondly Open a TClientSocket connect to other machine B (Remote port is
9000) , there is also no problem,
and then communicate to B,and get data from machine B, there is also no
problem
after that update or Get data by TClientDataSet from/to machine A, Error is
occured
I have also think may be the local port problem, but how can I set the local
port for TClientDataSet,and SocketConnection?
>
> Gambit
>
>
"Emmanuel" wrote in message
news:474ecbea@newsgroups.borland.com...
> Whenever using a TClientSocket and TClientDataSet
> (Socket Server) at the same time
> eg:
>
> ClientSocket->Open();
> ......
> ClientDataSet->Open();
>
> error must be occured
>
> class EvariantInvalidArgError with message 'Invalid argument'
There is no way to track that down without seeing a stack trace leading up
to the exception being raised.
> class ESocketConnectionError with message 'Error reading form socket'
That exception is only raised when the socket API recv() function does not
return as many bytes as were asked for during a reading operation. Which,
frankly, is really stupid on TClientDataSet's part, because that is not the
proper way to handle socket data. recv() is never guaranteed to return all
of the requested bytes in one call. If the return value is > 0 and more
bytes are expected, recv() is supposed to be called again. But
TClientDataSet does not do that.
> if ClientSocket don't open, this is no error
>
> How can I solve it???????
Don't open them at the same time, obviously. Without knowing more about why
the EVariantInvalidArgError is being raised, all I can guess is that both
components are trying to use the same port at the same one, and one of them
is going to fail as a result.
Gambit