P
piotrek
Hello all.
I have a problem and my solution but i have to make sure that it want cause
memory problems.
i have a class FTP and 'private Socket CONNECTION = null;'
Then i have a method PASV()
{
CONNECTION = new Socket(AddressFamily.InterNetwork, SocketType.Stream,
ProtocolType.Tcp);
......
IPEndPoint ep = new IPEndPoint(IPHost.AddressList[0] , port);
CONNECTION.Bind(ep); CONNECTION.Listen(1);
....
}
1. Object of FTP is created.
2. PASV is called once.
3. CONNECTION is closed.
4. PASV is called twice.
5. Cannot bind - only one usage of socket address is normally permited -
exeption.
i dont exactly understand why i cant bind when i closed socket before i bind
again.
Also thought that i can make Collection of Private sockets, but iam not sure
if it want cause that closed and unused sockets will occupy the memory.
If there is better solution - wothout making Collection, please let me know.
Thanks for your time.
PK
I have a problem and my solution but i have to make sure that it want cause
memory problems.
i have a class FTP and 'private Socket CONNECTION = null;'
Then i have a method PASV()
{
CONNECTION = new Socket(AddressFamily.InterNetwork, SocketType.Stream,
ProtocolType.Tcp);
......
IPEndPoint ep = new IPEndPoint(IPHost.AddressList[0] , port);
CONNECTION.Bind(ep); CONNECTION.Listen(1);
....
}
1. Object of FTP is created.
2. PASV is called once.
3. CONNECTION is closed.
4. PASV is called twice.
5. Cannot bind - only one usage of socket address is normally permited -
exeption.
i dont exactly understand why i cant bind when i closed socket before i bind
again.
Also thought that i can make Collection of Private sockets, but iam not sure
if it want cause that closed and unused sockets will occupy the memory.
If there is better solution - wothout making Collection, please let me know.
Thanks for your time.
PK