aMSN Forums
June 19, 2013, 04:36:55 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: New forum for aMSN !!
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: amsn lots of connections  (Read 6976 times)
luismanson
Newbie

Offline Offline

Posts: 41


View Profile
« on: April 13, 2008, 09:25:13 am »

Hi, i found a lot of connections on my router, after checking in paranoid mode i found what i quoted
my uptime is 3 days, i left amsn open almost 24/7, i was not chatting nor using webcam, i just received 3 files this week, so i cant find a reason to keep that many connections, anyone had this problem or a good explanation???

Quote

netstat -nap -A inet

Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 192.168.1.100:50026     65.54.228.15:1863       ESTABLISHED 862/wish
tcp        0      0 192.168.1.100:56311     207.46.26.127:1863      ESTABLISHED 862/wish
tcp        0      0 192.168.1.100:32899     207.46.27.17:1863       ESTABLISHED 862/wish
tcp        0      0 192.168.1.100:51178     207.46.26.114:1863      ESTABLISHED 862/wish
tcp        0      0 192.168.1.100:55884     192.168.1.101:22        ESTABLISHED 9377/ssh
tcp        0      0 192.168.1.100:43976     207.46.26.49:1863       ESTABLISHED 862/wish
tcp        0      0 192.168.1.100:55868     192.168.1.101:22        ESTABLISHED 9351/ssh
tcp        0      0 192.168.1.100:50469     207.46.26.151:1863      ESTABLISHED 862/wish
tcp        0      0 192.168.1.100:39527     207.46.27.33:1863       ESTABLISHED 862/wish
tcp        0      0 192.168.1.100:32909     64.4.37.17:1863         ESTABLISHED 862/wish
tcp        0      0 192.168.1.100:38126     207.46.26.100:1863      ESTABLISHED 862/wish
tcp        0      0 192.168.1.100:37187     207.46.26.141:1863      ESTABLISHED 862/wish
tcp        0      0 192.168.1.100:36126     207.46.27.58:1863       ESTABLISHED 862/wish
tcp        0      0 192.168.1.100:43174     65.54.171.16:1863       ESTABLISHED 862/wish
tcp        0      0 192.168.1.100:59345     207.46.27.26:1863       ESTABLISHED 862/wish
tcp        0      0 192.168.1.100:38876     207.46.27.177:1863      ESTABLISHED 862/wish
tcp        0      0 192.168.1.100:36853     65.54.228.28:1863       ESTABLISHED 862/wish
tcp        0      0 192.168.1.100:47891     207.46.26.24:1863       ESTABLISHED 862/wish
tcp        0      0 192.168.1.100:49009     64.4.37.29:1863         ESTABLISHED 862/wish
tcp        0      0 192.168.1.100:45102     207.46.26.198:1863      ESTABLISHED 862/wish
tcp        0      0 192.168.1.100:45691     207.46.26.87:1863       ESTABLISHED 862/wish
tcp        0      0 192.168.1.100:46965     207.46.26.151:1863      ESTABLISHED 862/wish
tcp        0      0 192.168.1.100:43607     207.46.26.119:1863      ESTABLISHED 862/wish
tcp        0      0 192.168.1.100:59449     207.46.26.133:1863      ESTABLISHED 862/wish
tcp        0      0 192.168.1.100:34850     207.46.27.87:1863       ESTABLISHED 862/wish
tcp        0      0 192.168.1.100:41047     207.46.26.112:1863      ESTABLISHED 862/wish
tcp        0      0 192.168.1.100:49198     207.46.26.33:1863       ESTABLISHED 862/wish
tcp        0      0 192.168.1.100:35045     207.46.27.44:1863       ESTABLISHED 862/wish
tcp        0      0 192.168.1.100:43858     65.54.171.53:1863       ESTABLISHED 862/wish
tcp        0      0 192.168.1.100:53209     207.46.26.28:1863       ESTABLISHED 862/wish
tcp        0      0 192.168.1.100:42594     207.46.26.48:1863       ESTABLISHED 862/wish
tcp        0      0 192.168.1.100:42609     65.54.228.24:1863       ESTABLISHED 862/wish
tcp        0      0 192.168.1.100:44649     207.46.106.30:1863      TIME_WAIT   -
tcp        0      0 192.168.1.100:37378     207.46.26.71:1863       ESTABLISHED 862/wish
tcp        0      0 192.168.1.100:42285     64.4.36.38:1863         ESTABLISHED 862/wish
tcp        0      0 192.168.1.100:37145     207.46.26.143:1863      ESTABLISHED 862/wish
tcp        0      0 192.168.1.100:37135     190.244.11.127:4048     ESTABLISHED 862/wish
tcp    63722      0 192.168.1.100:47628     207.46.26.169:1863      ESTABLISHED 862/wish
tcp        0      0 192.168.1.100:49498     207.46.26.37:1863       ESTABLISHED 862/wish
tcp        0      0 192.168.1.100:57500     207.46.26.25:1863       ESTABLISHED 862/wish
tcp        0      0 192.168.1.100:50525     65.54.228.28:1863       ESTABLISHED 862/wish
tcp        0      0 192.168.1.100:49127     207.46.27.190:1863      ESTABLISHED 862/wish
tcp        0      0 192.168.1.100:52821     207.46.26.183:1863      ESTABLISHED 862/wish
tcp        0      0 192.168.1.100:44620     207.46.27.162:1863      ESTABLISHED 862/wish
tcp     5896      0 192.168.1.100:35020     207.46.26.38:1863       ESTABLISHED 862/wish
tcp        0      0 192.168.1.100:46582     190.244.11.127:3958     ESTABLISHED 862/wish
tcp        0      0 192.168.1.100:40396     207.46.26.125:1863      ESTABLISHED 862/wish
tcp        0      0 192.168.1.100:48548     207.46.26.98:1863       ESTABLISHED 862/wish
tcp        0      0 192.168.1.100:33446     207.46.26.97:1863       ESTABLISHED 862/wish
tcp        0      0 192.168.1.100:34337     64.4.36.30:1863         ESTABLISHED 862/wish



thanks!
Logged
kakaroto
Administrator
Super Power User
*****
Offline Offline

Posts: 9428


View Profile WWW
« Reply #1 on: April 13, 2008, 08:21:53 pm »

do you use the keepalive plugin maybe ?
even if you don't chat, users will still come online and will download your display picture, or you will connect to them and download their display picture... the connection should be closed after 1 minute of inactivity, but if you have the keepalive plugin.. then maybe all those connections are kept open!... all those connections seem to be connection to a switchboard (server you use to chat with someone)...
Logged

KaKaRoTo
luismanson
Newbie

Offline Offline

Posts: 41


View Profile
« Reply #2 on: April 15, 2008, 01:56:29 am »

nope i dont have keepalive, (if it is a plugin) thats why i dont understand why so many connections
i have 9 open now, 3 open chats, all closed by inactivity, atleast 2 minutes ago
Logged
luismanson
Newbie

Offline Offline

Posts: 41


View Profile
« Reply #3 on: April 17, 2008, 12:59:55 am »

any ideas?
Logged
kakaroto
Administrator
Super Power User
*****
Offline Offline

Posts: 9428


View Profile WWW
« Reply #4 on: April 17, 2008, 02:48:04 am »

no sorry, I am completely cluless about this!
humm.. what you could do to 'debug' this is open the amsn console (ctrl-shift-C from the main window) and type :
Code:
fconfigure sockXXX

where 'XXX' would be the file descriptor of the socket...  you can easily find that by doing :
Code:
ls -l /proc/`pidof wish`/fd | grep socket

this will list you all the file descriptors of sockets used by amsn. (you might use `pidof wish8.5` or `pidof wish8.4` depending on if you hardcoded 'wish8.5' in the amsn startup script).
assuming you had in the output the filename '7 9 10 15' .. then you would do in amsn's console :
Code:
fconfigure sock7
fconfigure sock9
fconfigure sock10
fconfigure sock15  

this will output to you more info on what each socket has... (whether it is connected, to who, what options, etc..) hopefully, it will help you there...

one more option would be to copy paste this script I just wrote in amsn's console, it should give you the list of all the sockets opened by amsn... if you see that the list returned is less than the number of sockets you see opened with netstat, then there's a leak somewhere..
otherwise, post here the result so I can tell you what each socket is used for.. or how to investigate more on the usage of each of these sockets :
Code:

proc findSockets { {namespace "::" } } {
set result [list]
foreach v [info vars "${namespace}::*"] {
set content ""
if { [catch {set content [set $v]}] } {
foreach {key val} [array get $v] {
set content $val
if {[string first "sock" $content] == 0 &&
   ![catch {eof $content}]} {
lappend result $content
puts "Found socket $content in variable ${v} ($key)"
}

}
} else {
if {[string first "sock" $content] == 0  &&
   ![catch {eof $content}] } {
lappend result $content
puts "Found socket $content in variable ${v}"
}
}
}
foreach n [namespace children $namespace] {
set res [findSockets $n]
set result [concat $result $res]
}

return $result
}

findSockets


p.s: yeah, you should probably use both methods in trying to figure out what's wrong. a socket that wasn't found in the second method but you can see it's fd in /proc means that it's a socket that got created, never closed, and we don't have a reference to it anymore so we can't close it...
thanks
Logged

KaKaRoTo
luismanson
Newbie

Offline Offline

Posts: 41


View Profile
« Reply #5 on: April 17, 2008, 10:43:33 pm »

Ok, thanks for your help and explanation!! Cheesy here is the output

Vger is my PC, and 192.168.1.1 is my router (with ddwrt), i had one active chat hile i was doing that.
Code:

(amsn) 10 % findSockets
Found socket sock6 in variable ::lockSock
Found socket sock26 in variable ::Connection::Snit_inst42::options (-sock)
Found socket sock13 in variable ::Connection::Snit_inst24::options (-sock)
Found socket sock27 in variable ::Connection::Snit_inst44::options (-sock)
Found socket sock16 in variable ::Connection::Snit_inst26::options (-sock)
Found socket sock8 in variable ::Connection::Snit_inst10::options (-sock)
Found socket sock7 in variable ::Connection::Snit_inst2::options (-sock)
Found socket sock18 in variable ::Connection::Snit_inst28::options (-sock)
Found socket sock9 in variable ::Connection::Snit_inst12::options (-sock)
Found socket sock28 in variable ::Connection::Snit_inst48::options (-sock)
Found socket sock21 in variable ::Connection::Snit_inst32::options (-sock)
Found socket sock10 in variable ::Connection::Snit_inst14::options (-sock)
Found socket sock22 in variable ::Connection::Snit_inst34::options (-sock)
Found socket sock11 in variable ::Connection::Snit_inst16::options (-sock)
Found socket sock23 in variable ::Connection::Snit_inst36::options (-sock)
Found socket sock12 in variable ::Connection::Snit_inst18::options (-sock)
Found socket sock17 in variable ::Connection::Snit_inst20::options (-sock)
Found socket sock24 in variable ::Connection::Snit_inst38::options (-sock)
Found socket sock25 in variable ::Connection::Snit_inst40::options (-sock)
[b]sock6 sock26 sock13 sock27 sock16 sock8 sock7 sock18 sock9 sock28 sock21
sock10 sock22 sock11 sock23 sock12 sock17 sock24 sock25[/b]

(amsn) 11 % fconfigure sock6
-blocking 1 -buffering full -buffersize 4096 -encoding iso8859-1 -eofchar {} -translation auto -sockname {127.0.0.1 localhost 60995}

(amsn) 12 % fconfigure sock26
-blocking 0 -buffering none -buffersize 4096 -encoding binary -eofchar {{} {}} -translation {lf lf} -peername {207.46.27.194 by2msg2205115.phx.gbl 1863} -sockname {192.168.1.100 Vger.lan.generaciongeek.com 60743}

(amsn) 13 % fconfigure sock13
-blocking 0 -buffering none -buffersize 4096 -encoding binary -eofchar {{} {}} -translation {lf lf} -peername {207.46.27.163 by2msg2105005.mixer.edge.messenger.live.com 1863} -sockname {192.168.1.100 Vger.lan.generaciongeek.com 54559}

(amsn) 14 % fconfigure sock27
-blocking 0 -buffering none -buffersize 4096 -encoding binary -eofchar {{} {}} -translation {lf lf} -peername {65.54.171.23 by1msg2082110.mixer.edge.messenger.live.com 1863} -sockname {192.168.1.100 Vger.lan.generaciongeek.com 55400}

(amsn) 15 % fconfigure sock16
-blocking 0 -buffering none -buffersize 4096 -encoding binary -eofchar {{} {}} -translation {lf lf} -peername {207.46.26.90 by2msg1161916.phx.gbl 1863} -sockname {192.168.1.100 Vger.lan.generaciongeek.com 36368}

(amsn) 16 % fconfigure sock8
-blocking 0 -buffering none -buffersize 4096 -encoding binary -eofchar {{} {}} -translation {lf lf} -peername {207.46.27.176 by2msg2105018.mixer.edge.messenger.live.com 1863} -sockname {192.168.1.100 Vger.lan.generaciongeek.com 34563}

(amsn) 17 % fconfigure sock8
-blocking 0 -buffering none -buffersize 4096 -encoding binary -eofchar {{} {}} -translation {lf lf} -peername {207.46.27.176 by2msg2105018.mixer.edge.messenger.live.com 1863} -sockname {192.168.1.100 Vger.lan.generaciongeek.com 34563}

(amsn) 18 % fconfigure sock7
-blocking 0 -buffering none -buffersize 4096 -encoding binary -eofchar {{} {}} -translation {lf lf} -peername {207.46.110.48 by2msg1204116.gateway.edge.messenger.live.com 1863} -sockname {192.168.1.100 Vger.lan.generaciongeek.com 59859}

(amsn) 19 % fconfigure sock18
-blocking 0 -buffering none -buffersize 4096 -encoding binary -eofchar {{} {}} -translation {lf lf} -peername {207.46.26.54 by2msg1141801.phx.gbl 1863} -sockname {192.168.1.100 Vger.lan.generaciongeek.com 37656}

(amsn) 20 % fconfigure sock9
-blocking 0 -buffering none -buffersize 4096 -encoding binary -eofchar {{} {}} -translation {lf lf} -peername {64.4.36.17 by1msg4082104.phx.gbl 1863} -sockname {192.168.1.100 Vger.lan.generaciongeek.com 59867}

(amsn) 21 % fconfigure sock28
-blocking 0 -buffering none -buffersize 4096 -encoding binary -eofchar {{} {}} -translation {lf lf} -peername {207.46.27.191 by2msg2205112.phx.gbl 1863} -sockname {192.168.1.100 Vger.lan.generaciongeek.com 33510}

(amsn) 22 % fconfigure sock21
-blocking 0 -buffering none -buffersize 4096 -encoding binary -eofchar {{} {}} -translation {lf lf} -peername {207.46.26.24 by2msg1131413.mixer.edge.messenger.live.com 1863} -sockname {192.168.1.100 Vger.lan.generaciongeek.com 44934}

(amsn) 23 % fconfigure sock21
-blocking 0 -buffering none -buffersize 4096 -encoding binary -eofchar {{} {}} -translation {lf lf} -peername {207.46.26.24 by2msg1131413.mixer.edge.messenger.live.com 1863} -sockname {192.168.1.100 Vger.lan.generaciongeek.com 44934}

(amsn) 24 % fconfigure sock10
-blocking 0 -buffering none -buffersize 4096 -encoding binary -eofchar {{} {}} -translation {lf lf} -peername {65.54.228.52 by1msg3082315.phx.gbl 1863} -sockname {192.168.1.100 Vger.lan.generaciongeek.com 57676}

(amsn) 25 % fconfigure sock22
-blocking 0 -buffering none -buffersize 4096 -encoding binary -eofchar {{} {}} -translation {lf lf} -peername {207.46.26.129 by2msg1262113.mixer.edge.messenger.live.com 1863} -sockname {192.168.1.100 Vger.lan.generaciongeek.com 37707}

(amsn) 26 % fconfigure sock11
-blocking 0 -buffering none -buffersize 4096 -encoding binary -eofchar {{} {}} -translation {lf lf} -peername {64.4.36.38 by1msg4082301.phx.gbl 1863} -sockname {192.168.1.100 Vger.lan.generaciongeek.com 55595}

(amsn) 27 % fconfigure sock23
-blocking 0 -buffering none -buffersize 4096 -encoding binary -eofchar {{} {}} -translation {lf lf} -peername {207.46.26.15 by2msg1131404.phx.gbl 1863} -sockname {192.168.1.100 Vger.lan.generaciongeek.com 55727}

(amsn) 28 % fconfigure sock12
-blocking 0 -buffering none -buffersize 4096 -encoding binary -eofchar {{} {}} -translation {lf lf} -peername {65.54.228.22 by1msg3082109.mixer.edge.messenger.live.com 1863} -sockname {192.168.1.100 Vger.lan.generaciongeek.com 56844}

(amsn) 29 % fconfigure sock17
-blocking 0 -buffering none -buffersize 4096 -encoding binary -eofchar {{} {}} -translation {lf lf} -peername {64.4.37.14 by1msg5082501.mixer.edge.messenger.live.com 1863} -sockname {192.168.1.100 Vger.lan.generaciongeek.com 43076}

(amsn) 30 % fconfigure sock24
-blocking 0 -buffering none -buffersize 4096 -encoding binary -eofchar {{} {}} -translation {lf lf} -peername {207.46.27.198 by2msg2205119.phx.gbl 1863} -sockname {192.168.1.100 Vger.lan.generaciongeek.com 49758}

(amsn) 31 % fconfigure sock25
-blocking 0 -buffering none -buffersize 4096 -encoding binary -eofchar {{} {}} -translation {lf lf} -peername {207.46.26.151 by2msg1172214.phx.gbl 1863} -sockname {192.168.1.100 Vger.lan.generaciongeek.com 35296}

(amsn) 32 %
Logged
kakaroto
Administrator
Super Power User
*****
Offline Offline

Posts: 9428


View Profile WWW
« Reply #6 on: April 18, 2008, 12:09:35 am »

humm... ok, at least it's not a leak, amsn knows about them...  it does keep a socket open when you have an active chat window.. (even if it's disconnected due to inactivity).. but as soon as you close the chat window, it should destroy the socket...
I just realized you didn't specify which version of aMSN you're using ? if it's not the latest SVN, then try upgrading to it and see if it changes anything...

humm.. ok forget that, I just saw it  happens to me too.. apparently, if a user opens a connection with you (to download your display picture), you have no chat window to close, so it doesn't close the socket.. waiting for you to close the chat window which of course.. doesn't exist...
ok.. after looking at the code, it looks like we *do* 'destroy the connection' when there is no chat window associated (downloading of DP).. but there was a missing line in there.. we deleted the connection from the list of connection available, but we forgot to destroy the whole object, thus closing the socket...
This should now be fixed in SVN revision 9744.. if you don't use SVN, then open protocol.tcl and search for "inactivity", it should appear once.. a few lines below, you'll see a "DelSBFor", under it add a "KillSB" , just like you can see in here : http://amsn.svn.sourceforge.net/viewvc/amsn/trunk/amsn/protocol.tcl?r1=9744&r2=9743&pathrev=9744
thanks for reporting and helping to fix this socket leak!
Tell me if it works for you!
Logged

KaKaRoTo
luismanson
Newbie

Offline Offline

Posts: 41


View Profile
« Reply #7 on: April 18, 2008, 02:03:18 am »

i downloaded SVN, i do this from time to time Wink
thanks for fixing this.
if i see more sockets i will be back to you, i just opened amsn a minute ago

thanks again Cheesy
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!