-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UDP ports not being closed #78
Comments
Hi,
At least, you can try write the same code on C# or C++ to find out if the
problem in com4j or COM object or in your incorrect usage of it.
Basically, if c# copy runs fine without holding all available udp ports,
then it means com4j keep something unclosed, btw you can't rely on any
cleanup code that called when object is GCed, since you don't know when gc
is run, so call all clean/close methods yourself if you don't yet.
ср, 12 дек. 2018 г., 18:36 goyocasero [email protected]:
… Hi.
We're using com4j in our Java 8 application to connect to our Microsoft
Active Directory, using the following code:
` _Connection con = com4j.typelibs.ado20.ClassFactory.createConnection();
try {
con.provider("ADsDSOObject");
con.open("AD-Anon-Search", "", "", -1/*default*/);
_Command cmd = com4j.typelibs.ado20.ClassFactory.createCommand();
try
{
cmd.activeConnection(con);
cmd.commandText("<GC://" + this.domain + ">;" + filter.encode() + ";" + atributes + ";SubTree");
_Recordset rs = cmd.execute(Variant.getMissing(), Variant.getMissing(), -1/*default*/);
try
{
if (rs.eof())
return nullValue;
else
return mapper.mapRecordSet(rs);
} finally {
rs.close();
rs.dispose();
}
} finally {
cmd.dispose();
}
} finally {
con.close();
con.dispose();
COM4J.cleanUp();
}`
We're noticing that everytime the command executes it opens an UDP
connection against our AD, but this connection is never closed. So, after
some time, we got all ours UDP ports opened.
AFAIK, we're closing everythin up. aren't we? Is there anything else we
should do?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#78>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB0px_tt5S_n0Rg7CGrM1jAPrAFxaSDpks5u4SJmgaJpZM4ZPrpj>
.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi.
We're using com4j in our Java 8 application to connect to our Microsoft Active Directory, using the following code:
` _Connection con = com4j.typelibs.ado20.ClassFactory.createConnection();
try {
con.provider("ADsDSOObject");
con.open("AD-Anon-Search", "", "", -1/default/);
We're noticing that everytime the command executes it opens an UDP connection against our AD, but this connection is never closed. So, after some time, we got all ours UDP ports opened.
AFAIK, we're closing everythin up. aren't we? Is there anything else we should do?
The text was updated successfully, but these errors were encountered: