S
Skybuck Flying
Hello,
I am trying to use System.Net.Sockets in Delphi 8 for .NET.
The Socket.ReceiveFrom method has a RemoteEP parameter.
The type of this RemoteEP parameter is a EndPoint class.
The EndPoint class is an abstract class.
( Should I have type: a abstract class or an abstract class ? I would
prefer an abstract class )
I am starting to believe that this is a really extraordinary way of passing
parameters.
I am starting to believe that it actually uses inheritance to pass a
inherited class.
So I am starting to believe that ReceiveFrom will create a IPEndPoint and
pass it via a EndPoint parameter.
So that in the future the socket could also return a IPXEndPoint or
something like that.
Though I am not yet sure.
So my questions are:
1. Does Socket.ReceiveFrom create the RemoteEP instance ?
Looking at the examples I would say: no it does not !
2. Can this instance be of any inherited type ?
Possibly !
3. Does the programmer have to create the instance to pass to the RemoteEP
parameter ?
Looking at the examples I would say: yes !
4. If so what should the type be ?
EndPoint... try to use typecasts if possible.
5. If so how should the type be passed ? since typecasting does not seem to
work ?!
Unknown ?!
Seems like a little issue.
I think it would be better if ReceiveFrom would just create the instance or
something.
I am not sure yet
Typecasting like this doesn't work in delphi:
mBytesReceived := mSocket.ReceiveFrom( mReceiveBuffer,
EndPoint(mSourceIPEndPoint) );
Skybuck.
I am trying to use System.Net.Sockets in Delphi 8 for .NET.
The Socket.ReceiveFrom method has a RemoteEP parameter.
The type of this RemoteEP parameter is a EndPoint class.
The EndPoint class is an abstract class.
( Should I have type: a abstract class or an abstract class ? I would
prefer an abstract class )
I am starting to believe that this is a really extraordinary way of passing
parameters.
I am starting to believe that it actually uses inheritance to pass a
inherited class.
So I am starting to believe that ReceiveFrom will create a IPEndPoint and
pass it via a EndPoint parameter.
So that in the future the socket could also return a IPXEndPoint or
something like that.
Though I am not yet sure.
So my questions are:
1. Does Socket.ReceiveFrom create the RemoteEP instance ?
Looking at the examples I would say: no it does not !
2. Can this instance be of any inherited type ?
Possibly !
3. Does the programmer have to create the instance to pass to the RemoteEP
parameter ?
Looking at the examples I would say: yes !
4. If so what should the type be ?
EndPoint... try to use typecasts if possible.
5. If so how should the type be passed ? since typecasting does not seem to
work ?!
Unknown ?!
Seems like a little issue.
I think it would be better if ReceiveFrom would just create the instance or
something.
I am not sure yet
Typecasting like this doesn't work in delphi:
mBytesReceived := mSocket.ReceiveFrom( mReceiveBuffer,
EndPoint(mSourceIPEndPoint) );
Skybuck.