Re: fork + socket -server fails
- From: Michael Schlenker <schlenk@xxxxxxxxxxxxxxxx>
- Date: Sun, 02 Apr 2006 12:20:33 +0200
Wart schrieb:
While debugging a problem with tclhttpd on Fedora Core 5, I noticed theI don't know about FC5, but start up your tclsh and take a look at the
following changed behavior.
If I use [fork] from either Expect or Tclx in combination with [socket
-server], the socket does not accept connections. This works fine on
Fedora Core 4.
Here is the sample script that I am using. On FC-4 I can telnet to port
8015 and the script prints out the expected "Accepted connection:"
message. On FC-5, nothing is printed. Turning off selinux and the
firewall do not fix the problem.
#!/usr/bin/tclsh
package require Expect
set port 8015
if {[fork]} {exit}
set serverSocket [socket -server myAccept $port]
puts "$serverSocket listening on port $port"
proc myAccept {args} {
puts "Accepted connection: $args"
}
vwait forever
FC-4 uses tcl-8.4.9 and expect-5.43.0. FC-5 uses tcl-8.4.12 and
expect-5.43.0. Has something changed between 8.4.9 and 8.4.12 that
might cause this, or is it more likely something changed in Fedora Core
that is causing the problem?
--Wart
tcl_platform array..., it could be that one build is threaded and the
other is not. (and threads do not play well with fork...)
Michael
.
- Follow-Ups:
- Re: fork + socket -server fails
- From: Wart
- Re: fork + socket -server fails
- References:
- fork + socket -server fails
- From: Wart
- fork + socket -server fails
- Prev by Date: fork + socket -server fails
- Next by Date: Tk_CoordsToWindow fauilure?
- Previous by thread: fork + socket -server fails
- Next by thread: Re: fork + socket -server fails
- Index(es):
Relevant Pages
|