<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Re: [Live-devel] Close specified client by IP</TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<STYLE type=text/css>BLOCKQUOTE {
        PADDING-BOTTOM: 0px; PADDING-TOP: 0px
}
DL {
        PADDING-BOTTOM: 0px; PADDING-TOP: 0px
}
UL {
        PADDING-BOTTOM: 0px; PADDING-TOP: 0px
}
OL {
        PADDING-BOTTOM: 0px; PADDING-TOP: 0px
}
LI {
        PADDING-BOTTOM: 0px; PADDING-TOP: 0px
}
</STYLE>
<META content="MSHTML 6.00.2900.6003" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=996111608-15092010><FONT face=Arial
color=#0000ff size=2>Thanks Ross, I just want to close client connection by IP
address and not consider port number, because in our project not allowed more
than one connection from the same IP address. After reading your reply, I'm
sorry that I still don't know how to do this. I just got the client IP address
that would be closed, according to your suggestion I must find the clientsession
first, but how can I find its clientsession by this IP
address?</FONT></SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> live-devel-bounces@ns.live555.com
[mailto:live-devel-bounces@ns.live555.com] <B>On Behalf Of </B>Ross
Finlayson<BR><B>Sent:</B> Tuesday, September 14, 2010 6:03 AM<BR><B>To:</B>
LIVE555 Streaming Media - development & use<BR><B>Subject:</B> Re:
[Live-devel] Close specified client by IP<BR></FONT><BR></DIV>
<DIV></DIV>
<BLOCKQUOTE cite="" type="cite"><FONT face=Arial size=-1>I have written a
control panel to control Live555 VOD server, in this panel, administrator
could see active connection's IP addresses, I want to close some specified
connections by IP address, now the RTSPServer can receive these specified IP
addresses, but how could I close these connections in
RTSPServer.cpp?</FONT></BLOCKQUOTE>
<DIV><BR></DIV>
<DIV>You can cleanly close a connection - within the "RTSPServer" - simply by
deleting its "RTSPClientSession" object. Therefore, all you need is a way
of mapping "client IP address"+"client port number" to
"RTSPClientSession".</DIV>
<DIV><BR></DIV>
<DIV>(Note that just knowing the client's IP address is not enough, because it's
possible for more than one connection to come from the same IP address.
You will need to use the client's port number as well.)</DIV>
<DIV><BR></DIV>
<DIV>I suggest that you subclass "RTSPServer" to add a hash table that maps
"client IP address"+"client port number" to "RTSPClientSession". Redefine
the "createNewClientSession()" virtual function to add an entry into this hash
table each time that you create a new "RTSPClientSession" object. Also,
whenever you delete a "RTSPClientSession" object (to close its connection),
remove the corresponding hash table entry.</DIV>
<DIV><BR></DIV>
<DIV>As always, you should be able to do this just via subclassing - without
modifying any of the supplied "LIVE555" code.</DIV><X-SIGSEP><PRE>--
</PRE></X-SIGSEP>
<DIV><BR>Ross Finlayson<BR>Live Networks,
Inc.<BR>http://www.live555.com/</DIV><p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>IMPORTANT NOTE: This e-mail and any attachment are confidential and may contain trade secrets and may also be legally privileged or otherwise protected from disclosure. If you have received it in error, you are herewith informed about its status. Please notify us immediately by reply e-mail and then delete this e-mail and any attachment from your system. You are prohibited from making use of or copying this e-mail or any attachment or disclosing the contents to any other person.</span><p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>In case you become aware of any unethical business behavior or violation of laws, particularly those against the Anti-corruption laws and Anti-trust laws, Siemens Compliance HelpDesk "Tell us" can be reached at <A href="http://www.siemens.com.cn/compliancehelpdesk">www.siemens.com.cn/compliancehelpdesk</A><br></span><br><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'> < Disclaimer in Chinese below, characters may not be displayed correctly.><br></span><br><p><span lang=ZH-CN style='font-size:10.0pt;font-family:??;mso-ascii-font-family:Arial;mso-bidi-font-family:Arial'>????:???????????,???????????????????????????,????????????,?????????????????????????????????????,??????????????????????????????</span><p><span lang=ZH-CN style='font-size:10.0pt;font-family:??;mso-ascii-font-family:Arial;mso-bidi-font-family:Arial'>?????????????????,?????????????????,????????????"Tell us"??,???<A href="http://www.siemens.com.cn/compliancehelpdesk">www.siemens.com.cn/compliancehelpdesk</A><br></span><span style='font-family:"Arial","sans-serif"'><span style='mso-tab-count:1'> </span><o:p></o:p></span></p></BODY></HTML>